summaryrefslogtreecommitdiffstats
path: root/core/java/android/os
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/os')
-rw-r--r--core/java/android/os/IPowerManager.aidl2
-rw-r--r--core/java/android/os/PowerManager.java15
2 files changed, 15 insertions, 2 deletions
diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl
index 92af1a5..e7330bb 100644
--- a/core/java/android/os/IPowerManager.aidl
+++ b/core/java/android/os/IPowerManager.aidl
@@ -35,7 +35,7 @@ interface IPowerManager
void userActivity(long time, int event, int flags);
void wakeUp(long time);
- void goToSleep(long time, int reason);
+ void goToSleep(long time, int reason, int flags);
void nap(long time);
boolean isInteractive();
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 646bfef..96cfa29 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -302,6 +302,12 @@ public final class PowerManager {
*/
public static final int GO_TO_SLEEP_REASON_TIMEOUT = 2;
+ /**
+ * Go to sleep flag: Skip dozing state and directly go to full sleep.
+ * @hide
+ */
+ public static final int GO_TO_SLEEP_FLAG_NO_DOZE = 1 << 0;
+
final Context mContext;
final IPowerManager mService;
final Handler mHandler;
@@ -490,8 +496,15 @@ public final class PowerManager {
* @see #wakeUp
*/
public void goToSleep(long time) {
+ goToSleep(time, GO_TO_SLEEP_REASON_USER, 0);
+ }
+
+ /**
+ * @hide
+ */
+ public void goToSleep(long time, int reason, int flags) {
try {
- mService.goToSleep(time, GO_TO_SLEEP_REASON_USER);
+ mService.goToSleep(time, reason, flags);
} catch (RemoteException e) {
}
}