-
public final class PostHogSessionReplayConfigAndroid session replay capture options.
Use this as
PostHogAndroidConfig.sessionReplayConfigwhen enabling session replay throughPostHogConfig.sessionReplay.
-
-
Field Summary
Fields Modifier and Type Field Description private BooleancaptureTouchesprivate BooleanverifyScreenshotMaskAlignmentprivate volatile IntegerscreenshotCompressionQualityprivate volatile FloatscreenshotScaleprivate volatile PostHogScreenshotColorModescreenshotColorModeprivate BooleanmaskAllTextInputsprivate BooleanmaskAllImagesprivate BooleancaptureLogcatprivate PostHogDrawableConverterdrawableConverterprivate Booleanscreenshotprivate LongdebouncerDelayMsprivate LongthrottleDelayMsprivate DoublesampleRate
-
Constructor Summary
Constructors Constructor Description PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat, PostHogDrawableConverter drawableConverter, Boolean screenshot, Long debouncerDelayMs, Long throttleDelayMs, Double sampleRate)PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat, PostHogDrawableConverter drawableConverter, Boolean screenshot, Long debouncerDelayMs, Long throttleDelayMs)PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat, PostHogDrawableConverter drawableConverter, Boolean screenshot, Long debouncerDelayMs)PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat, PostHogDrawableConverter drawableConverter, Boolean screenshot)PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat, PostHogDrawableConverter drawableConverter)PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat)PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages)PostHogSessionReplayConfig(Boolean maskAllTextInputs)PostHogSessionReplayConfig()
-
Method Summary
Modifier and Type Method Description final BooleangetCaptureTouches()Capture touch coordinates in session replay. final UnitsetCaptureTouches(Boolean captureTouches)Capture touch coordinates in session replay. final BooleangetVerifyScreenshotMaskAlignment()Verifies mask alignment for session replay screenshots. final UnitsetVerifyScreenshotMaskAlignment(Boolean verifyScreenshotMaskAlignment)Verifies mask alignment for session replay screenshots. final IntegergetScreenshotCompressionQuality()WebP compression quality for screenshots, clamped to 0..100. final UnitsetScreenshotCompressionQuality(Integer screenshotCompressionQuality)final FloatgetScreenshotScale()Multiplier for the physical width and height of screenshot captures, clamped to 0.1..1.0. final UnitsetScreenshotScale(Float screenshotScale)final PostHogScreenshotColorModegetScreenshotColorMode()Pixel format used for screenshot captures. final UnitsetScreenshotColorMode(PostHogScreenshotColorMode screenshotColorMode)Pixel format used for screenshot captures. final BooleangetMaskAllTextInputs()Enable masking of all text and text input fields Defaults to true final UnitsetMaskAllTextInputs(Boolean maskAllTextInputs)Enable masking of all text and text input fields Defaults to true final BooleangetMaskAllImages()Enable masking of all images to a placeholder Defaults to true final UnitsetMaskAllImages(Boolean maskAllImages)Enable masking of all images to a placeholder Defaults to true final BooleangetCaptureLogcat()Enable capturing of logcat as console events Defaults to true final UnitsetCaptureLogcat(Boolean captureLogcat)Enable capturing of logcat as console events Defaults to true final PostHogDrawableConvertergetDrawableConverter()Converts custom Drawable to Bitmap By default PostHog tries to convert the Drawable to Bitmap, the supported types are BitmapDrawable, ColorDrawable, GradientDrawable, InsetDrawable, LayerDrawable, RippleDrawable final UnitsetDrawableConverter(PostHogDrawableConverter drawableConverter)Converts custom Drawable to Bitmap By default PostHog tries to convert the Drawable to Bitmap, the supported types are BitmapDrawable, ColorDrawable, GradientDrawable, InsetDrawable, LayerDrawable, RippleDrawable final BooleangetScreenshot()By default Session replay will capture all the views on the screen as a wireframe, By enabling this option, PostHog will capture the screenshot of the screen. final UnitsetScreenshot(Boolean screenshot)By default Session replay will capture all the views on the screen as a wireframe, By enabling this option, PostHog will capture the screenshot of the screen. final LonggetDebouncerDelayMs()Debouncer delay used to reduce the number of snapshots captured and reduce performance impact. final UnitsetDebouncerDelayMs(@Deprecated(message = Use throttleDelayMs instead) Long debouncerDelayMs)Debouncer delay used to reduce the number of snapshots captured and reduce performance impact. final LonggetThrottleDelayMs()Throttling delay used to reduce the number of snapshots captured and reduce performance impact. final UnitsetThrottleDelayMs(Long throttleDelayMs)Throttling delay used to reduce the number of snapshots captured and reduce performance impact. final DoublegetSampleRate()Local sample rate for session recording, a value between 0.0 and 1.0. final UnitsetSampleRate(Double sampleRate)Local sample rate for session recording, a value between 0.0 and 1.0. -
-
Constructor Detail
-
PostHogSessionReplayConfig
PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat, PostHogDrawableConverter drawableConverter, Boolean screenshot, Long debouncerDelayMs, Long throttleDelayMs, Double sampleRate)
-
PostHogSessionReplayConfig
PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat, PostHogDrawableConverter drawableConverter, Boolean screenshot, Long debouncerDelayMs, Long throttleDelayMs)
-
PostHogSessionReplayConfig
PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat, PostHogDrawableConverter drawableConverter, Boolean screenshot, Long debouncerDelayMs)
-
PostHogSessionReplayConfig
PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat, PostHogDrawableConverter drawableConverter, Boolean screenshot)
-
PostHogSessionReplayConfig
PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat, PostHogDrawableConverter drawableConverter)
-
PostHogSessionReplayConfig
PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages, Boolean captureLogcat)
-
PostHogSessionReplayConfig
PostHogSessionReplayConfig(Boolean maskAllTextInputs, Boolean maskAllImages)
-
PostHogSessionReplayConfig
PostHogSessionReplayConfig(Boolean maskAllTextInputs)
-
PostHogSessionReplayConfig
PostHogSessionReplayConfig()
-
-
Method Detail
-
getCaptureTouches
final Boolean getCaptureTouches()
Capture touch coordinates in session replay. Defaults to true. Set before SDK setup. Runtime changes are not supported. Screenshot and view capture are unaffected. Disable this when touch positions could reveal sensitive input, even if the views are masked.
-
setCaptureTouches
final Unit setCaptureTouches(Boolean captureTouches)
Capture touch coordinates in session replay. Defaults to true. Set before SDK setup. Runtime changes are not supported. Screenshot and view capture are unaffected. Disable this when touch positions could reveal sensitive input, even if the views are masked.
-
getVerifyScreenshotMaskAlignment
final Boolean getVerifyScreenshotMaskAlignment()
Verifies mask alignment for session replay screenshots. This can preserve screenshots during pixel-only redraws, including continuously animated content, but performs additional view hierarchy walks while a screenshot is captured. Defaults to false. Windows with a Compose root always use the verified path regardless of this flag, so setting it to false does not disable verification for them.
-
setVerifyScreenshotMaskAlignment
final Unit setVerifyScreenshotMaskAlignment(Boolean verifyScreenshotMaskAlignment)
Verifies mask alignment for session replay screenshots. This can preserve screenshots during pixel-only redraws, including continuously animated content, but performs additional view hierarchy walks while a screenshot is captured. Defaults to false. Windows with a Compose root always use the verified path regardless of this flag, so setting it to false does not disable verification for them.
-
getScreenshotCompressionQuality
final Integer getScreenshotCompressionQuality()
WebP compression quality for screenshots, clamped to 0..100. Defaults to 30. Higher values generally retain more detail and produce larger payloads. Compression is lossy, except on Android 10 (API 29), where the platform's legacy WebP encoder uses lossless compression at quality 100. Does not change screenshot resolution or enable screenshot capture.
-
setScreenshotCompressionQuality
final Unit setScreenshotCompressionQuality(Integer screenshotCompressionQuality)
-
getScreenshotScale
final Float getScreenshotScale()
Multiplier for the physical width and height of screenshot captures, clamped to 0.1..1.0. For example, 0.5 captures half the width and height, or one quarter of the pixels. Dimensions are rounded up to at least one pixel; the logical replay viewport is unchanged. Defaults to 1.0 (full resolution). NaN and infinite values reset the scale to 1.0. Does not change compression quality, color mode, or enable screenshot capture.
-
setScreenshotScale
final Unit setScreenshotScale(Float screenshotScale)
-
getScreenshotColorMode
final PostHogScreenshotColorMode getScreenshotColorMode()
Pixel format used for screenshot captures. Defaults to PostHogScreenshotColorMode.ARGB_8888 to preserve alpha and color precision before lossy WebP compression. PostHogScreenshotColorMode.RGB_565 uses less bitmap memory but reduces color precision and removes alpha, making transparent window regions appear black. Devices that reject RGB_565 fall back to ARGB_8888. Does not enable screenshot capture.
-
setScreenshotColorMode
final Unit setScreenshotColorMode(PostHogScreenshotColorMode screenshotColorMode)
Pixel format used for screenshot captures. Defaults to PostHogScreenshotColorMode.ARGB_8888 to preserve alpha and color precision before lossy WebP compression. PostHogScreenshotColorMode.RGB_565 uses less bitmap memory but reduces color precision and removes alpha, making transparent window regions appear black. Devices that reject RGB_565 fall back to ARGB_8888. Does not enable screenshot capture.
-
getMaskAllTextInputs
final Boolean getMaskAllTextInputs()
Enable masking of all text and text input fields Defaults to true
-
setMaskAllTextInputs
final Unit setMaskAllTextInputs(Boolean maskAllTextInputs)
Enable masking of all text and text input fields Defaults to true
-
getMaskAllImages
final Boolean getMaskAllImages()
Enable masking of all images to a placeholder Defaults to true
-
setMaskAllImages
final Unit setMaskAllImages(Boolean maskAllImages)
Enable masking of all images to a placeholder Defaults to true
-
getCaptureLogcat
final Boolean getCaptureLogcat()
Enable capturing of logcat as console events Defaults to true
-
setCaptureLogcat
final Unit setCaptureLogcat(Boolean captureLogcat)
Enable capturing of logcat as console events Defaults to true
-
getDrawableConverter
final PostHogDrawableConverter getDrawableConverter()
Converts custom Drawable to Bitmap By default PostHog tries to convert the Drawable to Bitmap, the supported types are BitmapDrawable, ColorDrawable, GradientDrawable, InsetDrawable, LayerDrawable, RippleDrawable
-
setDrawableConverter
final Unit setDrawableConverter(PostHogDrawableConverter drawableConverter)
Converts custom Drawable to Bitmap By default PostHog tries to convert the Drawable to Bitmap, the supported types are BitmapDrawable, ColorDrawable, GradientDrawable, InsetDrawable, LayerDrawable, RippleDrawable
-
getScreenshot
final Boolean getScreenshot()
By default Session replay will capture all the views on the screen as a wireframe, By enabling this option, PostHog will capture the screenshot of the screen. The screenshot may contain sensitive information, use with caution.
-
setScreenshot
final Unit setScreenshot(Boolean screenshot)
By default Session replay will capture all the views on the screen as a wireframe, By enabling this option, PostHog will capture the screenshot of the screen. The screenshot may contain sensitive information, use with caution.
-
getDebouncerDelayMs
final Long getDebouncerDelayMs()
Debouncer delay used to reduce the number of snapshots captured and reduce performance impact. This is used for capturing the view as a wireframe or screenshot. The lower the number, the more snapshots are captured and the higher the performance impact. Defaults to 1000ms = 1s. Ps: it was 500ms by default until version 3.8.2.
-
setDebouncerDelayMs
final Unit setDebouncerDelayMs(@Deprecated(message = Use throttleDelayMs instead) Long debouncerDelayMs)
Debouncer delay used to reduce the number of snapshots captured and reduce performance impact. This is used for capturing the view as a wireframe or screenshot. The lower the number, the more snapshots are captured and the higher the performance impact. Defaults to 1000ms = 1s. Ps: it was 500ms by default until version 3.8.2.
-
getThrottleDelayMs
final Long getThrottleDelayMs()
Throttling delay used to reduce the number of snapshots captured and reduce performance impact. This is used for capturing the view as a wireframe or screenshot. The lower the number, the more snapshots are captured and the higher the performance impact. Defaults to 1000ms = 1s.
-
setThrottleDelayMs
final Unit setThrottleDelayMs(Long throttleDelayMs)
Throttling delay used to reduce the number of snapshots captured and reduce performance impact. This is used for capturing the view as a wireframe or screenshot. The lower the number, the more snapshots are captured and the higher the performance impact. Defaults to 1000ms = 1s.
-
getSampleRate
final Double getSampleRate()
Local sample rate for session recording, a value between 0.0 and 1.0. When set, this takes precedence over the remote config sample rate.
nullmeans no local override, so the SDK uses the remote config value. Defaults tonull.
-
setSampleRate
final Unit setSampleRate(Double sampleRate)
Local sample rate for session recording, a value between 0.0 and 1.0. When set, this takes precedence over the remote config sample rate.
nullmeans no local override, so the SDK uses the remote config value. Defaults tonull.
-
-
-
-