Loading api/current.txt +0 −3 Original line number Diff line number Diff line Loading @@ -22465,15 +22465,12 @@ package android.os { } public final class PowerManager { method public void goToSleep(long); method public boolean isInteractive(); method public boolean isPowerSaveMode(); method public deprecated boolean isScreenOn(); method public boolean isWakeLockLevelSupported(int); method public android.os.PowerManager.WakeLock newWakeLock(int, java.lang.String); method public void reboot(java.lang.String); method public void userActivity(long, boolean); method public void wakeUp(long); field public static final int ACQUIRE_CAUSES_WAKEUP = 268435456; // 0x10000000 field public static final java.lang.String ACTION_POWER_SAVE_MODE_CHANGED = "android.os.action.POWER_SAVE_MODE_CHANGED"; field public static final deprecated int FULL_WAKE_LOCK = 26; // 0x1a api/removed.txt +10 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,16 @@ package android.media { } package android.os { public final class PowerManager { method public void goToSleep(long); method public deprecated void userActivity(long, boolean); method public void wakeUp(long); } } package android.view { public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable { Loading core/java/android/os/PowerManager.java +29 −3 Original line number Diff line number Diff line Loading @@ -521,7 +521,11 @@ public final class PowerManager { * * @see #wakeUp * @see #goToSleep * * @removed Requires signature or system permission. * @deprecated Use {@link #userActivity(long, int, int)}. */ @Deprecated public void userActivity(long when, boolean noChangeLights) { userActivity(when, USER_ACTIVITY_EVENT_OTHER, noChangeLights ? USER_ACTIVITY_FLAG_NO_CHANGE_LIGHTS : 0); Loading Loading @@ -575,13 +579,33 @@ public final class PowerManager { * * @see #userActivity * @see #wakeUp * * @removed Requires signature permission. */ public void goToSleep(long time) { goToSleep(time, GO_TO_SLEEP_REASON_APPLICATION, 0); } /** * @hide * Forces the device to go to sleep. * <p> * Overrides all the wake locks that are held. * This is what happens when the power key is pressed to turn off the screen. * </p><p> * Requires the {@link android.Manifest.permission#DEVICE_POWER} permission. * </p> * * @param time The time when the request to go to sleep was issued, in the * {@link SystemClock#uptimeMillis()} time base. This timestamp is used to correctly * order the go to sleep request with other power management functions. It should be set * to the timestamp of the input event that caused the request to go to sleep. * @param reason The reason the device is going to sleep. * @param flags Optional flags to apply when going to sleep. * * @see #userActivity * @see #wakeUp * * @hide Requires signature permission. */ public void goToSleep(long time, int reason, int flags) { try { Loading @@ -606,6 +630,8 @@ public final class PowerManager { * * @see #userActivity * @see #goToSleep * * @removed Requires signature permission. */ public void wakeUp(long time) { try { Loading Loading @@ -633,7 +659,7 @@ public final class PowerManager { * @see #wakeUp * @see #goToSleep * * @hide * @hide Requires signature permission. */ public void nap(long time) { try { Loading @@ -650,7 +676,7 @@ public final class PowerManager { * * @param brightness The brightness value from 0 to 255. * * {@hide} * @hide Requires signature permission. */ public void setBacklightBrightness(int brightness) { try { Loading Loading
api/current.txt +0 −3 Original line number Diff line number Diff line Loading @@ -22465,15 +22465,12 @@ package android.os { } public final class PowerManager { method public void goToSleep(long); method public boolean isInteractive(); method public boolean isPowerSaveMode(); method public deprecated boolean isScreenOn(); method public boolean isWakeLockLevelSupported(int); method public android.os.PowerManager.WakeLock newWakeLock(int, java.lang.String); method public void reboot(java.lang.String); method public void userActivity(long, boolean); method public void wakeUp(long); field public static final int ACQUIRE_CAUSES_WAKEUP = 268435456; // 0x10000000 field public static final java.lang.String ACTION_POWER_SAVE_MODE_CHANGED = "android.os.action.POWER_SAVE_MODE_CHANGED"; field public static final deprecated int FULL_WAKE_LOCK = 26; // 0x1a
api/removed.txt +10 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,16 @@ package android.media { } package android.os { public final class PowerManager { method public void goToSleep(long); method public deprecated void userActivity(long, boolean); method public void wakeUp(long); } } package android.view { public static class WindowManager.LayoutParams extends android.view.ViewGroup.LayoutParams implements android.os.Parcelable { Loading
core/java/android/os/PowerManager.java +29 −3 Original line number Diff line number Diff line Loading @@ -521,7 +521,11 @@ public final class PowerManager { * * @see #wakeUp * @see #goToSleep * * @removed Requires signature or system permission. * @deprecated Use {@link #userActivity(long, int, int)}. */ @Deprecated public void userActivity(long when, boolean noChangeLights) { userActivity(when, USER_ACTIVITY_EVENT_OTHER, noChangeLights ? USER_ACTIVITY_FLAG_NO_CHANGE_LIGHTS : 0); Loading Loading @@ -575,13 +579,33 @@ public final class PowerManager { * * @see #userActivity * @see #wakeUp * * @removed Requires signature permission. */ public void goToSleep(long time) { goToSleep(time, GO_TO_SLEEP_REASON_APPLICATION, 0); } /** * @hide * Forces the device to go to sleep. * <p> * Overrides all the wake locks that are held. * This is what happens when the power key is pressed to turn off the screen. * </p><p> * Requires the {@link android.Manifest.permission#DEVICE_POWER} permission. * </p> * * @param time The time when the request to go to sleep was issued, in the * {@link SystemClock#uptimeMillis()} time base. This timestamp is used to correctly * order the go to sleep request with other power management functions. It should be set * to the timestamp of the input event that caused the request to go to sleep. * @param reason The reason the device is going to sleep. * @param flags Optional flags to apply when going to sleep. * * @see #userActivity * @see #wakeUp * * @hide Requires signature permission. */ public void goToSleep(long time, int reason, int flags) { try { Loading @@ -606,6 +630,8 @@ public final class PowerManager { * * @see #userActivity * @see #goToSleep * * @removed Requires signature permission. */ public void wakeUp(long time) { try { Loading Loading @@ -633,7 +659,7 @@ public final class PowerManager { * @see #wakeUp * @see #goToSleep * * @hide * @hide Requires signature permission. */ public void nap(long time) { try { Loading @@ -650,7 +676,7 @@ public final class PowerManager { * * @param brightness The brightness value from 0 to 255. * * {@hide} * @hide Requires signature permission. */ public void setBacklightBrightness(int brightness) { try { Loading