summaryrefslogtreecommitdiffstats
path: root/core/java/android/os
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2014-08-13 18:52:25 -0700
committerJeff Brown <jeffbrown@google.com>2014-08-14 01:56:48 +0000
commitc12035cd40d01b032013f515cb509e6c8791cf65 (patch)
tree1efaf8e59d104d4bda6f7b2dd7c20c4ab64ddd9e /core/java/android/os
parente2c83c97fb4224c2743ff10fd28bf6efcbd32f74 (diff)
downloadframeworks_base-c12035cd40d01b032013f515cb509e6c8791cf65.zip
frameworks_base-c12035cd40d01b032013f515cb509e6c8791cf65.tar.gz
frameworks_base-c12035cd40d01b032013f515cb509e6c8791cf65.tar.bz2
Log who is calling goToSleep().
Change-Id: Ibae61c90ee115735835e878bb3bf79eedaa0ae44
Diffstat (limited to 'core/java/android/os')
-rw-r--r--core/java/android/os/PowerManager.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 6334f76..8405401 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -298,10 +298,10 @@ public final class PowerManager {
public static final int USER_ACTIVITY_FLAG_NO_CHANGE_LIGHTS = 1 << 0;
/**
- * Go to sleep reason code: Going to sleep due by user request.
+ * Go to sleep reason code: Going to sleep due by application request.
* @hide
*/
- public static final int GO_TO_SLEEP_REASON_USER = 0;
+ public static final int GO_TO_SLEEP_REASON_APPLICATION = 0;
/**
* Go to sleep reason code: Going to sleep due by request of the
@@ -317,6 +317,24 @@ public final class PowerManager {
public static final int GO_TO_SLEEP_REASON_TIMEOUT = 2;
/**
+ * Go to sleep reason code: Going to sleep due to the lid switch being closed.
+ * @hide
+ */
+ public static final int GO_TO_SLEEP_REASON_LID_SWITCH = 3;
+
+ /**
+ * Go to sleep reason code: Going to sleep due to the power button being pressed.
+ * @hide
+ */
+ public static final int GO_TO_SLEEP_REASON_POWER_BUTTON = 4;
+
+ /**
+ * Go to sleep reason code: Going to sleep due to HDMI.
+ * @hide
+ */
+ public static final int GO_TO_SLEEP_REASON_HDMI = 5;
+
+ /**
* The value to pass as the 'reason' argument to reboot() to
* reboot into recovery mode (for applying system updates, doing
* factory resets, etc.).
@@ -513,7 +531,7 @@ public final class PowerManager {
* @see #wakeUp
*/
public void goToSleep(long time) {
- goToSleep(time, GO_TO_SLEEP_REASON_USER, 0);
+ goToSleep(time, GO_TO_SLEEP_REASON_APPLICATION, 0);
}
/**