diff options
| author | Michael Wright <michaelwr@google.com> | 2022-12-07 00:16:25 +0000 |
|---|---|---|
| committer | Rupesh Bansal <brup@google.com> | 2022-12-14 19:22:59 +0000 |
| commit | d7367c39c48b5a05482b49dbc5c67f8920f9aff6 (patch) | |
| tree | 88597d6aa051ee7b0c5e87e5fda44cd789e155fa /core/java/android/os/PowerManager.java | |
| parent | 4ee9f703bbc2800b8cefdbaba2adfd845f791509 (diff) | |
Sleep softly on device close.
Add a new flag GO_TO_SLEEP_FLAG_SOFT_SLEEP. When set, this sleeps the
device only if its user activity keeping it awake. If its otherwise
staying awake because an application is holding a wakelock, then the
device continues to stay awake.
Bug: 260705307
Test: atest PowerManagerServiceTest
Test: manual
Change-Id: I08b6dacf418d927b4f86816b1b6d19965e68556a
Diffstat (limited to 'core/java/android/os/PowerManager.java')
| -rw-r--r-- | core/java/android/os/PowerManager.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index a46868e93ab8..68e1acb374d2 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -523,6 +523,13 @@ public final class PowerManager { public static final int GO_TO_SLEEP_FLAG_NO_DOZE = 1 << 0; /** + * Go to sleep flag: Sleep softly, go to sleep only if there's no wakelock explicitly keeping + * the device awake. + * @hide + */ + public static final int GO_TO_SLEEP_FLAG_SOFT_SLEEP = 1 << 1; + + /** * @hide */ @IntDef(prefix = { "BRIGHTNESS_CONSTRAINT_TYPE" }, value = { |
