From 7940ad02a778c3e681195c6d79dc9c271ae25048 Mon Sep 17 00:00:00 2001 From: Shubham Dubey Date: Sun, 6 Feb 2022 04:15:32 +0000 Subject: [PATCH] Revert "Enable notification permission feature" Revert "Ask for notification permission" Revert submission 16789354-jr-enable-perm-feature Reason for revert: Breaking Camera and Notification tests BUG:218116478 BUG:218116141 BUG:218220073 BUG:218219131 Reverted Changes: Ife73f3d46:Ask for notification permission I718cc8cb1:Enable notification permission feature Change-Id: I9cb652b91861d0e68d8b0f783c0499f97bd6c291 --- .../android/providers/settings/SettingsProvider.java | 12 ++++-------- .../notification/NotificationManagerServiceTest.java | 3 --- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 077337cdc8c3e..51870e2e958ed 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -3624,7 +3624,7 @@ public class SettingsProvider extends ContentProvider { } private final class UpgradeController { - private static final int SETTINGS_VERSION = 210; + private static final int SETTINGS_VERSION = 209; private final int mUserId; @@ -5498,21 +5498,17 @@ public class SettingsProvider extends ContentProvider { } if (currentVersion == 208) { - // Unused - currentVersion = 209; - } - if (currentVersion == 209) { - // Version 209: Enable enforcement of + // Version 208: Enable enforcement of // android.Manifest.permission#POST_NOTIFICATIONS in order for applications // to post notifications. final SettingsState secureSettings = getSecureSettingsLocked(userId); secureSettings.insertSettingLocked( Secure.NOTIFICATION_PERMISSION_ENABLED, - /* enabled= */ "1", + /* enabled= */" 1", /* tag= */ null, /* makeDefault= */ false, SettingsState.SYSTEM_PACKAGE_NAME); - currentVersion = 210; + currentVersion = 209; } // vXXX: Add new settings above this point. diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java index d4d076566fb36..9f92294135c0b 100755 --- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java @@ -372,9 +372,6 @@ public class NotificationManagerServiceTest extends UiServiceTestCase { "android.permission.WRITE_DEVICE_CONFIG", "android.permission.READ_DEVICE_CONFIG", "android.permission.READ_CONTACTS"); - Settings.Secure.putIntForUser( - getContext().getContentResolver(), - Settings.Secure.NOTIFICATION_PERMISSION_ENABLED, 0, USER_SYSTEM); MockitoAnnotations.initMocks(this);