Loading core/java/com/android/internal/hardware/AmbientDisplayConfiguration.java +13 −3 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.internal.R; import android.content.Context; import android.os.Build; import android.os.SystemProperties; import android.provider.Settings; import android.text.TextUtils; Loading Loading @@ -75,13 +76,13 @@ public class AmbientDisplayConfiguration { } public boolean alwaysOnEnabled(int user) { return boolSettingDefaultOff(Settings.Secure.DOZE_ALWAYS_ON, user) return boolSettingDefaultOn(Settings.Secure.DOZE_ALWAYS_ON, user) && alwaysOnAvailable(); } public boolean alwaysOnAvailable() { // TODO: introduce config_dozeAlwaysOnAvailable. For now just debuggable builds. return Build.IS_DEBUGGABLE && ambientDisplayAvailable(); return (alwaysOnDisplayDebuggingEnabled() || alwaysOnDisplayAvailable()) && ambientDisplayAvailable(); } public String ambientDisplayComponent() { Loading @@ -92,6 +93,15 @@ public class AmbientDisplayConfiguration { return !TextUtils.isEmpty(ambientDisplayComponent()); } private boolean alwaysOnDisplayAvailable() { return mContext.getResources().getBoolean(R.bool.config_dozeAlwaysOnDisplayAvailable); } private boolean alwaysOnDisplayDebuggingEnabled() { return SystemProperties.getBoolean("debug.doze.aod", false) && Build.IS_DEBUGGABLE; } private boolean boolSettingDefaultOn(String name, int user) { return boolSetting(name, user, 1); } Loading core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -1825,6 +1825,11 @@ <!-- Type of the double tap sensor. Empty if double tap is not supported. --> <string name="config_dozeDoubleTapSensorType" translatable="false"></string> <!-- Control whether the always on display mode is available. This should only be enabled on devices where the display has be tuned to be power efficient in DOZE and/or DOZE_SUSPEND states. --> <bool name="config_dozeAlwaysOnDisplayAvailable">false</bool> <!-- Power Management: Specifies whether to decouple the auto-suspend state of the device from the display on/off state. Loading core/res/res/values/symbols.xml +2 −4 Original line number Diff line number Diff line Loading @@ -2998,13 +2998,9 @@ <!-- ETWS primary messages --> <java-symbol type="string" name="etws_primary_default_message_earthquake" /> <java-symbol type="string" name="etws_primary_default_message_tsunami" /> <java-symbol type="string" name="etws_primary_default_message_earthquake_and_tsunami" /> <java-symbol type="string" name="etws_primary_default_message_test" /> <java-symbol type="string" name="etws_primary_default_message_others" /> <java-symbol type="bool" name="config_quickSettingsSupported" /> Loading Loading @@ -3032,4 +3028,6 @@ <java-symbol type="bool" name="config_handleVolumeKeysInWindowManager" /> <java-symbol type="integer" name="config_inCallNotificationVolumeRelative" /> <java-symbol type="bool" name="config_dozeAlwaysOnDisplayAvailable" /> </resources> packages/SystemUI/res/xml/tuner_prefs.xml +1 −1 Original line number Diff line number Diff line Loading @@ -146,7 +146,7 @@ <com.android.systemui.tuner.TunerSwitch android:key="doze_always_on" android:title="@string/tuner_doze_always_on" sysui:defValue="false" /> sysui:defValue="true" /> </PreferenceScreen> Loading packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.systemui.doze; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import android.os.UserHandle; import android.provider.Settings; Loading @@ -42,7 +42,7 @@ public class DozeConfigurationTest extends SysuiTestCase { } @Test public void alwaysOn_offByDefault() throws Exception { public void alwaysOn_onByDefault() throws Exception { if (!mDozeConfig.alwaysOnAvailable()) { return; } Loading @@ -50,6 +50,6 @@ public class DozeConfigurationTest extends SysuiTestCase { Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.DOZE_ALWAYS_ON, null); assertFalse(mDozeConfig.alwaysOnEnabled(UserHandle.USER_CURRENT)); assertTrue(mDozeConfig.alwaysOnEnabled(UserHandle.USER_CURRENT)); } } Loading
core/java/com/android/internal/hardware/AmbientDisplayConfiguration.java +13 −3 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.internal.R; import android.content.Context; import android.os.Build; import android.os.SystemProperties; import android.provider.Settings; import android.text.TextUtils; Loading Loading @@ -75,13 +76,13 @@ public class AmbientDisplayConfiguration { } public boolean alwaysOnEnabled(int user) { return boolSettingDefaultOff(Settings.Secure.DOZE_ALWAYS_ON, user) return boolSettingDefaultOn(Settings.Secure.DOZE_ALWAYS_ON, user) && alwaysOnAvailable(); } public boolean alwaysOnAvailable() { // TODO: introduce config_dozeAlwaysOnAvailable. For now just debuggable builds. return Build.IS_DEBUGGABLE && ambientDisplayAvailable(); return (alwaysOnDisplayDebuggingEnabled() || alwaysOnDisplayAvailable()) && ambientDisplayAvailable(); } public String ambientDisplayComponent() { Loading @@ -92,6 +93,15 @@ public class AmbientDisplayConfiguration { return !TextUtils.isEmpty(ambientDisplayComponent()); } private boolean alwaysOnDisplayAvailable() { return mContext.getResources().getBoolean(R.bool.config_dozeAlwaysOnDisplayAvailable); } private boolean alwaysOnDisplayDebuggingEnabled() { return SystemProperties.getBoolean("debug.doze.aod", false) && Build.IS_DEBUGGABLE; } private boolean boolSettingDefaultOn(String name, int user) { return boolSetting(name, user, 1); } Loading
core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -1825,6 +1825,11 @@ <!-- Type of the double tap sensor. Empty if double tap is not supported. --> <string name="config_dozeDoubleTapSensorType" translatable="false"></string> <!-- Control whether the always on display mode is available. This should only be enabled on devices where the display has be tuned to be power efficient in DOZE and/or DOZE_SUSPEND states. --> <bool name="config_dozeAlwaysOnDisplayAvailable">false</bool> <!-- Power Management: Specifies whether to decouple the auto-suspend state of the device from the display on/off state. Loading
core/res/res/values/symbols.xml +2 −4 Original line number Diff line number Diff line Loading @@ -2998,13 +2998,9 @@ <!-- ETWS primary messages --> <java-symbol type="string" name="etws_primary_default_message_earthquake" /> <java-symbol type="string" name="etws_primary_default_message_tsunami" /> <java-symbol type="string" name="etws_primary_default_message_earthquake_and_tsunami" /> <java-symbol type="string" name="etws_primary_default_message_test" /> <java-symbol type="string" name="etws_primary_default_message_others" /> <java-symbol type="bool" name="config_quickSettingsSupported" /> Loading Loading @@ -3032,4 +3028,6 @@ <java-symbol type="bool" name="config_handleVolumeKeysInWindowManager" /> <java-symbol type="integer" name="config_inCallNotificationVolumeRelative" /> <java-symbol type="bool" name="config_dozeAlwaysOnDisplayAvailable" /> </resources>
packages/SystemUI/res/xml/tuner_prefs.xml +1 −1 Original line number Diff line number Diff line Loading @@ -146,7 +146,7 @@ <com.android.systemui.tuner.TunerSwitch android:key="doze_always_on" android:title="@string/tuner_doze_always_on" sysui:defValue="false" /> sysui:defValue="true" /> </PreferenceScreen> Loading
packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.systemui.doze; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import android.os.UserHandle; import android.provider.Settings; Loading @@ -42,7 +42,7 @@ public class DozeConfigurationTest extends SysuiTestCase { } @Test public void alwaysOn_offByDefault() throws Exception { public void alwaysOn_onByDefault() throws Exception { if (!mDozeConfig.alwaysOnAvailable()) { return; } Loading @@ -50,6 +50,6 @@ public class DozeConfigurationTest extends SysuiTestCase { Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.DOZE_ALWAYS_ON, null); assertFalse(mDozeConfig.alwaysOnEnabled(UserHandle.USER_CURRENT)); assertTrue(mDozeConfig.alwaysOnEnabled(UserHandle.USER_CURRENT)); } }