diff --git a/features/dd-sdk-android-session-replay/api/apiSurface b/features/dd-sdk-android-session-replay/api/apiSurface index cdd2f5a446..6d8826ca40 100644 --- a/features/dd-sdk-android-session-replay/api/apiSurface +++ b/features/dd-sdk-android-session-replay/api/apiSurface @@ -10,8 +10,8 @@ data class com.datadog.android.sessionreplay.MapperTypeWrapper fun android.view.View.setSessionReplayHidden(Boolean) -fun android.view.View.datadogSessionReplayImagePrivacy(ImagePrivacy?) -fun android.view.View.datadogSessionReplayTextAndInputPrivacy(TextAndInputPrivacy?) +fun android.view.View.setSessionReplayImagePrivacy(ImagePrivacy?) +fun android.view.View.setSessionReplayTextAndInputPrivacy(TextAndInputPrivacy?) object com.datadog.android.sessionreplay.SessionReplay fun enable(SessionReplayConfiguration, com.datadog.android.api.SdkCore = Datadog.getInstance()) fun startRecording(com.datadog.android.api.SdkCore = Datadog.getInstance()) diff --git a/features/dd-sdk-android-session-replay/api/dd-sdk-android-session-replay.api b/features/dd-sdk-android-session-replay/api/dd-sdk-android-session-replay.api index f7419c7ee1..40ec44e26e 100644 --- a/features/dd-sdk-android-session-replay/api/dd-sdk-android-session-replay.api +++ b/features/dd-sdk-android-session-replay/api/dd-sdk-android-session-replay.api @@ -23,9 +23,9 @@ public final class com/datadog/android/sessionreplay/MapperTypeWrapper { } public final class com/datadog/android/sessionreplay/PrivacyOverrideExtensionsKt { - public static final fun datadogSessionReplayImagePrivacy (Landroid/view/View;Lcom/datadog/android/sessionreplay/ImagePrivacy;)V - public static final fun datadogSessionReplayTextAndInputPrivacy (Landroid/view/View;Lcom/datadog/android/sessionreplay/TextAndInputPrivacy;)V public static final fun setSessionReplayHidden (Landroid/view/View;Z)V + public static final fun setSessionReplayImagePrivacy (Landroid/view/View;Lcom/datadog/android/sessionreplay/ImagePrivacy;)V + public static final fun setSessionReplayTextAndInputPrivacy (Landroid/view/View;Lcom/datadog/android/sessionreplay/TextAndInputPrivacy;)V } public final class com/datadog/android/sessionreplay/SessionReplay { diff --git a/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/PrivacyOverrideExtensions.kt b/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/PrivacyOverrideExtensions.kt index 39e5999520..312b86c120 100644 --- a/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/PrivacyOverrideExtensions.kt +++ b/features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/PrivacyOverrideExtensions.kt @@ -29,7 +29,7 @@ fun View.setSessionReplayHidden(hide: Boolean) { * @param privacy the new privacy level to use for the view * or null to remove the override. */ -fun View.datadogSessionReplayImagePrivacy(privacy: ImagePrivacy?) { +fun View.setSessionReplayImagePrivacy(privacy: ImagePrivacy?) { if (privacy == null) { this.setTag(R.id.datadog_image_privacy, null) } else { @@ -43,7 +43,7 @@ fun View.datadogSessionReplayImagePrivacy(privacy: ImagePrivacy?) { * @param privacy the new privacy level to use for the view * or null to remove the override. */ -fun View.datadogSessionReplayTextAndInputPrivacy(privacy: TextAndInputPrivacy?) { +fun View.setSessionReplayTextAndInputPrivacy(privacy: TextAndInputPrivacy?) { if (privacy == null) { this.setTag(R.id.datadog_text_and_input_privacy, null) } else { diff --git a/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/PrivacyOverrideExtensionsTest.kt b/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/PrivacyOverrideExtensionsTest.kt index af077316d3..dc6b073523 100644 --- a/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/PrivacyOverrideExtensionsTest.kt +++ b/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/PrivacyOverrideExtensionsTest.kt @@ -55,7 +55,7 @@ internal class PrivacyOverrideExtensionsTest { } @Test - fun `M set tag W datadogSessionReplayImagePrivacy() { with privacy }`( + fun `M set tag W setSessionReplayImagePrivacy() { with privacy }`( forge: Forge ) { // Given @@ -63,26 +63,26 @@ internal class PrivacyOverrideExtensionsTest { val mockPrivacy = forge.aValueFrom(ImagePrivacy::class.java) // When - mockView.datadogSessionReplayImagePrivacy(mockPrivacy) + mockView.setSessionReplayImagePrivacy(mockPrivacy) // Then verify(mockView).setTag(eq(R.id.datadog_image_privacy), eq(mockPrivacy.toString())) } @Test - fun `M set tag to null W datadogSessionReplayImagePrivacy() { privacy is null }`() { + fun `M set tag to null W setSessionReplayImagePrivacy() { privacy is null }`() { // Given val mockView = mock() // When - mockView.datadogSessionReplayImagePrivacy(null) + mockView.setSessionReplayImagePrivacy(null) // Then verify(mockView).setTag(eq(R.id.datadog_image_privacy), isNull()) } @Test - fun `M set tag W datadogSessionReplayTextAndInputPrivacy() { with privacy }`( + fun `M set tag W setSessionReplayTextAndInputPrivacy() { with privacy }`( forge: Forge ) { // Given @@ -90,19 +90,19 @@ internal class PrivacyOverrideExtensionsTest { val mockPrivacy = forge.aValueFrom(TextAndInputPrivacy::class.java) // When - mockView.datadogSessionReplayTextAndInputPrivacy(mockPrivacy) + mockView.setSessionReplayTextAndInputPrivacy(mockPrivacy) // Then verify(mockView).setTag(eq(R.id.datadog_text_and_input_privacy), eq(mockPrivacy.toString())) } @Test - fun `M set tag to null W datadogSessionReplayTextAndInputPrivacy() { privacy is null }`() { + fun `M set tag to null W setSessionReplayTextAndInputPrivacy() { privacy is null }`() { // Given val mockView = mock() // When - mockView.datadogSessionReplayTextAndInputPrivacy(null) + mockView.setSessionReplayTextAndInputPrivacy(null) // Then verify(mockView).setTag(eq(R.id.datadog_text_and_input_privacy), isNull()) diff --git a/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/SnapshotProducerTest.kt b/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/SnapshotProducerTest.kt index 606f1737f1..47427de3e4 100644 --- a/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/SnapshotProducerTest.kt +++ b/features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/SnapshotProducerTest.kt @@ -12,14 +12,14 @@ import com.datadog.android.api.InternalLogger import com.datadog.android.sessionreplay.ImagePrivacy import com.datadog.android.sessionreplay.R import com.datadog.android.sessionreplay.TextAndInputPrivacy -import com.datadog.android.sessionreplay.datadogSessionReplayImagePrivacy -import com.datadog.android.sessionreplay.datadogSessionReplayTextAndInputPrivacy import com.datadog.android.sessionreplay.forge.ForgeConfigurator import com.datadog.android.sessionreplay.internal.async.RecordedDataQueueRefs import com.datadog.android.sessionreplay.internal.recorder.SnapshotProducer.Companion.INVALID_PRIVACY_LEVEL_ERROR import com.datadog.android.sessionreplay.model.MobileSegment import com.datadog.android.sessionreplay.recorder.MappingContext import com.datadog.android.sessionreplay.recorder.SystemInformation +import com.datadog.android.sessionreplay.setSessionReplayImagePrivacy +import com.datadog.android.sessionreplay.setSessionReplayTextAndInputPrivacy import com.datadog.android.sessionreplay.utils.ImageWireframeHelper import fr.xgouchet.elmyr.Forge import fr.xgouchet.elmyr.annotation.Forgery @@ -387,8 +387,8 @@ internal class SnapshotProducerTest { } val fakeImagePrivacy = forge.aValueFrom(ImagePrivacy::class.java) val fakeTextAndInputPrivacy = forge.aValueFrom(TextAndInputPrivacy::class.java) - mockRoot.datadogSessionReplayImagePrivacy(fakeImagePrivacy) - mockRoot.datadogSessionReplayTextAndInputPrivacy(fakeTextAndInputPrivacy) + mockRoot.setSessionReplayImagePrivacy(fakeImagePrivacy) + mockRoot.setSessionReplayTextAndInputPrivacy(fakeTextAndInputPrivacy) val fakeTraversedTreeView = TreeViewTraversal.TraversedTreeView( fakeViewWireframes, TraversalStrategy.TRAVERSE_ALL_CHILDREN