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

Commit 9d2bdbd9 authored by Bryce Lee's avatar Bryce Lee Committed by Android (Google) Code Review
Browse files

Merge changes from topic "408229468-low-light-refactor" into main

* changes:
  Support additional low-light behaviors.
  Refactor low-light behavior.
  Low light display behavior settings.
parents 89b2cd7a f6762fcb
Loading
Loading
Loading
Loading
+59 −0
Original line number Diff line number Diff line
@@ -10791,6 +10791,65 @@ public final class Settings {
        public static final String GLANCEABLE_HUB_RESTRICT_TO_WIRELESS_CHARGING =
                "glanceable_hub_restrict_to_writeless_charging";
        /**
         * Nothing should be done during low light
         *
         * @hide
         */
        public static final int LOW_LIGHT_DISPLAY_BEHAVIOR_NONE = 0;
        /**
         * The screen should turn completely off in low light.
         *
         * @hide
         */
        public static final int LOW_LIGHT_DISPLAY_BEHAVIOR_SCREEN_OFF = 1;
        /**
         * The screen should switch to a low light clock dream if dreaming is enabled in low light.
         *
         * @hide
         */
        public static final int LOW_LIGHT_DISPLAY_BEHAVIOR_LOW_LIGHT_CLOCK_DREAM = 2;
        /**
         * The screen should not show dreams if enabled (AOD will be permitted).
         *
         * @hide
         */
        public static final int LOW_LIGHT_DISPLAY_BEHAVIOR_NO_DREAM = 3;
        /** @hide */
        @Retention(RetentionPolicy.SOURCE)
        @IntDef({
                LOW_LIGHT_DISPLAY_BEHAVIOR_NONE,
                LOW_LIGHT_DISPLAY_BEHAVIOR_SCREEN_OFF,
                LOW_LIGHT_DISPLAY_BEHAVIOR_LOW_LIGHT_CLOCK_DREAM,
                LOW_LIGHT_DISPLAY_BEHAVIOR_NO_DREAM,
        })
        public @interface LowLightDisplayBehavior {
        }
        /**
         * Indicates display behavior in low light. Options are:
         * 0: None
         * 1: Keep screen off
         * 2: Show low light clock dream
         * 3: Disable dreaming
         *
         * @hide
         */
        public static final String LOW_LIGHT_DISPLAY_BEHAVIOR =
                "low_light_display_behavior";
        /**
         * Indicates whether display behavior in low light is enabled.
         *
         * @hide
         */
        public static final String LOW_LIGHT_DISPLAY_BEHAVIOR_ENABLED =
                "low_light_display_behavior_enabled";
        /**
         * Whether home controls are enabled to be shown over the screensaver by the user.
         *
+6 −0
Original line number Diff line number Diff line
@@ -2871,6 +2871,12 @@
    <!-- Whether to restrict auto-showing glanceable hub to wireless charging. -->
    <bool name="config_onlyShowGlanceableHubWhenWirelessChargingDefault">false</bool>

    <!-- Whether or not low light display behavior is enabled -->
    <bool name="config_lowLightDisplayBehaviorEnabledDefault">false</bool>

    <!-- The default low light display behavior. 0 represents no behavior -->
    <integer name="config_lowLightDisplayBehaviorDefault">0</integer>

    <!-- The duration in milliseconds of the dream opening animation.  -->
    <integer name="config_dreamOpenAnimationDuration">250</integer>
    <!-- The duration in milliseconds of the dream closing animation.  -->
+2 −0
Original line number Diff line number Diff line
@@ -2084,6 +2084,8 @@
  <java-symbol type="bool" name="config_glanceableHubEnabled" />
  <java-symbol type="integer" name="config_whenToStartHubModeDefault" />
  <java-symbol type="bool" name="config_onlyShowGlanceableHubWhenWirelessChargingDefault" />
  <java-symbol type="bool" name="config_lowLightDisplayBehaviorEnabledDefault" />
  <java-symbol type="integer" name="config_lowLightDisplayBehaviorDefault" />
  <java-symbol type="integer" name="config_keyguardDrawnTimeout" />
  <java-symbol type="bool" name="config_goToSleepOnButtonPressTheaterMode" />
  <java-symbol type="bool" name="config_supportLongPressPowerWhenNonInteractive" />
+2 −0
Original line number Diff line number Diff line
@@ -164,6 +164,8 @@ public class SecureSettings {
        Settings.Secure.SCREENSAVER_ACTIVATE_ON_POSTURED,
        Settings.Secure.SCREENSAVER_HOME_CONTROLS_ENABLED,
        Settings.Secure.SCREENSAVER_RESTRICT_TO_WIRELESS_CHARGING,
        Settings.Secure.LOW_LIGHT_DISPLAY_BEHAVIOR,
        Settings.Secure.LOW_LIGHT_DISPLAY_BEHAVIOR_ENABLED,
        Settings.Secure.SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
        Settings.Secure.VOLUME_DIALOG_DISMISS_TIMEOUT,
        Settings.Secure.VOLUME_HUSH_GESTURE,
+2 −0
Original line number Diff line number Diff line
@@ -237,6 +237,8 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.SCREENSAVER_ACTIVATE_ON_POSTURED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.SCREENSAVER_HOME_CONTROLS_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.SCREENSAVER_RESTRICT_TO_WIRELESS_CHARGING, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.LOW_LIGHT_DISPLAY_BEHAVIOR, new InclusiveIntegerRangeValidator(0, 3));
        VALIDATORS.put(Secure.LOW_LIGHT_DISPLAY_BEHAVIOR_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.SHOW_FIRST_CRASH_DIALOG_DEV_OPTION, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.VOLUME_DIALOG_DISMISS_TIMEOUT, NON_NEGATIVE_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.VOLUME_HUSH_GESTURE, NON_NEGATIVE_INTEGER_VALIDATOR);
Loading