File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy
sentry/src/main/java/io/sentry Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Unreleased
4+
5+ ### Features
6+
7+ - Add ` redactClasses ` to Session Replay options ([ #3546 ] ( https://github.com/getsentry/sentry-java/pull/3546 ) )
8+
39## 7.11.0-alpha.2
410
511- Session Replay for Android ([ #3339 ] ( https://github.com/getsentry/sentry-java/pull/3339 ) )
Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ sealed class ViewHierarchyNode(
282282 (parent?.elevation ? : 0f ) + view.elevation,
283283 distance = distance,
284284 parent = parent,
285- shouldRedact = false ,
285+ shouldRedact = options.experimental.sessionReplay.redactClasses.contains(view.javaClass.canonicalName) ,
286286 isImportantForContentCapture = false , /* will be set by children */
287287 isVisible = isVisible,
288288 visibleRect = visibleRect
Original file line number Diff line number Diff line change 11package io .sentry ;
22
33import io .sentry .util .SampleRateUtils ;
4+ import java .util .HashSet ;
5+ import java .util .Set ;
46import org .jetbrains .annotations .ApiStatus ;
57import org .jetbrains .annotations .NotNull ;
68import org .jetbrains .annotations .Nullable ;
@@ -64,6 +66,14 @@ public enum SentryReplayQuality {
6466 */
6567 private boolean redactAllImages = true ;
6668
69+ /**
70+ * Redact all views with the specified class names. The class name is the fully qualified class
71+ * name of the view, e.g. android.widget.TextView.
72+ *
73+ * <p>Default is empty.
74+ */
75+ private Set <String > redactClasses = new HashSet <>();
76+
6777 /**
6878 * Defines the quality of the session replay. The higher the quality, the more accurate the replay
6979 * will be, but also more data to transfer and more CPU load, defaults to MEDIUM.
@@ -147,6 +157,14 @@ public void setRedactAllImages(final boolean redactAllImages) {
147157 this .redactAllImages = redactAllImages ;
148158 }
149159
160+ public Set <String > getRedactClasses () {
161+ return this .redactClasses ;
162+ }
163+
164+ public void setRedactClasses (final Set <String > redactClasses ) {
165+ this .redactClasses = redactClasses ;
166+ }
167+
150168 @ ApiStatus .Internal
151169 public @ NotNull SentryReplayQuality getQuality () {
152170 return quality ;
You can’t perform that action at this time.
0 commit comments