Change constant to PowerManager#FLAG_WAIT_FOR_DISTANT_PROXIMITY
Also add docs to PowerManager.WakeLock#release(int) Bug: 17290118 Change-Id: Ibcbc4279efdd0f275808042356e6ff843958e23f
This commit is contained in:
@@ -22471,7 +22471,7 @@ package android.os {
|
||||
field public static final int PROXIMITY_SCREEN_OFF_WAKE_LOCK = 32; // 0x20
|
||||
field public static final deprecated int SCREEN_BRIGHT_WAKE_LOCK = 10; // 0xa
|
||||
field public static final deprecated int SCREEN_DIM_WAKE_LOCK = 6; // 0x6
|
||||
field public static final int WAIT_FOR_PROXIMITY_NEGATIVE = 1; // 0x1
|
||||
field public static final int WAIT_FOR_DISTANT_PROXIMITY = 1; // 0x1
|
||||
}
|
||||
|
||||
public final class PowerManager.WakeLock {
|
||||
|
||||
@@ -248,7 +248,7 @@ public final class PowerManager {
|
||||
* {@link #PROXIMITY_SCREEN_OFF_WAKE_LOCK} wake lock until the proximity sensor
|
||||
* indicates that an object is not in close proximity.
|
||||
*/
|
||||
public static final int WAIT_FOR_PROXIMITY_NEGATIVE = 1;
|
||||
public static final int WAIT_FOR_DISTANT_PROXIMITY = 1;
|
||||
|
||||
/**
|
||||
* Brightness value for fully on.
|
||||
@@ -961,7 +961,8 @@ public final class PowerManager {
|
||||
* </p>
|
||||
*
|
||||
* @param flags Combination of flag values to modify the release behavior.
|
||||
* Currently only {@link #WAIT_FOR_PROXIMITY_NEGATIVE} is supported.
|
||||
* Currently only {@link #WAIT_FOR_DISTANT_PROXIMITY} is supported. Passing 0 is
|
||||
* equivalent to calling {@link #release()}.
|
||||
*/
|
||||
public void release(int flags) {
|
||||
synchronized (mToken) {
|
||||
|
||||
@@ -821,7 +821,7 @@ public final class PowerManagerService extends com.android.server.SystemService
|
||||
+ " [" + wakeLock.mTag + "], flags=0x" + Integer.toHexString(flags));
|
||||
}
|
||||
|
||||
if ((flags & PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE) != 0) {
|
||||
if ((flags & PowerManager.WAIT_FOR_DISTANT_PROXIMITY) != 0) {
|
||||
mRequestWaitForNegativeProximity = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,9 +77,9 @@ public class PowerTest extends TestActivity
|
||||
mProx.release();
|
||||
}
|
||||
},
|
||||
new Test("Disable proximity (WAIT_FOR_PROXIMITY_NEGATIVE)") {
|
||||
new Test("Disable proximity (WAIT_FOR_DISTANT_PROXIMITY") {
|
||||
public void run() {
|
||||
mProx.release(PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE);
|
||||
mProx.release(PowerManager.WAIT_FOR_DISTANT_PROXIMITY);
|
||||
}
|
||||
},
|
||||
new Test("Enable proximity, wait 5 seconds then disable") {
|
||||
@@ -93,13 +93,13 @@ public class PowerTest extends TestActivity
|
||||
}, 5000);
|
||||
}
|
||||
},
|
||||
new Test("Enable proximity, wait 5 seconds then disable (WAIT_FOR_PROXIMITY_NEGATIVE)") {
|
||||
new Test("Enable proximity, wait 5 seconds then disable (WAIT_FOR_DISTANT_PROXIMITY)") {
|
||||
public void run() {
|
||||
mProx.acquire();
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mProx.release(PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE);
|
||||
mProx.release(PowerManager.WAIT_FOR_DISTANT_PROXIMITY);
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user