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

Commit 89aa2261 authored by Chris Wren's avatar Chris Wren
Browse files

add a global control for badging

Content observer callbacks don't specify the user,
so scan all the users we know about. User switches
will also trigger an update which will explicitly
check the setting for the (now) current user.

Migrate tests to TestableContext to allow the test
to safely override secure settings.

Bug: 36021111
Test: runtest systemui-notification
Change-Id: I588068382912955da114cc351df7a1e7b4f0733f
parent 629c20c9
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -6945,6 +6945,13 @@ public final class Settings {
         */
        public static final String CMAS_ADDITIONAL_BROADCAST_PKG = "cmas_additional_broadcast_pkg";

        /**
         * Whether the launcher should show any notification badges.
         * The value is boolean (1 or 0).
         * @hide
         */
        public static final String NOTIFICATION_BADGING = "notification_badging";

        /**
         * This are the settings to be backed up.
         *
@@ -7040,7 +7047,8 @@ public final class Settings {
            AUTOMATIC_STORAGE_MANAGER_DAYS_TO_RETAIN,
            ASSIST_GESTURE_ENABLED,
            ASSIST_GESTURE_SENSITIVITY,
            VR_DISPLAY_MODE
            VR_DISPLAY_MODE,
            NOTIFICATION_BADGING
        };

        /**
+1 −0
Original line number Diff line number Diff line
@@ -503,6 +503,7 @@ message SecureSettingsProto {
    SettingProto demo_user_setup_complete = 165;
    SettingProto instant_apps_enabled = 166;
    SettingProto device_paired = 167;
    SettingProto notification_badging = 168;
}

message SystemSettingsProto {
+3 −0
Original line number Diff line number Diff line
@@ -1013,6 +1013,9 @@
    <!-- Is the notification LED intrusive? Used to decide if there should be a disable option -->
    <bool name="config_intrusiveNotificationLed">false</bool>

    <!-- De we do icon badges? Used to decide if there should be a disable option-->
    <bool name="config_notificationBadging">true</bool>

    <!-- Default value for LED off time when the battery is low on charge in miliseconds -->
    <integer name="config_notificationsBatteryLedOff">2875</integer>

+1 −0
Original line number Diff line number Diff line
@@ -2087,6 +2087,7 @@
  <java-symbol type="string" name="config_wifi_tether_enable" />
  <java-symbol type="integer" name="config_wifi_wakeup_available" />
  <java-symbol type="bool" name="config_intrusiveNotificationLed" />
  <java-symbol type="bool" name="config_notificationBadging" />
  <java-symbol type="dimen" name="preference_fragment_padding_bottom" />
  <java-symbol type="dimen" name="preference_fragment_padding_side" />
  <java-symbol type="drawable" name="expander_ic_maximized" />
+3 −0
Original line number Diff line number Diff line
@@ -1434,6 +1434,9 @@ class SettingsProtoDumpUtil {
        dumpSetting(s, p,
                Settings.Secure.DEVICE_PAIRED,
                SecureSettingsProto.DEVICE_PAIRED);
        dumpSetting(s, p,
                Settings.Secure.NOTIFICATION_BADGING,
                SecureSettingsProto.NOTIFICATION_BADGING);
    }

    private static void dumpProtoSystemSettingsLocked(
Loading