Skip to content

Commit

Permalink
Merge bc18c8b into a54f92f
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich authored Jul 3, 2024
2 parents a54f92f + bc18c8b commit 7bd8d98
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Features

- Add `redactClasses` to Session Replay options ([#3546](https://github.com/getsentry/sentry-java/pull/3546))

## 7.11.0-alpha.2

- Session Replay for Android ([#3339](https://github.com/getsentry/sentry-java/pull/3339))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ sealed class ViewHierarchyNode(
(parent?.elevation ?: 0f) + view.elevation,
distance = distance,
parent = parent,
shouldRedact = false,
shouldRedact = options.experimental.sessionReplay.redactClasses.contains(view.javaClass.canonicalName),
isImportantForContentCapture = false, /* will be set by children */
isVisible = isVisible,
visibleRect = visibleRect
Expand Down
18 changes: 18 additions & 0 deletions sentry/src/main/java/io/sentry/SentryReplayOptions.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.sentry;

import io.sentry.util.SampleRateUtils;
import java.util.HashSet;
import java.util.Set;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -64,6 +66,14 @@ public enum SentryReplayQuality {
*/
private boolean redactAllImages = true;

/**
* Redact all views with the specified class names. The class name is the fully qualified class
* name of the view, e.g. android.widget.TextView.
*
* <p>Default is empty.
*/
private Set<String> redactClasses = new HashSet<>();

/**
* Defines the quality of the session replay. The higher the quality, the more accurate the replay
* will be, but also more data to transfer and more CPU load, defaults to MEDIUM.
Expand Down Expand Up @@ -147,6 +157,14 @@ public void setRedactAllImages(final boolean redactAllImages) {
this.redactAllImages = redactAllImages;
}

public Set<String> getRedactClasses() {
return this.redactClasses;
}

public void setRedactClasses(final Set<String> redactClasses) {
this.redactClasses = redactClasses;
}

@ApiStatus.Internal
public @NotNull SentryReplayQuality getQuality() {
return quality;
Expand Down

0 comments on commit 7bd8d98

Please sign in to comment.