-
public final class SentryAndroidOptions extends SentryOptions
Sentry SDK options for Android
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
SentryAndroidOptions.BeforeCaptureCallback
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SentryAndroidOptions()
-
Method Summary
Modifier and Type Method Description void
setAnrEnabled(boolean anrEnabled)
Sets ANR (Application Not Responding) to enabled or disabled Default is enabled long
getAnrTimeoutIntervalMillis()
Returns the ANR timeout internal in Millis Default is 5000 = 5s void
setAnrTimeoutIntervalMillis(long anrTimeoutIntervalMillis)
Sets the ANR timeout internal in Millis Default is 5000 = 5s void
setAnrReportInDebug(boolean anrReportInDebug)
Sets ANR (Application Not Responding) to enabled or disabled on Debug mode Default is disabled void
setEnableActivityLifecycleBreadcrumbs(boolean enableActivityLifecycleBreadcrumbs)
void
setEnableAppLifecycleBreadcrumbs(boolean enableAppLifecycleBreadcrumbs)
void
setEnableSystemEventBreadcrumbs(boolean enableSystemEventBreadcrumbs)
void
setEnableAppComponentBreadcrumbs(boolean enableAppComponentBreadcrumbs)
void
setEnableNetworkEventBreadcrumbs(boolean enableNetworkEventBreadcrumbs)
void
setEnableAutoActivityLifecycleTracing(boolean enableAutoActivityLifecycleTracing)
void
setEnableActivityLifecycleTracingAutoFinish(boolean enableActivityLifecycleTracingAutoFinish)
IDebugImagesLoader
getDebugImagesLoader()
Returns the Debug image loader void
setDebugImagesLoader(@NotNull() IDebugImagesLoader debugImagesLoader)
Sets the image loader void
setAttachScreenshot(boolean attachScreenshot)
void
setAttachViewHierarchy(boolean attachViewHierarchy)
void
setCollectAdditionalContext(boolean collectAdditionalContext)
long
getStartupCrashDurationThresholdMillis()
Returns the Startup Crash duration threshold in Millis void
setEnableFramesTracking(boolean enableFramesTracking)
Enable or disable Frames Tracking, which is used to report slow and frozen frames. String
getNativeSdkName()
Returns the sdk name for the sentry native ndk module. void
setNativeSdkName(@Nullable() String nativeSdkName)
Sets the sdk name for the sentry-native ndk module. void
setEnableRootCheck(boolean enableRootCheck)
SentryAndroidOptions.BeforeCaptureCallback
getBeforeScreenshotCaptureCallback()
void
setBeforeScreenshotCaptureCallback(@NotNull() SentryAndroidOptions.BeforeCaptureCallback beforeScreenshotCaptureCallback)
Sets a callback which is executed before capturing screenshots. SentryAndroidOptions.BeforeCaptureCallback
getBeforeViewHierarchyCaptureCallback()
void
setBeforeViewHierarchyCaptureCallback(@NotNull() SentryAndroidOptions.BeforeCaptureCallback beforeViewHierarchyCaptureCallback)
Sets a callback which is executed before capturing view hierarchies. void
setEnableNdk(boolean enableNdk)
Sets NDK to ON or OFF void
setEnableScopeSync(boolean enableScopeSync)
Enables or not the Java to NDK Scope sync void
setEnableAutoTraceIdGeneration(boolean enableAutoTraceIdGeneration)
void
setReportHistoricalAnrs(boolean reportHistoricalAnrs)
void
setAttachAnrThreadDump(boolean attachAnrThreadDump)
void
setEnablePerformanceV2(boolean enablePerformanceV2)
Enables or disables the Performance V2 SDK features. SentryFrameMetricsCollector
getFrameMetricsCollector()
void
setFrameMetricsCollector(@Nullable() SentryFrameMetricsCollector frameMetricsCollector)
boolean
isAnrEnabled()
Checks if ANR (Application Not Responding) is enabled or disabled Default is enabled boolean
isAnrReportInDebug()
Checks if ANR (Application Not Responding) is enabled or disabled on Debug mode Default isdisabled boolean
isEnableActivityLifecycleBreadcrumbs()
boolean
isEnableAppLifecycleBreadcrumbs()
boolean
isEnableSystemEventBreadcrumbs()
boolean
isEnableAppComponentBreadcrumbs()
boolean
isEnableNetworkEventBreadcrumbs()
void
enableAllAutoBreadcrumbs(boolean enable)
Enable or disable all the automatic breadcrumbs boolean
isEnableAutoActivityLifecycleTracing()
boolean
isEnableActivityLifecycleTracingAutoFinish()
boolean
isAttachScreenshot()
boolean
isAttachViewHierarchy()
boolean
isCollectAdditionalContext()
boolean
isEnableFramesTracking()
void
setNativeHandlerStrategy(@NotNull() NdkHandlerStrategy ndkHandlerStrategy)
boolean
isEnableRootCheck()
boolean
isEnableNdk()
Check if NDK is ON or OFF Default is ON boolean
isEnableScopeSync()
Returns if the Java to NDK Scope sync is enabled boolean
isReportHistoricalAnrs()
boolean
isAttachAnrThreadDump()
boolean
isEnablePerformanceV2()
boolean
isEnableAutoTraceIdGeneration()
-
Methods inherited from class io.sentry.SentryOptions
addBundleId, addContextTag, addEventProcessor, addIgnoredCheckIn, addIgnoredError, addIgnoredExceptionForType, addIgnoredSpanOrigin, addIgnoredTransaction, addInAppExclude, addInAppInclude, addIntegration, addOptionsObserver, addPerformanceCollector, addScopeObserver, empty, getBackpressureMonitor, getBeforeBreadcrumb, getBeforeEnvelopeCallback, getBeforeSend, getBeforeSendReplay, getBeforeSendTransaction, getBundleIds, getCacheDirPath, getClientReportRecorder, getConnectionStatusProvider, getConnectionTimeoutMillis, getContextTags, getCron, getDateProvider, getDebugMetaLoader, getDefaultScopeType, getDiagnosticLevel, getDist, getDistinctId, getDsn, getEnvelopeDiskCache, getEnvelopeReader, getEnvironment, getEventProcessors, getExecutorService, getExperimental, getFlushTimeoutMillis, getFullyDisplayedReporter, getGestureTargetLocators, getIdleTimeout, getIgnoredCheckIns, getIgnoredErrors, getIgnoredExceptionsForType, getIgnoredSpanOrigins, getIgnoredTransactions, getInAppExcludes, getInAppIncludes, getInitPriority, getInstrumenter, getIntegrations, getInternalTracesSampler, getLogger, getMaxAttachmentSize, getMaxBreadcrumbs, getMaxCacheItems, getMaxDepth, getMaxQueueSize, getMaxRequestBodySize, getMaxSpans, getMaxTraceFileSize, getModulesLoader, getOpenTelemetryMode, getOptionsObservers, getOutboxPath, getPerformanceCollectors, getProfilesSampleRate, getProfilesSampler, getProfilingTracesDirPath, getProfilingTracesHz, getProguardUuid, getProxy, getReadTimeoutMillis, getRelease, getReplayController, getSampleRate, getScopeObservers, getSdkVersion, getSentryClientName, getSerializer, getServerName, getSessionFlushTimeoutMillis, getSessionReplay, getSessionTrackingIntervalMillis, getShutdownTimeoutMillis, getSpanFactory, getSpotlightConnectionUrl, getSslSocketFactory, getTags, getThreadChecker, getTracePropagationTargets, getTracesSampleRate, getTracesSampler, getTransactionPerformanceCollector, getTransactionProfiler, getTransportFactory, getTransportGate, getViewHierarchyExporters, isAttachServerName, isAttachStacktrace, isAttachThreads, isCaptureOpenTelemetryEvents, isDebug, isEnableAppStartProfiling, isEnableAutoSessionTracking, isEnableBackpressureHandling, isEnableDeduplication, isEnableExternalConfiguration, isEnablePrettySerializationOutput, isEnableScopePersistence, isEnableScreenTracking, isEnableShutdownHook, isEnableSpotlight, isEnableTimeToFullDisplayTracing, isEnableUncaughtExceptionHandler, isEnableUserInteractionBreadcrumbs, isEnableUserInteractionTracing, isEnabled, isForceInit, isGlobalHubMode, isPrintUncaughtStackTrace, isProfilingEnabled, isSendClientReports, isSendDefaultPii, isSendModules, isTraceOptionsRequests, isTraceSampling, isTracingEnabled, merge, setAttachServerName, setAttachStacktrace, setAttachThreads, setBackpressureMonitor, setBeforeBreadcrumb, setBeforeEnvelopeCallback, setBeforeSend, setBeforeSendReplay, setBeforeSendTransaction, setCacheDirPath, setCaptureOpenTelemetryEvents, setConnectionStatusProvider, setConnectionTimeoutMillis, setCron, setDateProvider, setDebug, setDebugMetaLoader, setDefaultScopeType, setDiagnosticLevel, setDist, setDistinctId, setDsn, setEnableAppStartProfiling, setEnableAutoSessionTracking, setEnableBackpressureHandling, setEnableDeduplication, setEnableExternalConfiguration, setEnablePrettySerializationOutput, setEnableScopePersistence, setEnableScreenTracking, setEnableShutdownHook, setEnableSpotlight, setEnableTimeToFullDisplayTracing, setEnableUncaughtExceptionHandler, setEnableUserInteractionBreadcrumbs, setEnableUserInteractionTracing, setEnabled, setEnvelopeDiskCache, setEnvelopeReader, setEnvironment, setExecutorService, setFlushTimeoutMillis, setForceInit, setFullyDisplayedReporter, setGestureTargetLocators, setGlobalHubMode, setIdleTimeout, setIgnoredCheckIns, setIgnoredErrors, setIgnoredSpanOrigins, setIgnoredTransactions, setInitPriority, setInstrumenter, setLogger, setMaxAttachmentSize, setMaxBreadcrumbs, setMaxCacheItems, setMaxDepth, setMaxQueueSize, setMaxRequestBodySize, setMaxSpans, setMaxTraceFileSize, setModulesLoader, setOpenTelemetryMode, setPrintUncaughtStackTrace, setProfilesSampleRate, setProfilesSampler, setProfilingTracesHz, setProguardUuid, setProxy, setReadTimeoutMillis, setRelease, setReplayController, setSampleRate, setSdkVersion, setSendClientReports, setSendDefaultPii, setSendModules, setSentryClientName, setSerializer, setServerName, setSessionFlushTimeoutMillis, setSessionReplay, setSessionTrackingIntervalMillis, setShutdownTimeoutMillis, setSpanFactory, setSpotlightConnectionUrl, setSslSocketFactory, setTag, setThreadChecker, setTraceOptionsRequests, setTracePropagationTargets, setTraceSampling, setTracesSampleRate, setTracesSampler, setTransactionPerformanceCollector, setTransactionProfiler, setTransportFactory, setTransportGate, setViewHierarchyExporters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setAnrEnabled
void setAnrEnabled(boolean anrEnabled)
Sets ANR (Application Not Responding) to enabled or disabled Default is enabled
- Parameters:
anrEnabled
- true for enabled and false for disabled
-
getAnrTimeoutIntervalMillis
long getAnrTimeoutIntervalMillis()
Returns the ANR timeout internal in Millis Default is 5000 = 5s
-
setAnrTimeoutIntervalMillis
void setAnrTimeoutIntervalMillis(long anrTimeoutIntervalMillis)
Sets the ANR timeout internal in Millis Default is 5000 = 5s
- Parameters:
anrTimeoutIntervalMillis
- the timeout internal in Millis
-
setAnrReportInDebug
void setAnrReportInDebug(boolean anrReportInDebug)
Sets ANR (Application Not Responding) to enabled or disabled on Debug mode Default is disabled
- Parameters:
anrReportInDebug
- true for enabled and false for disabled
-
setEnableActivityLifecycleBreadcrumbs
void setEnableActivityLifecycleBreadcrumbs(boolean enableActivityLifecycleBreadcrumbs)
-
setEnableAppLifecycleBreadcrumbs
void setEnableAppLifecycleBreadcrumbs(boolean enableAppLifecycleBreadcrumbs)
-
setEnableSystemEventBreadcrumbs
void setEnableSystemEventBreadcrumbs(boolean enableSystemEventBreadcrumbs)
-
setEnableAppComponentBreadcrumbs
void setEnableAppComponentBreadcrumbs(boolean enableAppComponentBreadcrumbs)
-
setEnableNetworkEventBreadcrumbs
void setEnableNetworkEventBreadcrumbs(boolean enableNetworkEventBreadcrumbs)
-
setEnableAutoActivityLifecycleTracing
void setEnableAutoActivityLifecycleTracing(boolean enableAutoActivityLifecycleTracing)
-
setEnableActivityLifecycleTracingAutoFinish
void setEnableActivityLifecycleTracingAutoFinish(boolean enableActivityLifecycleTracingAutoFinish)
-
getDebugImagesLoader
@NotNull() IDebugImagesLoader getDebugImagesLoader()
Returns the Debug image loader
-
setDebugImagesLoader
void setDebugImagesLoader(@NotNull() IDebugImagesLoader debugImagesLoader)
Sets the image loader
- Parameters:
debugImagesLoader
- the image loader
-
setAttachScreenshot
void setAttachScreenshot(boolean attachScreenshot)
-
setAttachViewHierarchy
void setAttachViewHierarchy(boolean attachViewHierarchy)
-
setCollectAdditionalContext
void setCollectAdditionalContext(boolean collectAdditionalContext)
-
getStartupCrashDurationThresholdMillis
@ApiStatus.Internal() long getStartupCrashDurationThresholdMillis()
Returns the Startup Crash duration threshold in Millis
-
setEnableFramesTracking
void setEnableFramesTracking(boolean enableFramesTracking)
Enable or disable Frames Tracking, which is used to report slow and frozen frames.
- Parameters:
enableFramesTracking
- true if frames tracking should be enabled, false otherwise.
-
getNativeSdkName
@ApiStatus.Internal()@Nullable() String getNativeSdkName()
Returns the sdk name for the sentry native ndk module.
-
setNativeSdkName
@ApiStatus.Internal() void setNativeSdkName(@Nullable() String nativeSdkName)
Sets the sdk name for the sentry-native ndk module. The value is used for the event->sdkattribute and the sentry_client auth header.
- Parameters:
nativeSdkName
- the native sdk name
-
setEnableRootCheck
void setEnableRootCheck(boolean enableRootCheck)
-
getBeforeScreenshotCaptureCallback
@Nullable() SentryAndroidOptions.BeforeCaptureCallback getBeforeScreenshotCaptureCallback()
-
setBeforeScreenshotCaptureCallback
void setBeforeScreenshotCaptureCallback(@NotNull() SentryAndroidOptions.BeforeCaptureCallback beforeScreenshotCaptureCallback)
Sets a callback which is executed before capturing screenshots. Only relevant ifattachScreenshot is set to true.
- Parameters:
beforeScreenshotCaptureCallback
- the callback to execute
-
getBeforeViewHierarchyCaptureCallback
@Nullable() SentryAndroidOptions.BeforeCaptureCallback getBeforeViewHierarchyCaptureCallback()
-
setBeforeViewHierarchyCaptureCallback
void setBeforeViewHierarchyCaptureCallback(@NotNull() SentryAndroidOptions.BeforeCaptureCallback beforeViewHierarchyCaptureCallback)
Sets a callback which is executed before capturing view hierarchies. Only relevant ifattachViewHierarchy is set to true.
- Parameters:
beforeViewHierarchyCaptureCallback
- the callback to execute
-
setEnableNdk
void setEnableNdk(boolean enableNdk)
Sets NDK to ON or OFF
- Parameters:
enableNdk
- true if ON or false otherwise
-
setEnableScopeSync
void setEnableScopeSync(boolean enableScopeSync)
Enables or not the Java to NDK Scope sync
- Parameters:
enableScopeSync
- true if enabled or false otherwise
-
setEnableAutoTraceIdGeneration
void setEnableAutoTraceIdGeneration(boolean enableAutoTraceIdGeneration)
-
setReportHistoricalAnrs
void setReportHistoricalAnrs(boolean reportHistoricalAnrs)
-
setAttachAnrThreadDump
void setAttachAnrThreadDump(boolean attachAnrThreadDump)
-
setEnablePerformanceV2
void setEnablePerformanceV2(boolean enablePerformanceV2)
Enables or disables the Performance V2 SDK features.
With this change - Cold app start spans will provide more accurate timings - Cold app startspans will be enriched with detailed ContentProvider, Application and Activity startup times
- Parameters:
enablePerformanceV2
- true if enabled or false otherwise
-
getFrameMetricsCollector
@ApiStatus.Internal()@Nullable() SentryFrameMetricsCollector getFrameMetricsCollector()
-
setFrameMetricsCollector
@ApiStatus.Internal() void setFrameMetricsCollector(@Nullable() SentryFrameMetricsCollector frameMetricsCollector)
-
isAnrEnabled
boolean isAnrEnabled()
Checks if ANR (Application Not Responding) is enabled or disabled Default is enabled
-
isAnrReportInDebug
boolean isAnrReportInDebug()
Checks if ANR (Application Not Responding) is enabled or disabled on Debug mode Default isdisabled
-
isEnableActivityLifecycleBreadcrumbs
boolean isEnableActivityLifecycleBreadcrumbs()
-
isEnableAppLifecycleBreadcrumbs
boolean isEnableAppLifecycleBreadcrumbs()
-
isEnableSystemEventBreadcrumbs
boolean isEnableSystemEventBreadcrumbs()
-
isEnableAppComponentBreadcrumbs
boolean isEnableAppComponentBreadcrumbs()
-
isEnableNetworkEventBreadcrumbs
boolean isEnableNetworkEventBreadcrumbs()
-
enableAllAutoBreadcrumbs
void enableAllAutoBreadcrumbs(boolean enable)
Enable or disable all the automatic breadcrumbs
- Parameters:
enable
- true if enable or false otherwise
-
isEnableAutoActivityLifecycleTracing
boolean isEnableAutoActivityLifecycleTracing()
-
isEnableActivityLifecycleTracingAutoFinish
boolean isEnableActivityLifecycleTracingAutoFinish()
-
isAttachScreenshot
boolean isAttachScreenshot()
-
isAttachViewHierarchy
boolean isAttachViewHierarchy()
-
isCollectAdditionalContext
boolean isCollectAdditionalContext()
-
isEnableFramesTracking
boolean isEnableFramesTracking()
-
setNativeHandlerStrategy
@ApiStatus.Internal() void setNativeHandlerStrategy(@NotNull() NdkHandlerStrategy ndkHandlerStrategy)
-
isEnableRootCheck
boolean isEnableRootCheck()
-
isEnableNdk
boolean isEnableNdk()
Check if NDK is ON or OFF Default is ON
-
isEnableScopeSync
boolean isEnableScopeSync()
Returns if the Java to NDK Scope sync is enabled
-
isReportHistoricalAnrs
boolean isReportHistoricalAnrs()
-
isAttachAnrThreadDump
boolean isAttachAnrThreadDump()
-
isEnablePerformanceV2
boolean isEnablePerformanceV2()
-
isEnableAutoTraceIdGeneration
boolean isEnableAutoTraceIdGeneration()
-
-
-
-