diff --git a/src/com/android/settings/development/SensitiveContentProtectionPreferenceController.kt b/src/com/android/settings/development/SensitiveContentProtectionPreferenceController.kt index e627f81a60d..8acd7006ce4 100644 --- a/src/com/android/settings/development/SensitiveContentProtectionPreferenceController.kt +++ b/src/com/android/settings/development/SensitiveContentProtectionPreferenceController.kt @@ -18,6 +18,7 @@ package com.android.settings.development import android.content.Context import android.permission.flags.Flags.sensitiveNotificationAppProtection import android.provider.Settings +import android.view.flags.Flags.sensitiveContentAppProtection import androidx.annotation.VisibleForTesting import androidx.preference.Preference import androidx.preference.TwoStatePreference @@ -64,6 +65,7 @@ class SensitiveContentProtectionPreferenceController(val context: Context) : override fun isAvailable(): Boolean { return sensitiveNotificationAppProtection() || screenshareNotificationHiding() + || sensitiveContentAppProtection() } companion object { diff --git a/tests/spa_unit/src/com/android/settings/development/SensitiveContentProtectionPreferenceControllerTest.kt b/tests/spa_unit/src/com/android/settings/development/SensitiveContentProtectionPreferenceControllerTest.kt index 18acbbaba65..023572b9e28 100644 --- a/tests/spa_unit/src/com/android/settings/development/SensitiveContentProtectionPreferenceControllerTest.kt +++ b/tests/spa_unit/src/com/android/settings/development/SensitiveContentProtectionPreferenceControllerTest.kt @@ -22,6 +22,7 @@ import android.platform.test.annotations.RequiresFlagsEnabled import android.platform.test.flag.junit.DeviceFlagsValueProvider import android.provider.Settings import android.provider.Settings.Global.DISABLE_SCREEN_SHARE_PROTECTIONS_FOR_APPS_AND_NOTIFICATIONS +import android.view.flags.Flags.FLAG_SENSITIVE_CONTENT_APP_PROTECTION import androidx.preference.Preference import androidx.preference.PreferenceScreen import androidx.preference.SwitchPreference @@ -132,7 +133,8 @@ class SensitiveContentProtectionPreferenceControllerTest { @Test @RequiresFlagsDisabled( FLAG_SENSITIVE_NOTIFICATION_APP_PROTECTION, - FLAG_SCREENSHARE_NOTIFICATION_HIDING) + FLAG_SCREENSHARE_NOTIFICATION_HIDING, + FLAG_SENSITIVE_CONTENT_APP_PROTECTION) fun isAvailable_flagsDisabled_returnFalse() { assertFalse(controller.isAvailable) } @@ -148,4 +150,10 @@ class SensitiveContentProtectionPreferenceControllerTest { fun isAvailable_screenshareNotificationHidingEnabled_returnTrue() { assertTrue(controller.isAvailable) } -} \ No newline at end of file + + @Test + @RequiresFlagsEnabled(FLAG_SENSITIVE_CONTENT_APP_PROTECTION) + fun isAvailable_screenshareSensitiveContentHidingEnabled_returnTrue() { + assertTrue(controller.isAvailable) + } +}