Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 322b905f authored by Manjeet Rulhania's avatar Manjeet Rulhania Committed by Android (Google) Code Review
Browse files

Merge "add sensitive content protection flag to developer option" into main

parents 7291a650 8925db1c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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 {
+10 −2
Original line number Diff line number Diff line
@@ -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)
    }
}