diff --git a/api/test-current.txt b/api/test-current.txt index 5cf2d0bf49a88..7637b87085b8a 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -2405,7 +2405,6 @@ package android.provider { field public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS = "location_access_check_delay_millis"; field public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS = "location_access_check_interval_millis"; field public static final String NOTIFICATION_BADGING = "notification_badging"; - field @Deprecated public static final String NOTIFICATION_BUBBLES = "notification_bubbles"; field @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public static final String SYNC_PARENT_SOUNDS = "sync_parent_sounds"; field public static final String USER_SETUP_COMPLETE = "user_setup_complete"; field public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 3c26df3c560b6..e4e8bf791d473 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -7907,16 +7907,6 @@ public final class Settings { @TestApi public static final String NOTIFICATION_BADGING = "notification_badging"; - /** - * Whether the notification bubbles are globally enabled - * The value is boolean (1 or 0). - * @hide - * @deprecated use {@link Global#NOTIFICATION_BUBBLES} instead. - */ - @TestApi - @Deprecated - public static final String NOTIFICATION_BUBBLES = "notification_bubbles"; - /** * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right * swipe). diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java index 8c2e43170cc2a..b8372adfa074c 100644 --- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java +++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java @@ -114,7 +114,6 @@ public class SecureSettings { Settings.Secure.ASSIST_GESTURE_WAKE_ENABLED, Settings.Secure.VR_DISPLAY_MODE, Settings.Secure.NOTIFICATION_BADGING, - Settings.Secure.NOTIFICATION_BUBBLES, Settings.Secure.NOTIFICATION_DISMISS_RTL, Settings.Secure.QS_AUTO_ADDED_TILES, Settings.Secure.SCREENSAVER_ENABLED, diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java index f160edc6e4460..976f3365ab985 100644 --- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java +++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java @@ -157,7 +157,6 @@ public class SecureSettingsValidators { VALIDATORS.put(Secure.ASSIST_GESTURE_WAKE_ENABLED, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.VR_DISPLAY_MODE, new DiscreteValueValidator(new String[] {"0", "1"})); VALIDATORS.put(Secure.NOTIFICATION_BADGING, BOOLEAN_VALIDATOR); - VALIDATORS.put(Secure.NOTIFICATION_BUBBLES, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.NOTIFICATION_DISMISS_RTL, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.QS_AUTO_ADDED_TILES, TILE_LIST_VALIDATOR); VALIDATORS.put(Secure.SCREENSAVER_ENABLED, BOOLEAN_VALIDATOR); diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 720266a724234..16c96e67c85a9 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -4385,8 +4385,7 @@ public class SettingsProvider extends ContentProvider { if (currentVersion == 182) { // Remove secure bubble settings. - getSecureSettingsLocked(userId).deleteSettingLocked( - Secure.NOTIFICATION_BUBBLES); + getSecureSettingsLocked(userId).deleteSettingLocked("notification_bubbles"); // Add global bubble settings. getGlobalSettingsLocked().insertSettingLocked(Global.NOTIFICATION_BUBBLES, diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index a8ba82a740657..3341991aa0ae9 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -94,7 +94,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_TOAST; import static com.android.server.am.PendingIntentRecord.FLAG_ACTIVITY_SENDER; import static com.android.server.am.PendingIntentRecord.FLAG_BROADCAST_SENDER; import static com.android.server.am.PendingIntentRecord.FLAG_SERVICE_SENDER; -import static com.android.server.notification.PreferencesHelper.DEFAULT_ALLOW_BUBBLE; import static com.android.server.utils.PriorityDump.PRIORITY_ARG; import static com.android.server.utils.PriorityDump.PRIORITY_ARG_CRITICAL; import static com.android.server.utils.PriorityDump.PRIORITY_ARG_NORMAL; @@ -1428,10 +1427,8 @@ public class NotificationManagerService extends SystemService { private final class SettingsObserver extends ContentObserver { private final Uri NOTIFICATION_BADGING_URI = Settings.Secure.getUriFor(Settings.Secure.NOTIFICATION_BADGING); - private final Uri NOTIFICATION_BUBBLES_URI_GLOBAL + private final Uri NOTIFICATION_BUBBLES_URI = Settings.Global.getUriFor(Settings.Global.NOTIFICATION_BUBBLES); - private final Uri NOTIFICATION_BUBBLES_URI_SECURE - = Settings.Secure.getUriFor(Settings.Secure.NOTIFICATION_BUBBLES); private final Uri NOTIFICATION_LIGHT_PULSE_URI = Settings.System.getUriFor(Settings.System.NOTIFICATION_LIGHT_PULSE); private final Uri NOTIFICATION_RATE_LIMIT_URI @@ -1449,9 +1446,7 @@ public class NotificationManagerService extends SystemService { false, this, UserHandle.USER_ALL); resolver.registerContentObserver(NOTIFICATION_RATE_LIMIT_URI, false, this, UserHandle.USER_ALL); - resolver.registerContentObserver(NOTIFICATION_BUBBLES_URI_GLOBAL, - false, this, UserHandle.USER_ALL); - resolver.registerContentObserver(NOTIFICATION_BUBBLES_URI_SECURE, + resolver.registerContentObserver(NOTIFICATION_BUBBLES_URI, false, this, UserHandle.USER_ALL); update(null); } @@ -1478,41 +1473,9 @@ public class NotificationManagerService extends SystemService { if (uri == null || NOTIFICATION_BADGING_URI.equals(uri)) { mPreferencesHelper.updateBadgingEnabled(); } - // In QPR we moved the setting to Global rather than Secure so that the setting - // applied to work profiles. Unfortunately we need to maintain both to pass CTS without - // a change to CTS outside of a normal letter release. - if (uri == null || NOTIFICATION_BUBBLES_URI_GLOBAL.equals(uri)) { - syncBubbleSettings(resolver, NOTIFICATION_BUBBLES_URI_GLOBAL); + if (uri == null || NOTIFICATION_BUBBLES_URI.equals(uri)) { mPreferencesHelper.updateBubblesEnabled(); } - if (NOTIFICATION_BUBBLES_URI_SECURE.equals(uri)) { - syncBubbleSettings(resolver, NOTIFICATION_BUBBLES_URI_SECURE); - } - } - - private void syncBubbleSettings(ContentResolver resolver, Uri settingToFollow) { - boolean followSecureSetting = settingToFollow.equals(NOTIFICATION_BUBBLES_URI_SECURE); - - int secureSettingValue = Settings.Secure.getInt(resolver, - Settings.Secure.NOTIFICATION_BUBBLES, DEFAULT_ALLOW_BUBBLE ? 1 : 0); - int globalSettingValue = Settings.Global.getInt(resolver, - Settings.Global.NOTIFICATION_BUBBLES, DEFAULT_ALLOW_BUBBLE ? 1 : 0); - - if (globalSettingValue == secureSettingValue) { - return; - } - - if (followSecureSetting) { - // Global => secure - Settings.Global.putInt(resolver, - Settings.Global.NOTIFICATION_BUBBLES, - secureSettingValue); - } else { - // Secure => Global - Settings.Secure.putInt(resolver, - Settings.Secure.NOTIFICATION_BADGING, - globalSettingValue); - } } }