diff options
author | Michael Wright <michaelwr@google.com> | 2015-09-16 23:19:26 +0100 |
---|---|---|
committer | Tim Murray <timmurray@google.com> | 2015-09-17 00:18:13 +0000 |
commit | a4d22d718affbc7145d1012157feb819557b5c06 (patch) | |
tree | ced2beb0037ee1b354b367144cddf120d4c13978 /core/java/android/os/PowerManagerInternal.java | |
parent | 6b04e3a6ea042be0e012f7501fadb461b3d772a7 (diff) | |
download | frameworks_base-a4d22d718affbc7145d1012157feb819557b5c06.zip frameworks_base-a4d22d718affbc7145d1012157feb819557b5c06.tar.gz frameworks_base-a4d22d718affbc7145d1012157feb819557b5c06.tar.bz2 |
Send power hint on fling gestures.
Use the existing PointerEventListener infrastructure to listen for
gestures that look like flings and hint to the power system when they
happen. Since we don't actually have a bound for the fling like a
regular application would, limit them to five seconds and refresh
every time a new fling is seen until the five second time period is
up.
bug 24059298
Change-Id: I5757a1e88f2ab2ef08cccefa8221d809ae71bb6f
Diffstat (limited to 'core/java/android/os/PowerManagerInternal.java')
-rw-r--r-- | core/java/android/os/PowerManagerInternal.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/os/PowerManagerInternal.java b/core/java/android/os/PowerManagerInternal.java index e742f98..17bce30 100644 --- a/core/java/android/os/PowerManagerInternal.java +++ b/core/java/android/os/PowerManagerInternal.java @@ -53,6 +53,15 @@ public abstract class PowerManagerInternal { */ public static final int WAKEFULNESS_DOZING = 3; + + /** + * Power hint: The user is interacting with the device. The corresponding data field must be + * the expected duration of the fling, or 0 if unknown. + * + * This must be kept in sync with the values in hardware/libhardware/include/hardware/power.h + */ + public static final int POWER_HINT_INTERACTION = 2; + public static String wakefulnessToString(int wakefulness) { switch (wakefulness) { case WAKEFULNESS_ASLEEP: @@ -142,4 +151,6 @@ public abstract class PowerManagerInternal { public abstract void updateUidProcState(int uid, int procState); public abstract void uidGone(int uid); + + public abstract void powerHint(int hintId, int data); } |