diff options
Diffstat (limited to 'tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java')
-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) { |