summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2010-10-05 14:45:28 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-05 14:45:28 -0700
commit2c164747d364c3e51964d03ecefc5752c7c0c6ba (patch)
tree144eb40c689b77a4e0f4f7d3edef7f17f5a2fb47 /tests
parent56ee1080f004110bff622e5b60c243d9cabfe120 (diff)
parentf7872780ca3dae9584251b1e3495aed12110254c (diff)
downloadframeworks_base-2c164747d364c3e51964d03ecefc5752c7c0c6ba.zip
frameworks_base-2c164747d364c3e51964d03ecefc5752c7c0c6ba.tar.gz
frameworks_base-2c164747d364c3e51964d03ecefc5752c7c0c6ba.tar.bz2
am f7872780: Merge "PowerManagerService needs yet another flag..." into gingerbread
Merge commit 'f7872780ca3dae9584251b1e3495aed12110254c' into gingerbread-plus-aosp * commit 'f7872780ca3dae9584251b1e3495aed12110254c': PowerManagerService needs yet another flag...
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;