-
- All Implemented Interfaces:
-
android.app.Application.ActivityLifecycleCallbacks,android.content.ComponentCallbacks,android.content.ComponentCallbacks2,kotlinx.coroutines.CoroutineScope
public class SessionReplayInternal implements Application.ActivityLifecycleCallbacks, ComponentCallbacks2, CoroutineScope
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classSessionReplayInternal.Companion
-
Field Summary
Fields Modifier and Type Field Description private final CoroutineContextcoroutineContextprivate Loggerlogger
-
Method Summary
Modifier and Type Method Description CoroutineContextgetCoroutineContext()final LoggergetLogger()final UnitsetLogger(Logger logger)final Unitstart()final Unitstop()final Unitshutdown()final StringgetDeviceId()final UnitsetDeviceId(String deviceId)final LonggetSessionId()final UnitsetSessionId(Long sessionId)final UnitsetSessionAndDeviceId(Long sessionId, String deviceId)Set the current session and device ID Null values and same values will be ignored final UnitsetServerUrl(String serverUrl)final Unitflush()final Map<String, Object>getSessionReplayProperties()Returns properties that should be attach to all events in the session recording UnitonActivityCreated(Activity activity, Bundle p1)ActivityLifecycleCallbacks interface UnitonActivityStarted(Activity p0)UnitonActivityResumed(Activity activity)UnitonActivityPaused(Activity activity)UnitonActivityStopped(Activity p0)UnitonActivitySaveInstanceState(Activity p0, Bundle p1)UnitonActivityDestroyed(Activity p0)UnitonConfigurationChanged(Configuration newConfig)ComponentCallbacks2 interface UnitonLowMemory()UnitonTrimMemory(Integer level)final UnitlogViewHierarchy(View rootView)final UnitlogRRMobileViewNodeHierarchy(RRMobileViewNode rootNode)final UnitstoreEventsForSessionInBackgroundQueue(List<RREvent> events)final BooleanshouldRecord()Returns true if session should be recorded, false otherwise final UnitrecordLog(RecordLogLevel level, String message, Long timestamp)Record a log message to be included in the session replay. -
Methods inherited from class com.amplitude.android.sessionreplay.SessionReplayInternal
onActivityPostCreated, onActivityPostDestroyed, onActivityPostPaused, onActivityPostResumed, onActivityPostSaveInstanceState, onActivityPostStarted, onActivityPostStopped, onActivityPreCreated, onActivityPreDestroyed, onActivityPrePaused, onActivityPreResumed, onActivityPreSaveInstanceState, onActivityPreStarted, onActivityPreStopped -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getCoroutineContext
CoroutineContext getCoroutineContext()
-
getLogger
final Logger getLogger()
-
getDeviceId
final String getDeviceId()
-
setDeviceId
final Unit setDeviceId(String deviceId)
-
getSessionId
final Long getSessionId()
-
setSessionId
final Unit setSessionId(Long sessionId)
-
setSessionAndDeviceId
final Unit setSessionAndDeviceId(Long sessionId, String deviceId)
Set the current session and device ID Null values and same values will be ignored
-
setServerUrl
final Unit setServerUrl(String serverUrl)
-
getSessionReplayProperties
final Map<String, Object> getSessionReplayProperties()
Returns properties that should be attach to all events in the session recording
-
onActivityCreated
Unit onActivityCreated(Activity activity, Bundle p1)
ActivityLifecycleCallbacks interface
-
onActivityStarted
Unit onActivityStarted(Activity p0)
-
onActivityResumed
Unit onActivityResumed(Activity activity)
-
onActivityPaused
Unit onActivityPaused(Activity activity)
-
onActivityStopped
Unit onActivityStopped(Activity p0)
-
onActivitySaveInstanceState
Unit onActivitySaveInstanceState(Activity p0, Bundle p1)
-
onActivityDestroyed
Unit onActivityDestroyed(Activity p0)
-
onConfigurationChanged
Unit onConfigurationChanged(Configuration newConfig)
ComponentCallbacks2 interface
-
onLowMemory
Unit onLowMemory()
-
onTrimMemory
Unit onTrimMemory(Integer level)
-
logViewHierarchy
final Unit logViewHierarchy(View rootView)
-
logRRMobileViewNodeHierarchy
final Unit logRRMobileViewNodeHierarchy(RRMobileViewNode rootNode)
-
storeEventsForSessionInBackgroundQueue
final Unit storeEventsForSessionInBackgroundQueue(List<RREvent> events)
-
shouldRecord
final Boolean shouldRecord()
Returns true if session should be recorded, false otherwise
-
recordLog
final Unit recordLog(RecordLogLevel level, String message, Long timestamp)
Record a log message to be included in the session replay.
Logs are captured as rrweb plugin events with the "rrweb/console@1" plugin identifier. The log count is tracked per session/device combination and resets when either changes.
All state management happens on the single-threaded backgroundProcessor, eliminating the need for explicit synchronization.
- Parameters:
level- The log level (error, warn, log, or custom)message- The log message to record (will be truncated to maxMessageLength)timestamp- The timestamp of the log event (defaults to current time)
-
-
-
-