summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2010-10-05 17:38:09 -0400
committerJoe Onorato <joeo@google.com>2010-10-05 17:39:01 -0400
commit8274a0e53630f80ab356f69ddad895ed9638574e (patch)
tree7af4bd25c92f7384a1805c53aec17be197693963 /tests
parentb9a40068b590b86904b40bf466571b140d0f94b4 (diff)
downloadframeworks_base-8274a0e53630f80ab356f69ddad895ed9638574e.zip
frameworks_base-8274a0e53630f80ab356f69ddad895ed9638574e.tar.gz
frameworks_base-8274a0e53630f80ab356f69ddad895ed9638574e.tar.bz2
PowerManagerService needs yet another flag...
... to make sure that if you press the power button to turn off the screen, that the prox sensor won't turn it back on. Bug: 3011618 Change-Id: Id16c1d65417539d4592f485b1c3efb737540c3cd
Diffstat (limited to 'tests')
-rw-r--r--tests/StatusBar/src/com/android/statusbartest/PowerTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/StatusBar/src/com/android/statusbartest/PowerTest.java b/tests/StatusBar/src/com/android/statusbartest/PowerTest.java
index f778cab..178fa92 100644
--- a/tests/StatusBar/src/com/android/statusbartest/PowerTest.java
+++ b/tests/StatusBar/src/com/android/statusbartest/PowerTest.java
@@ -49,6 +49,8 @@ public class PowerTest extends TestActivity
int mPokeState = 0;
IBinder mPokeToken = new Binder();
Handler mHandler = new Handler();
+ PowerManager mPm;
+ PowerManager.WakeLock mProx;
@Override
protected String tag() {
@@ -58,10 +60,27 @@ public class PowerTest extends TestActivity
@Override
protected Test[] tests() {
mPowerManager = IPowerManager.Stub.asInterface(ServiceManager.getService("power"));
+ mPm = (PowerManager)getSystemService("power");
+ mProx = mPm.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, "PowerTest-prox");
return mTests;
}
private Test[] mTests = new Test[] {
+ new Test("Enable proximity") {
+ public void run() {
+ mProx.acquire();
+ }
+ },
+ new Test("Disable proximity") {
+ public void run() {
+ mProx.release();
+ }
+ },
+ new Test("Disable proximity (WAIT_FOR_PROXIMITY_NEGATIVE)") {
+ public void run() {
+ mProx.release(PowerManager.WAIT_FOR_PROXIMITY_NEGATIVE);
+ }
+ },
new Test("Cheek events don't poke") {
public void run() {
mPokeState |= LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;
@@ -72,6 +91,7 @@ public class PowerTest extends TestActivity
}
}
},
+
new Test("Cheek events poke") {
public void run() {
mPokeState &= ~LocalPowerManager.POKE_LOCK_IGNORE_CHEEK_EVENTS;