From 75dd71d64100eef1b520f49c37c429fb0a9e3c08 Mon Sep 17 00:00:00 2001 From: Peter Szij Date: Thu, 12 Feb 2026 22:15:10 +0100 Subject: [PATCH 1/4] add androidx.camera.view.PreviewView to default masked view classes in SentryReplayOptions --- .../sentry/android/replay/capture/SessionCaptureStrategyTest.kt | 1 + sentry/api/sentry.api | 2 +- sentry/src/main/java/io/sentry/SentryReplayOptions.java | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sentry-android-replay/src/test/java/io/sentry/android/replay/capture/SessionCaptureStrategyTest.kt b/sentry-android-replay/src/test/java/io/sentry/android/replay/capture/SessionCaptureStrategyTest.kt index af30a5b73f7..9982c6623b2 100644 --- a/sentry-android-replay/src/test/java/io/sentry/android/replay/capture/SessionCaptureStrategyTest.kt +++ b/sentry-android-replay/src/test/java/io/sentry/android/replay/capture/SessionCaptureStrategyTest.kt @@ -437,6 +437,7 @@ class SessionCaptureStrategyTest { "android.widget.TextView", "android.webkit.WebView", "android.widget.VideoView", + "androidx.camera.view.PreviewView", "androidx.media3.ui.PlayerView", "com.google.android.exoplayer2.ui.PlayerView", "com.google.android.exoplayer2.ui.StyledPlayerView", diff --git a/sentry/api/sentry.api b/sentry/api/sentry.api index 0a14eaf5ee6..7b1cbe3c749 100644 --- a/sentry/api/sentry.api +++ b/sentry/api/sentry.api @@ -3904,6 +3904,7 @@ public final class io/sentry/SentryReplayEvent$ReplayType$Deserializer : io/sent public final class io/sentry/SentryReplayOptions { public static final field ANDROIDX_MEDIA_VIEW_CLASS_NAME Ljava/lang/String; + public static final field CAMERAX_PREVIEW_VIEW_CLASS_NAME Ljava/lang/String; public static final field EXOPLAYER_CLASS_NAME Ljava/lang/String; public static final field EXOPLAYER_STYLED_CLASS_NAME Ljava/lang/String; public static final field IMAGE_VIEW_CLASS_NAME Ljava/lang/String; @@ -7937,4 +7938,3 @@ public final class io/sentry/vendor/gson/stream/MalformedJsonException : java/io public fun (Ljava/lang/String;Ljava/lang/Throwable;)V public fun (Ljava/lang/Throwable;)V } - diff --git a/sentry/src/main/java/io/sentry/SentryReplayOptions.java b/sentry/src/main/java/io/sentry/SentryReplayOptions.java index 23fbe2cb078..cc8733fd824 100644 --- a/sentry/src/main/java/io/sentry/SentryReplayOptions.java +++ b/sentry/src/main/java/io/sentry/SentryReplayOptions.java @@ -25,6 +25,7 @@ public final class SentryReplayOptions { public static final String IMAGE_VIEW_CLASS_NAME = "android.widget.ImageView"; public static final String WEB_VIEW_CLASS_NAME = "android.webkit.WebView"; public static final String VIDEO_VIEW_CLASS_NAME = "android.widget.VideoView"; + public static final String CAMERAX_PREVIEW_VIEW_CLASS_NAME = "androidx.camera.view.PreviewView"; public static final String ANDROIDX_MEDIA_VIEW_CLASS_NAME = "androidx.media3.ui.PlayerView"; public static final String EXOPLAYER_CLASS_NAME = "com.google.android.exoplayer2.ui.PlayerView"; public static final String EXOPLAYER_STYLED_CLASS_NAME = @@ -219,6 +220,7 @@ public SentryReplayOptions(final boolean empty, final @Nullable SdkVersion sdkVe maskViewClasses.add(IMAGE_VIEW_CLASS_NAME); maskViewClasses.add(WEB_VIEW_CLASS_NAME); maskViewClasses.add(VIDEO_VIEW_CLASS_NAME); + maskViewClasses.add(CAMERAX_PREVIEW_VIEW_CLASS_NAME); maskViewClasses.add(ANDROIDX_MEDIA_VIEW_CLASS_NAME); maskViewClasses.add(EXOPLAYER_CLASS_NAME); maskViewClasses.add(EXOPLAYER_STYLED_CLASS_NAME); From 80c6f5ff7059c65eadb0b80da3648f35dc411922 Mon Sep 17 00:00:00 2001 From: Peter Szij Date: Thu, 12 Feb 2026 22:36:33 +0100 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94420404789..88dd3aea59a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - When merging tombstones with Native SDK, use the tombstone message if the Native SDK didn't explicitly provide one. ([#5095](https://github.com/getsentry/sentry-java/pull/5095)) - Fix thread leak caused by eager creation of `SentryExecutorService` in `SentryOptions` ([#5093](https://github.com/getsentry/sentry-java/pull/5093)) - There were cases where we created options that ended up unused but we failed to clean those up. +- Session Replay: Add `androidx.camera.view.PreviewView` to default `maskedViewClasses` to mask camera previews by default. ([#5097](https://github.com/getsentry/sentry-java/pull/5097)) ### Dependencies From 7f0346ef0844ae569f85b240ece549ba45c8664c Mon Sep 17 00:00:00 2001 From: Peter Szij Date: Thu, 12 Feb 2026 23:13:25 +0100 Subject: [PATCH 3/4] add PreviewView to proguard rules --- sentry-android-replay/proguard-rules.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sentry-android-replay/proguard-rules.pro b/sentry-android-replay/proguard-rules.pro index 378c0964f8c..42e3cb30a42 100644 --- a/sentry-android-replay/proguard-rules.pro +++ b/sentry-android-replay/proguard-rules.pro @@ -26,3 +26,6 @@ -keepnames class com.google.android.exoplayer2.ui.PlayerView -dontwarn com.google.android.exoplayer2.ui.StyledPlayerView -keepnames class com.google.android.exoplayer2.ui.StyledPlayerView +# Rules to detect a PreviewView view to later mask it +-dontwarn androidx.camera.view.PreviewView +-keepnames class androidx.camera.view.PreviewView From 3b1668f78935f5331084b841e8841e68f2c42de3 Mon Sep 17 00:00:00 2001 From: Peter Szij Date: Fri, 13 Feb 2026 10:36:34 +0100 Subject: [PATCH 4/4] ./gradlew apiDump to restore empty line --- sentry/api/sentry.api | 1 + 1 file changed, 1 insertion(+) diff --git a/sentry/api/sentry.api b/sentry/api/sentry.api index 7b1cbe3c749..a043f8fe85c 100644 --- a/sentry/api/sentry.api +++ b/sentry/api/sentry.api @@ -7938,3 +7938,4 @@ public final class io/sentry/vendor/gson/stream/MalformedJsonException : java/io public fun (Ljava/lang/String;Ljava/lang/Throwable;)V public fun (Ljava/lang/Throwable;)V } +