diff options
author | Daniel Sandler <dsandler@android.com> | 2012-02-24 10:53:42 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-02-24 10:53:42 -0800 |
commit | 3f0c58eb708ca520e84396fe764147800395812f (patch) | |
tree | 550651c9789b6950c1e3cc8e1c90fe084ba3ca71 /tests | |
parent | 525ece4098a636818148dd5a660ebe4d7a2138af (diff) | |
parent | 2561b0b10a55841a08e0e1d467e73e10b1bf256d (diff) | |
download | frameworks_base-3f0c58eb708ca520e84396fe764147800395812f.zip frameworks_base-3f0c58eb708ca520e84396fe764147800395812f.tar.gz frameworks_base-3f0c58eb708ca520e84396fe764147800395812f.tar.bz2 |
Merge "New notification priority and related APIs."
Diffstat (limited to 'tests')
-rw-r--r-- | tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java | 58 |
1 files changed, 53 insertions, 5 deletions
diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index f463a19..ae01c75 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -765,22 +765,70 @@ public class NotificationTestList extends TestActivity } }, - new Test("System priority notification") { + new Test("PRIORITY_HIGH") { public void run() { Notification n = new Notification.Builder(NotificationTestList.this) - .setSmallIcon(R.drawable.notification1) - .setContentTitle("System priority") + .setSmallIcon(R.drawable.notification5) + .setContentTitle("High priority") .setContentText("This should appear before all others") + .setPriority(Notification.PRIORITY_HIGH) .getNotification(); int[] idOut = new int[1]; try { INotificationManager directLine = mNM.getService(); - directLine.enqueueNotificationWithTagPriority( + directLine.enqueueNotificationWithTag( + getPackageName(), + null, + 100, + n, + idOut); + } catch (android.os.RemoteException ex) { + // oh well + } + } + }, + + new Test("PRIORITY_MAX") { + public void run() { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.notification9) + .setContentTitle("MAX priority") + .setContentText("This might appear as an intruder alert") + .setPriority(Notification.PRIORITY_MAX) + .getNotification(); + + int[] idOut = new int[1]; + try { + INotificationManager directLine = mNM.getService(); + directLine.enqueueNotificationWithTag( + getPackageName(), + null, + 200, + n, + idOut); + } catch (android.os.RemoteException ex) { + // oh well + } + } + }, + + new Test("PRIORITY_MIN") { + public void run() { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.notification0) + .setContentTitle("MIN priority") + .setContentText("You should not see this") + .setPriority(Notification.PRIORITY_MIN) + .getNotification(); + + int[] idOut = new int[1]; + try { + INotificationManager directLine = mNM.getService(); + directLine.enqueueNotificationWithTag( getPackageName(), null, 1, - StatusBarNotification.PRIORITY_SYSTEM, n, idOut); } catch (android.os.RemoteException ex) { |