diff options
author | Joe Onorato <joeo@android.com> | 2009-11-05 17:12:18 -0500 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2009-11-05 17:12:18 -0500 |
commit | e71d9e421da070705a8f37aaf702282467a9fe7f (patch) | |
tree | e37a5058e51b56307c78116d824d11c0e9d7989d /tests/StatusBar | |
parent | 27c6dd7aa4ff6f57435a3c87d8b9a782cf7c9116 (diff) | |
download | frameworks_base-e71d9e421da070705a8f37aaf702282467a9fe7f.zip frameworks_base-e71d9e421da070705a8f37aaf702282467a9fe7f.tar.gz frameworks_base-e71d9e421da070705a8f37aaf702282467a9fe7f.tar.bz2 |
Another test for StatusBar test.
Diffstat (limited to 'tests/StatusBar')
-rw-r--r-- | tests/StatusBar/AndroidManifest.xml | 1 | ||||
-rw-r--r-- | tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/StatusBar/AndroidManifest.xml b/tests/StatusBar/AndroidManifest.xml index 9bba79c..21fb951 100644 --- a/tests/StatusBar/AndroidManifest.xml +++ b/tests/StatusBar/AndroidManifest.xml @@ -1,6 +1,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.statusbartest"> <uses-permission android:name="android.permission.DEVICE_POWER" /> + <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.STATUS_BAR" /> <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" /> <uses-permission android:name="android.permission.VIBRATE" /> diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index a88183c..f2ddd0f 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -58,6 +58,27 @@ public class NotificationTestList extends TestActivity } private Test[] mTests = new Test[] { + new Test("Off and sound") { + public void run() { + PowerManager pm = (PowerManager)NotificationTestList.this.getSystemService("power"); + PowerManager.WakeLock wl = + pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "sound"); + wl.acquire(); + + pm.goToSleep(SystemClock.uptimeMillis()); + + Notification n = new Notification(); + n.sound = Uri.parse("file:///sdcard/virtual-void.mp3"); + Log.d(TAG, "n.sound=" + n.sound); + + mNM.notify(1, n); + + Log.d(TAG, "releasing wake lock"); + wl.release(); + Log.d(TAG, "released wake lock"); + } + }, + new Test("No view") { public void run() { Notification n = new Notification(R.drawable.icon1, "No view", |