summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2014-08-21 21:56:02 -0700
committerJeff Brown <jeffbrown@google.com>2014-08-21 22:43:25 -0700
commit7d82751530db56841f7e767fe752abe5faa06e0c (patch)
tree70a68608df98ce7ad0a32f612ffdcba26fc8303d
parent0a571123544058578b4ef1558c276a4050519652 (diff)
downloadframeworks_base-7d82751530db56841f7e767fe752abe5faa06e0c.zip
frameworks_base-7d82751530db56841f7e767fe752abe5faa06e0c.tar.gz
frameworks_base-7d82751530db56841f7e767fe752abe5faa06e0c.tar.bz2
Hide PowerManager methods that third-party apps can't use.
Change-Id: I9c4dbdef913f68939eb29f2c250c5fe3afc67399
-rw-r--r--api/current.txt3
-rw-r--r--api/removed.txt10
-rw-r--r--core/java/android/os/PowerManager.java32
3 files changed, 39 insertions, 6 deletions
diff --git a/api/current.txt b/api/current.txt
index 46b3801..8a7ae00 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -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
diff --git a/api/removed.txt b/api/removed.txt
index 465a18d..93484de 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -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 {
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 4b206e3..f7b0ead 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -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);
@@ -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 {
@@ -606,6 +630,8 @@ public final class PowerManager {
*
* @see #userActivity
* @see #goToSleep
+ *
+ * @removed Requires signature permission.
*/
public void wakeUp(long time) {
try {
@@ -633,7 +659,7 @@ public final class PowerManager {
* @see #wakeUp
* @see #goToSleep
*
- * @hide
+ * @hide Requires signature permission.
*/
public void nap(long time) {
try {
@@ -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 {