Change constant to PowerManager.RELEAES_FLAG_WAIT_FOR_NO_PROXIMITY
Bug: 17290118 Change-Id: Iae3866bf3f7ac24f756ec4c183e848a79d1f779b
This commit is contained in:
@@ -22250,9 +22250,9 @@ package android.os {
|
||||
field public static final int ON_AFTER_RELEASE = 536870912; // 0x20000000
|
||||
field public static final int PARTIAL_WAKE_LOCK = 1; // 0x1
|
||||
field public static final int PROXIMITY_SCREEN_OFF_WAKE_LOCK = 32; // 0x20
|
||||
field public static final int RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY = 1; // 0x1
|
||||
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_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_DISTANT_PROXIMITY = 1;
|
||||
public static final int RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY = 1;
|
||||
|
||||
/**
|
||||
* Brightness value for fully on.
|
||||
@@ -961,8 +961,8 @@ public final class PowerManager {
|
||||
* </p>
|
||||
*
|
||||
* @param flags Combination of flag values to modify the release behavior.
|
||||
* Currently only {@link #WAIT_FOR_DISTANT_PROXIMITY} is supported. Passing 0 is
|
||||
* equivalent to calling {@link #release()}.
|
||||
* Currently only {@link #RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY} is supported.
|
||||
* Passing 0 is equivalent to calling {@link #release()}.
|
||||
*/
|
||||
public void release(int flags) {
|
||||
synchronized (mToken) {
|
||||
|
||||
@@ -814,7 +814,7 @@ public final class PowerManagerService extends com.android.server.SystemService
|
||||
+ " [" + wakeLock.mTag + "], flags=0x" + Integer.toHexString(flags));
|
||||
}
|
||||
|
||||
if ((flags & PowerManager.WAIT_FOR_DISTANT_PROXIMITY) != 0) {
|
||||
if ((flags & PowerManager.RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY) != 0) {
|
||||
mRequestWaitForNegativeProximity = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,9 +77,9 @@ public class PowerTest extends TestActivity
|
||||
mProx.release();
|
||||
}
|
||||
},
|
||||
new Test("Disable proximity (WAIT_FOR_DISTANT_PROXIMITY") {
|
||||
new Test("Disable proximity (RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY") {
|
||||
public void run() {
|
||||
mProx.release(PowerManager.WAIT_FOR_DISTANT_PROXIMITY);
|
||||
mProx.release(PowerManager.RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY);
|
||||
}
|
||||
},
|
||||
new Test("Enable proximity, wait 5 seconds then disable") {
|
||||
@@ -93,13 +93,14 @@ public class PowerTest extends TestActivity
|
||||
}, 5000);
|
||||
}
|
||||
},
|
||||
new Test("Enable proximity, wait 5 seconds then disable (WAIT_FOR_DISTANT_PROXIMITY)") {
|
||||
new Test("Enable proximity, wait 5 seconds then disable " +
|
||||
"(RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY)") {
|
||||
public void run() {
|
||||
mProx.acquire();
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mProx.release(PowerManager.WAIT_FOR_DISTANT_PROXIMITY);
|
||||
mProx.release(PowerManager.RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY);
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user