diff options
| author | 2022-02-23 15:56:07 +0000 | |
|---|---|---|
| committer | 2022-02-23 15:56:07 +0000 | |
| commit | eefc676fd251314442ee82bd453099423ada98f3 (patch) | |
| tree | a417016d7e649a166443eb387d8944ec5140b420 | |
| parent | 8045e6c8b7ee6338c22359c2cd2aebb5d2444333 (diff) | |
| parent | 1c82568b6c14b91ae8cadd40cb71a328583da4b6 (diff) | |
Merge "Deprecate ACQUIRE_CAUSES_WAKEUP flag." into tm-dev
| -rw-r--r-- | core/api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/os/PowerManager.java | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 78711086e2c8..77efa4d39c44 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -31798,7 +31798,7 @@ package android.os { method public android.os.PowerManager.WakeLock newWakeLock(int, String); method @RequiresPermission(android.Manifest.permission.REBOOT) public void reboot(@Nullable String); method public void removeThermalStatusListener(@NonNull android.os.PowerManager.OnThermalStatusChangedListener); - field public static final int ACQUIRE_CAUSES_WAKEUP = 268435456; // 0x10000000 + field @Deprecated public static final int ACQUIRE_CAUSES_WAKEUP = 268435456; // 0x10000000 field public static final String ACTION_DEVICE_IDLE_MODE_CHANGED = "android.os.action.DEVICE_IDLE_MODE_CHANGED"; field public static final String ACTION_DEVICE_LIGHT_IDLE_MODE_CHANGED = "android.os.action.LIGHT_DEVICE_IDLE_MODE_CHANGED"; field public static final String ACTION_LOW_POWER_STANDBY_ENABLED_CHANGED = "android.os.action.LOW_POWER_STANDBY_ENABLED_CHANGED"; diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index 315eef78724e..e3be4d32a014 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -183,25 +183,29 @@ public final class PowerManager { /** * Wake lock flag: Turn the screen on when the wake lock is acquired. * <p> - * Normally wake locks don't actually wake the device, they just cause - * the screen to remain on once it's already on. Think of the video player - * application as the normal behavior. Notifications that pop up and want - * the device to be on are the exception; use this flag to be like them. + * Normally wake locks don't actually wake the device, they just cause the screen to remain on + * once it's already on. This flag will cause the device to wake up when the wake lock is + * acquired. * </p><p> * Android TV playback devices attempt to turn on the HDMI-connected TV via HDMI-CEC on any * wake-up, including wake-ups triggered by wake locks. * </p><p> * Cannot be used with {@link #PARTIAL_WAKE_LOCK}. * </p> + * + * @deprecated Most applications should use {@link android.R.attr#turnScreenOn} or + * {@link android.app.Activity#setTurnScreenOn(boolean)} instead, as this prevents the previous + * foreground app from being resumed first when the screen turns on. Note that this flag may + * require a permission in the future. */ + @Deprecated public static final int ACQUIRE_CAUSES_WAKEUP = 0x10000000; /** * Wake lock flag: When this wake lock is released, poke the user activity timer * so the screen stays on for a little longer. * <p> - * Will not turn the screen on if it is not already on. - * See {@link #ACQUIRE_CAUSES_WAKEUP} if you want that. + * This will not turn the screen on if it is not already on. * </p><p> * Cannot be used with {@link #PARTIAL_WAKE_LOCK}. * </p> |