From e71d9e421da070705a8f37aaf702282467a9fe7f Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Thu, 5 Nov 2009 17:12:18 -0500 Subject: [PATCH] Another test for StatusBar test. --- tests/StatusBar/AndroidManifest.xml | 1 + .../statusbartest/NotificationTestList.java | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/tests/StatusBar/AndroidManifest.xml b/tests/StatusBar/AndroidManifest.xml index 9bba79c2b9b63..21fb951fca490 100644 --- a/tests/StatusBar/AndroidManifest.xml +++ b/tests/StatusBar/AndroidManifest.xml @@ -1,6 +1,7 @@ + diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index a88183cffdca5..f2ddd0fd55c04 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",