diff options
| author | Nick Armstrong-Crews <strongarm@google.com> | 2015-08-27 13:53:25 -0700 |
|---|---|---|
| committer | Nick Armstrong-Crews <strongarm@google.com> | 2015-09-04 10:20:22 -0700 |
| commit | 677adf1e66ba83b8fb2c849c181303b35bd489bc (patch) | |
| tree | c2043f8b554c552d3482dca596402ddc7cc3e219 /core/java/android/view/KeyEvent.java | |
| parent | 38ae119688f94d68c42d8d29958038e37bb74915 (diff) | |
Handle KEYCODE_SOFT_SLEEP from Ungaze.
Needed for Ungaze to trigger "soft sleep" (respecting wake locks); operates by
sending new KEYCODE_SOFT_SLEEP to PhoneWindowManager, which calls
PowerManagerService's new method setUserInactiveOverride (thereby
causing immediate sleep, modulo wakelocks, upon next iteration of
PowerManagerService's main loop).
BUG: b/23589870
Change-Id: I24a96bd6db8ff28674c907f2898e49c4f6140209
Diffstat (limited to 'core/java/android/view/KeyEvent.java')
| -rw-r--r-- | core/java/android/view/KeyEvent.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index 52852e7b6e97..2bd319c0ba80 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -784,8 +784,10 @@ public class KeyEvent extends InputEvent implements Parcelable { /** Key code constant: Step backward media key. * Steps media backward, one frame at a time. */ public static final int KEYCODE_MEDIA_STEP_BACKWARD = 275; + /** Key code constant: put device to sleep unless a wakelock is held. */ + public static final int KEYCODE_SOFT_SLEEP = 276; - private static final int LAST_KEYCODE = KEYCODE_MEDIA_STEP_BACKWARD; + private static final int LAST_KEYCODE = KEYCODE_SOFT_SLEEP; // NOTE: If you add a new keycode here you must also add it to: // isSystem() |
