From 1208e2718daeae538dc89c37198092ccb32798a2 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Mon, 8 Sep 2014 19:57:50 -0700 Subject: [PATCH] Change constant to PowerManager.RELEAES_FLAG_WAIT_FOR_NO_PROXIMITY Bug: 17290118 Change-Id: Iae3866bf3f7ac24f756ec4c183e848a79d1f779b --- api/current.txt | 2 +- core/java/android/os/PowerManager.java | 6 +++--- .../com/android/server/power/PowerManagerService.java | 2 +- .../src/com/android/statusbartest/PowerTest.java | 9 +++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/api/current.txt b/api/current.txt index a7cfd0bab0063..87a7dd4bbaab0 100644 --- a/api/current.txt +++ b/api/current.txt @@ -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 { diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index 00e2e2207305d..18b208255cb29 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -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 { *

* * @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) { diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index 78088004fe2ad..0a4b3bcc593e0 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -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; } diff --git a/tests/StatusBar/src/com/android/statusbartest/PowerTest.java b/tests/StatusBar/src/com/android/statusbartest/PowerTest.java index 2ec620bdfcb82..52527d914215a 100644 --- a/tests/StatusBar/src/com/android/statusbartest/PowerTest.java +++ b/tests/StatusBar/src/com/android/statusbartest/PowerTest.java @@ -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); }