diff options
author | Jeff Brown <jeffbrown@google.com> | 2014-09-30 20:54:30 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2014-10-01 15:01:10 -0700 |
commit | 05af6adb8d4fd5ea069c9aead5a877da9085daa8 (patch) | |
tree | cb9331ddd75e62406ef56874bd3f3d01f5ef3bcc /core/java/android/provider | |
parent | 496aeb1a6156f3c089135a7ce4fab550589eaff7 (diff) | |
download | frameworks_base-05af6adb8d4fd5ea069c9aead5a877da9085daa8.zip frameworks_base-05af6adb8d4fd5ea069c9aead5a877da9085daa8.tar.gz frameworks_base-05af6adb8d4fd5ea069c9aead5a877da9085daa8.tar.bz2 |
Implement auto-sleep functionality.
Added a new SLEEP_TIMEOUT setting which governs how long the device will
remain awake or dreaming without user activity. By default this
value is set to -1 which maintains today's existing behavior.
We basically represent the time we are allowed to be dreaming as a new
kind of user activity summary state called DREAM, similar to BRIGHT
and DIM. When the sleep timeout expires, the state is cleared and
the dream ends.
Bug: 17665809
Change-Id: I59aa7648dcec215f1285464fc1134934a09230e5
Diffstat (limited to 'core/java/android/provider')
-rw-r--r-- | core/java/android/provider/Settings.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index ec4a53e..e40c88f 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -2001,7 +2001,10 @@ public final class Settings { public static final String DIM_SCREEN = "dim_screen"; /** - * The timeout before the screen turns off. + * The amount of time in milliseconds before the device goes to sleep or begins + * to dream after a period of inactivity. This value is also known as the + * user activity timeout period since the screen isn't necessarily turned off + * when it expires. */ public static final String SCREEN_OFF_TIMEOUT = "screen_off_timeout"; @@ -4817,6 +4820,20 @@ public final class Settings { "usb_audio_automatic_routing_disabled"; /** + * The timeout in milliseconds before the device fully goes to sleep after + * a period of inactivity. This value sets an upper bound on how long the device + * will stay awake or dreaming without user activity. It should generally + * be longer than {@link #SCREEN_OFF_TIMEOUT} as otherwise the device + * will sleep before it ever has a chance to dream. + * <p> + * Use -1 to disable this timeout. + * </p> + * + * @hide + */ + public static final String SLEEP_TIMEOUT = "sleep_timeout"; + + /** * This are the settings to be backed up. * * NOTE: Settings are backed up and restored in the order they appear @@ -4865,7 +4882,8 @@ public final class Settings { MOUNT_UMS_AUTOSTART, MOUNT_UMS_PROMPT, MOUNT_UMS_NOTIFY_ENABLED, - UI_NIGHT_MODE + UI_NIGHT_MODE, + SLEEP_TIMEOUT }; /** |