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

Commit 272eb6cb authored by Will Leshner's avatar Will Leshner Committed by Bryce Lee
Browse files

Add a setting to control when to start glanceable hub.

To toggle the setting:

adb shell settings put secure when_to_start_glanceable_hub VALUE

Where a VALUE of 0 should disable auto-showing the hub.

Bug: 401001786
Test: NA (just declaring the setting in this change)
Flag: EXEMPT setting declaration
Change-Id: I27e520a6db32f172d63f5090453582b637492177
parent 2586013b
Loading
Loading
Loading
Loading
+51 −0
Original line number Diff line number Diff line
@@ -10616,6 +10616,57 @@ public final class Settings {
        @SuppressLint({"UnflaggedApi", "NoSettingsProvider"}) // @TestApi purely for CTS support.
        public static final String GLANCEABLE_HUB_ENABLED = "glanceable_hub_enabled";
        /**
         * Indicates that glanceable hub should never be started automatically.
         *
         * @hide
         */
        public static final int GLANCEABLE_HUB_START_NEVER = 0;
        /**
         * Indicates that glanceable hub should be started when charging.
         *
         * @hide
         */
        public static final int GLANCEABLE_HUB_START_CHARGING = 1;
        /**
         * Indicates that glanceable hub should be started when charging and upright.
         *
         * @hide
         */
        public static final int GLANCEABLE_HUB_START_CHARGING_UPRIGHT = 2;
        /**
         * Indicates that glanceable hub should be started when docked.
         *
         * @hide
         */
        public static final int GLANCEABLE_HUB_START_DOCKED = 3;
        /** @hide */
        @Retention(RetentionPolicy.SOURCE)
        @IntDef({
                GLANCEABLE_HUB_START_NEVER,
                GLANCEABLE_HUB_START_CHARGING,
                GLANCEABLE_HUB_START_CHARGING_UPRIGHT,
                GLANCEABLE_HUB_START_DOCKED,
        })
        public @interface WhenToStartGlanceableHub {
        }
        /**
         * Indicates when to start glanceable hub. Possible values are:
         * 0: Never
         * 1: While charging always
         * 2: While upright and charging
         * 3: While docked
         *
         * @hide
         */
        public static final String WHEN_TO_START_GLANCEABLE_HUB =
                "when_to_start_glanceable_hub";
        /**
         * Whether home controls are enabled to be shown over the screensaver by the user.
         *
+1 −0
Original line number Diff line number Diff line
@@ -267,6 +267,7 @@ public class SecureSettings {
        Settings.Secure.SEARCH_ALL_ENTRYPOINTS_ENABLED,
        Settings.Secure.HUB_MODE_TUTORIAL_STATE,
        Settings.Secure.GLANCEABLE_HUB_ENABLED,
        Settings.Secure.WHEN_TO_START_GLANCEABLE_HUB,
        Settings.Secure.STYLUS_BUTTONS_ENABLED,
        Settings.Secure.STYLUS_HANDWRITING_ENABLED,
        Settings.Secure.DEFAULT_NOTE_TASK_PROFILE,
+2 −0
Original line number Diff line number Diff line
@@ -430,6 +430,8 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.DND_CONFIGS_MIGRATED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.HUB_MODE_TUTORIAL_STATE, NON_NEGATIVE_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.GLANCEABLE_HUB_ENABLED, new InclusiveIntegerRangeValidator(0, 1));
        VALIDATORS.put(Secure.WHEN_TO_START_GLANCEABLE_HUB,
                new InclusiveIntegerRangeValidator(0, 3));
        VALIDATORS.put(Secure.STYLUS_BUTTONS_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.STYLUS_HANDWRITING_ENABLED,
                new DiscreteValueValidator(new String[] {"-1", "0", "1"}));