Loading core/java/android/provider/Settings.java +15 −0 Original line number Diff line number Diff line Loading @@ -10675,6 +10675,14 @@ public final class Settings { public static final String WHEN_TO_START_GLANCEABLE_HUB = "when_to_start_glanceable_hub"; /** * Whether glanceable hub should only start when charging wirelessly. * * @hide */ public static final String GLANCEABLE_HUB_RESTRICT_TO_WIRELESS_CHARGING = "glanceable_hub_restrict_to_writeless_charging"; /** * Whether home controls are enabled to be shown over the screensaver by the user. * Loading @@ -10683,6 +10691,13 @@ public final class Settings { public static final String SCREENSAVER_HOME_CONTROLS_ENABLED = "screensaver_home_controls_enabled"; /** * Whether screensaver should only start when charging wirelessly. * * @hide */ public static final String SCREENSAVER_RESTRICT_TO_WIRELESS_CHARGING = "screensaver_restrict_to_writeless_charging"; /** * Default, indicates that the user has not yet started the dock setup flow. Loading core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2849,6 +2849,8 @@ <!-- The default for the setting that controls when to auto-start hub mode. 0 means "never" --> <integer name="config_whenToStartHubModeDefault">0</integer> <!-- Whether to restrict auto-showing glanceable hub to wireless charging. --> <bool name="config_onlyShowGlanceableHubWhenWirelessChargingDefault">false</bool> <!-- The duration in milliseconds of the dream opening animation. --> <integer name="config_dreamOpenAnimationDuration">250</integer> Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2078,6 +2078,7 @@ <java-symbol type="bool" name="config_keepDreamingWhenUnplugging" /> <java-symbol type="bool" name="config_glanceableHubEnabled" /> <java-symbol type="integer" name="config_whenToStartHubModeDefault" /> <java-symbol type="bool" name="config_onlyShowGlanceableHubWhenWirelessChargingDefault" /> <java-symbol type="integer" name="config_keyguardDrawnTimeout" /> <java-symbol type="bool" name="config_goToSleepOnButtonPressTheaterMode" /> <java-symbol type="bool" name="config_supportLongPressPowerWhenNonInteractive" /> Loading packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java +14 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,20 @@ public class DreamBackend { Settings.Secure.SCREENSAVER_COMPLICATIONS_ENABLED, 1) == 1; } /** Set whether to restrict showing dreams to only when charging wirelessly. */ public void setRestrictToWirelessCharging(boolean restrict) { Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.SCREENSAVER_RESTRICT_TO_WIRELESS_CHARGING, restrict ? 1 : 0); } /** Get whether to restrict showing dreams to only when charging wirelessly. */ public boolean getRestrictToWirelessCharging() { return Settings.Secure.getInt( mContext.getContentResolver(), Settings.Secure.SCREENSAVER_RESTRICT_TO_WIRELESS_CHARGING, 0) == 1; } /** Gets all dream complications which are supported on this device. **/ public Set<Integer> getSupportedComplications() { return mSupportedComplications; Loading packages/SettingsLib/tests/robotests/src/com/android/settingslib/dream/DreamBackendTest.java +17 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,23 @@ public final class DreamBackendTest { DreamBackend.WHILE_DOCKED); } @Test public void testSetRestrictedToWirelessCharging() { mBackend.setRestrictToWirelessCharging(true); assertThat(mBackend.getRestrictToWirelessCharging()).isTrue(); } @Test public void testGetRestrictedToWirelessCharging() { Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.SCREENSAVER_RESTRICT_TO_WIRELESS_CHARGING, 1 ); assertThat(mBackend.getRestrictToWirelessCharging()).isTrue(); } private void setControlsEnabledOnLockscreen(boolean enabled) { Settings.Secure.putInt( mContext.getContentResolver(), Loading Loading
core/java/android/provider/Settings.java +15 −0 Original line number Diff line number Diff line Loading @@ -10675,6 +10675,14 @@ public final class Settings { public static final String WHEN_TO_START_GLANCEABLE_HUB = "when_to_start_glanceable_hub"; /** * Whether glanceable hub should only start when charging wirelessly. * * @hide */ public static final String GLANCEABLE_HUB_RESTRICT_TO_WIRELESS_CHARGING = "glanceable_hub_restrict_to_writeless_charging"; /** * Whether home controls are enabled to be shown over the screensaver by the user. * Loading @@ -10683,6 +10691,13 @@ public final class Settings { public static final String SCREENSAVER_HOME_CONTROLS_ENABLED = "screensaver_home_controls_enabled"; /** * Whether screensaver should only start when charging wirelessly. * * @hide */ public static final String SCREENSAVER_RESTRICT_TO_WIRELESS_CHARGING = "screensaver_restrict_to_writeless_charging"; /** * Default, indicates that the user has not yet started the dock setup flow. Loading
core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2849,6 +2849,8 @@ <!-- The default for the setting that controls when to auto-start hub mode. 0 means "never" --> <integer name="config_whenToStartHubModeDefault">0</integer> <!-- Whether to restrict auto-showing glanceable hub to wireless charging. --> <bool name="config_onlyShowGlanceableHubWhenWirelessChargingDefault">false</bool> <!-- The duration in milliseconds of the dream opening animation. --> <integer name="config_dreamOpenAnimationDuration">250</integer> Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2078,6 +2078,7 @@ <java-symbol type="bool" name="config_keepDreamingWhenUnplugging" /> <java-symbol type="bool" name="config_glanceableHubEnabled" /> <java-symbol type="integer" name="config_whenToStartHubModeDefault" /> <java-symbol type="bool" name="config_onlyShowGlanceableHubWhenWirelessChargingDefault" /> <java-symbol type="integer" name="config_keyguardDrawnTimeout" /> <java-symbol type="bool" name="config_goToSleepOnButtonPressTheaterMode" /> <java-symbol type="bool" name="config_supportLongPressPowerWhenNonInteractive" /> Loading
packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java +14 −0 Original line number Diff line number Diff line Loading @@ -388,6 +388,20 @@ public class DreamBackend { Settings.Secure.SCREENSAVER_COMPLICATIONS_ENABLED, 1) == 1; } /** Set whether to restrict showing dreams to only when charging wirelessly. */ public void setRestrictToWirelessCharging(boolean restrict) { Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.SCREENSAVER_RESTRICT_TO_WIRELESS_CHARGING, restrict ? 1 : 0); } /** Get whether to restrict showing dreams to only when charging wirelessly. */ public boolean getRestrictToWirelessCharging() { return Settings.Secure.getInt( mContext.getContentResolver(), Settings.Secure.SCREENSAVER_RESTRICT_TO_WIRELESS_CHARGING, 0) == 1; } /** Gets all dream complications which are supported on this device. **/ public Set<Integer> getSupportedComplications() { return mSupportedComplications; Loading
packages/SettingsLib/tests/robotests/src/com/android/settingslib/dream/DreamBackendTest.java +17 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,23 @@ public final class DreamBackendTest { DreamBackend.WHILE_DOCKED); } @Test public void testSetRestrictedToWirelessCharging() { mBackend.setRestrictToWirelessCharging(true); assertThat(mBackend.getRestrictToWirelessCharging()).isTrue(); } @Test public void testGetRestrictedToWirelessCharging() { Settings.Secure.putInt( mContext.getContentResolver(), Settings.Secure.SCREENSAVER_RESTRICT_TO_WIRELESS_CHARGING, 1 ); assertThat(mBackend.getRestrictToWirelessCharging()).isTrue(); } private void setControlsEnabledOnLockscreen(boolean enabled) { Settings.Secure.putInt( mContext.getContentResolver(), Loading