From a2d06273c10e67ea78087d8b08ea9a418d321648 Mon Sep 17 00:00:00 2001 From: Sam Dubey Date: Thu, 17 Nov 2022 07:22:54 +0000 Subject: [PATCH] Revert "Add configuration for defaulting notification behavior" Likely causing b/259499400 This reverts commit a92688d64269ff9121c3a7c4ac94fd674725632a. Change-Id: I781a7ecf9139eca11e1db895f86268b893258543 --- res/values/config.xml | 3 -- .../notification/RedactionInterstitial.java | 5 +--- .../RedactionInterstitialTest.java | 29 ------------------- 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/res/values/config.xml b/res/values/config.xml index b7c0bad7fd2..205b9b5baa5 100755 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -634,9 +634,6 @@ android.uid.system:1000 - - true - false diff --git a/src/com/android/settings/notification/RedactionInterstitial.java b/src/com/android/settings/notification/RedactionInterstitial.java index d6fdaf81c95..f243250a611 100644 --- a/src/com/android/settings/notification/RedactionInterstitial.java +++ b/src/com/android/settings/notification/RedactionInterstitial.java @@ -189,16 +189,13 @@ public class RedactionInterstitial extends SettingsActivity { } private void loadFromSettings() { - final boolean showUnRedactedDefault = getContext().getResources().getBoolean( - R.bool.default_allow_sensitive_lockscreen_content); final boolean managedProfile = UserManager.get(getContext()).isManagedProfile(mUserId); // Hiding all notifications is device-wide setting, managed profiles can only set // whether their notifications are show in full or redacted. final boolean showNotifications = managedProfile || Settings.Secure.getIntForUser( getContentResolver(), LOCK_SCREEN_SHOW_NOTIFICATIONS, 0, mUserId) != 0; final boolean showUnredacted = Settings.Secure.getIntForUser( - getContentResolver(), LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, - showUnRedactedDefault ? 1 : 0, mUserId) != 0; + getContentResolver(), LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, mUserId) != 0; int checkedButtonId = R.id.hide_all; if (showNotifications) { diff --git a/tests/robotests/src/com/android/settings/notification/RedactionInterstitialTest.java b/tests/robotests/src/com/android/settings/notification/RedactionInterstitialTest.java index 9d475b84524..5c6da495235 100644 --- a/tests/robotests/src/com/android/settings/notification/RedactionInterstitialTest.java +++ b/tests/robotests/src/com/android/settings/notification/RedactionInterstitialTest.java @@ -21,7 +21,6 @@ import android.widget.RadioButton; import com.android.settings.R; import com.android.settings.RestrictedRadioButton; import com.android.settings.notification.RedactionInterstitial.RedactionInterstitialFragment; -import com.android.settings.testutils.shadow.SettingsShadowResources; import com.android.settings.testutils.shadow.ShadowRestrictedLockUtilsInternal; import com.android.settings.testutils.shadow.ShadowUtils; @@ -39,7 +38,6 @@ import org.robolectric.shadows.ShadowUserManager; @Config(shadows = { ShadowUtils.class, ShadowRestrictedLockUtilsInternal.class, - SettingsShadowResources.class, }) public class RedactionInterstitialTest { private RedactionInterstitial mActivity; @@ -136,28 +134,6 @@ public class RedactionInterstitialTest { assertSelectedButton(R.id.redact_sensitive); } - @Test - public void defaultShowSensitiveContent_configDeny() { - final ContentResolver resolver = RuntimeEnvironment.application.getContentResolver(); - Settings.Secure.putIntForUser(resolver, - LOCK_SCREEN_SHOW_NOTIFICATIONS, 1, UserHandle.myUserId()); - setupConfig(false); - setupActivity(); - - assertSelectedButton(R.id.redact_sensitive); - } - - @Test - public void defaultShowSensitiveContent_configAllow() { - final ContentResolver resolver = RuntimeEnvironment.application.getContentResolver(); - Settings.Secure.putIntForUser(resolver, - LOCK_SCREEN_SHOW_NOTIFICATIONS, 1, UserHandle.myUserId()); - setupConfig(true); - setupActivity(); - - assertSelectedButton(R.id.show_all); - } - private void setupActivity() { mActivity = buildActivity(RedactionInterstitial.class, new Intent()).setup().get(); mFragment = (RedactionInterstitialFragment) @@ -166,11 +142,6 @@ public class RedactionInterstitialTest { assertThat(mFragment).isNotNull(); } - private void setupConfig(boolean allowSensitiveContent) { - SettingsShadowResources.overrideResource( - R.bool.default_allow_sensitive_lockscreen_content, allowSensitiveContent); - } - private void setupSettings(int show, int showUnredacted) { final ContentResolver resolver = RuntimeEnvironment.application.getContentResolver(); Settings.Secure.putIntForUser(resolver,