Snap for 11494049 from 322b905f71 to 24Q3-release
Change-Id: I0997b7fd83e0a5be781a7485a91e28d084a6e1e3
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresFlagsEnabled(FLAG_SENSITIVE_CONTENT_APP_PROTECTION)
|
||||
fun isAvailable_screenshareSensitiveContentHidingEnabled_returnTrue() {
|
||||
assertTrue(controller.isAvailable)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user