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

Commit b5a783d6 authored by Mady Mellor's avatar Mady Mellor
Browse files

Move bubble setting to secure table & support multiuser

* Move bubbles setting from the global table to the secure
  table, this should be a per-user setting
* Update step in SettingsProvider that adds the secure
  setting based on the value of the previous global, or if
  the user is managed, it checks if the owner of the managed
  user has a secure setting & uses the value from that to
  insert the new setting.
* Adds the secure setting to the "cloned to profile"
  group since it should follow the setting of the profile
  owner.
* PreferencesHelper tracks this value per-user.

Bug: 173408780
Test: atest PreferencesHelperTest NotificationManagerServiceTest BubbleExtractorTest
Change-Id: I261364890fcc54fb2791e628b41c07aeddde3974
parent 18818b75
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2109,7 +2109,7 @@ package android.provider {
    field public static final String LOCATION_IGNORE_SETTINGS_PACKAGE_WHITELIST = "location_ignore_settings_package_whitelist";
    field public static final String LOW_POWER_MODE = "low_power";
    field public static final String LOW_POWER_MODE_STICKY = "low_power_sticky";
    field public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
    field @Deprecated public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
    field public static final String OVERLAY_DISPLAY_DEVICES = "overlay_display_devices";
    field public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
    field public static final String USER_DISABLED_HDR_FORMATS = "user_disabled_hdr_formats";
@@ -2133,6 +2133,7 @@ package android.provider {
    field public static final String IMMERSIVE_MODE_CONFIRMATIONS = "immersive_mode_confirmations";
    field public static final String NFC_PAYMENT_DEFAULT_COMPONENT = "nfc_payment_default_component";
    field public static final String NOTIFICATION_BADGING = "notification_badging";
    field public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
    field public static final String POWER_MENU_LOCKED_SHOW_CONTENT = "power_menu_locked_show_content";
    field public static final String SELECTED_SPELL_CHECKER = "selected_spell_checker";
    field public static final String SELECTED_SPELL_CHECKER_SUBTYPE = "selected_spell_checker_subtype";
+16 −1
Original line number Diff line number Diff line
@@ -9497,6 +9497,18 @@ public final class Settings {
        public static final String BUBBLE_IMPORTANT_CONVERSATIONS
                = "bubble_important_conversations";
        /**
         * When enabled, notifications able to bubble will display an affordance allowing the user
         * to bubble them.
         * The value is boolean (1 to enable or 0 to disable).
         *
         * @hide
         */
        @TestApi
        @SuppressLint("NoSettingsProvider")
        @Readable
        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).
@@ -9968,6 +9980,7 @@ public final class Settings {
            CLONE_TO_MANAGED_PROFILE.add(LOCATION_CHANGER);
            CLONE_TO_MANAGED_PROFILE.add(LOCATION_MODE);
            CLONE_TO_MANAGED_PROFILE.add(SHOW_IME_WITH_HARD_KEYBOARD);
            CLONE_TO_MANAGED_PROFILE.add(NOTIFICATION_BUBBLES);
        }
        /** @hide */
@@ -10061,7 +10074,9 @@ public final class Settings {
         * Whether the notification bubbles are globally enabled
         * The value is boolean (1 or 0).
         * @hide
         * @deprecated moved to secure settings.
         */
        @Deprecated
        @TestApi
        @Readable
        public static final String NOTIFICATION_BUBBLES = "notification_bubbles";
@@ -14810,7 +14825,7 @@ public final class Settings {
            MOVED_TO_SECURE.add(Global.ZEN_SETTINGS_SUGGESTION_VIEWED);
            MOVED_TO_SECURE.add(Global.CHARGING_SOUNDS_ENABLED);
            MOVED_TO_SECURE.add(Global.CHARGING_VIBRATION_ENABLED);
            MOVED_TO_SECURE.add(Global.NOTIFICATION_BUBBLES);
        }
        /** @hide */
+0 −1
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ public class GlobalSettings {
        Settings.Global.ZEN_DURATION,
        Settings.Global.CHARGING_VIBRATION_ENABLED,
        Settings.Global.AWARE_ALLOWED,
        Settings.Global.NOTIFICATION_BUBBLES,
        Settings.Global.CUSTOM_BUGREPORT_HANDLER_APP,
        Settings.Global.CUSTOM_BUGREPORT_HANDLER_USER,
        Settings.Global.DEVELOPMENT_SETTINGS_ENABLED,
+1 −0
Original line number Diff line number Diff line
@@ -187,5 +187,6 @@ public class SecureSettings {
        Settings.Secure.ACCESSIBILITY_FLOATING_MENU_ICON_TYPE,
        Settings.Secure.ACCESSIBILITY_FLOATING_MENU_OPACITY,
        Settings.Secure.ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED,
        Settings.Secure.NOTIFICATION_BUBBLES,
    };
}
+0 −1
Original line number Diff line number Diff line
@@ -128,7 +128,6 @@ public class GlobalSettingsValidators {
        VALIDATORS.put(
                Global.POWER_BUTTON_VERY_LONG_PRESS, new InclusiveIntegerRangeValidator(0, 1));
        VALIDATORS.put(Global.KEY_CHORD_POWER_VOLUME_UP, new InclusiveIntegerRangeValidator(0, 2));
        VALIDATORS.put(Global.NOTIFICATION_BUBBLES, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Global.CUSTOM_BUGREPORT_HANDLER_APP, ANY_STRING_VALIDATOR);
        VALIDATORS.put(Global.CUSTOM_BUGREPORT_HANDLER_USER, ANY_INTEGER_VALIDATOR);
        VALIDATORS.put(Global.DEVELOPMENT_SETTINGS_ENABLED, BOOLEAN_VALIDATOR);
Loading