summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alex Salo <asalo@google.com> 2019-01-18 14:17:20 -0800
committer Alex Salo <asalo@google.com> 2019-01-21 14:39:29 -0800
commit1dea1e65030098e973f33f9f61014155b7cfc3f1 (patch)
tree1222662c71733152d21db602c8a6f9f2cd37591a
parent23258296945d1718fda835c0fa05a85e8cd8aa91 (diff)
Add ADAPTIVE_SLEEP setting
Test: make RunSettingsRoboTests Bug: 111939367 Change-Id: I92f78cd8730d94444024cdce24ddadee24f79176
-rw-r--r--core/java/android/provider/Settings.java11
-rw-r--r--core/res/res/values/config.xml3
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--proto/src/metrics_constants/metrics_constants.proto4
4 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index d5de13c40194..7367535533d3 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3300,6 +3300,14 @@ public final class Settings {
public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
/**
+ * Control whether to enable adaptive sleep mode.
+ * @hide
+ */
+ public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
+
+ private static final Validator ADAPTIVE_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR;
+
+ /**
* Control whether the process CPU usage meter should be shown.
*
* @deprecated This functionality is no longer available as of
@@ -4232,6 +4240,7 @@ public final class Settings {
SCREEN_BRIGHTNESS_MODE,
SCREEN_AUTO_BRIGHTNESS_ADJ,
SCREEN_BRIGHTNESS_FOR_VR,
+ ADAPTIVE_SLEEP,
VIBRATE_INPUT_DEVICES,
MODE_RINGER_STREAMS_AFFECTED,
TEXT_AUTO_REPLACE,
@@ -4307,6 +4316,7 @@ public final class Settings {
PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
+ PUBLIC_SETTINGS.add(ADAPTIVE_SLEEP);
PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
PUBLIC_SETTINGS.add(VIBRATE_ON);
@@ -4411,6 +4421,7 @@ public final class Settings {
VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
+ VALIDATORS.put(ADAPTIVE_SLEEP, ADAPTIVE_SLEEP_VALIDATOR);
VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 5995640c7659..c4776422a7b5 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -705,6 +705,9 @@
Software implementation will be used if config_hardware_auto_brightness_available is not set -->
<bool name="config_automatic_brightness_available">false</bool>
+ <!-- Flag indicating whether we should enable the adaptive sleep.-->
+ <bool name="config_adaptive_sleep_available">false</bool>
+
<!-- Flag indicating whether we should enable smart battery. -->
<bool name="config_smart_battery_available">false</bool>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 53c33a3855dd..6ce7e9b9114f 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1845,6 +1845,7 @@
<java-symbol type="array" name="config_defaultNotificationVibePattern" />
<java-symbol type="array" name="config_notificationFallbackVibePattern" />
<java-symbol type="bool" name="config_useAttentionLight" />
+ <java-symbol type="bool" name="config_adaptive_sleep_available" />
<java-symbol type="bool" name="config_animateScreenLights" />
<java-symbol type="bool" name="config_automatic_brightness_available" />
<java-symbol type="bool" name="config_smart_battery_available" />
diff --git a/proto/src/metrics_constants/metrics_constants.proto b/proto/src/metrics_constants/metrics_constants.proto
index 8261fe89f778..f56320f5d2d5 100644
--- a/proto/src/metrics_constants/metrics_constants.proto
+++ b/proto/src/metrics_constants/metrics_constants.proto
@@ -6820,6 +6820,10 @@ message MetricsEvent {
// OS: Q
MOBILE_NETWORK_LIST = 1627;
+ // OPEN: Settings > Display > Adaptive sleep
+ // OS: Q
+ SETTINGS_ADAPTIVE_SLEEP = 1628;
+
// ---- End Q Constants, all Q constants go above this line ----
// Add new aosp constants above this line.
// END OF AOSP CONSTANTS