summaryrefslogtreecommitdiffstats
path: root/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java')
-rw-r--r--tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
index 90c2a1a..f463a19 100644
--- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
+++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java
@@ -35,6 +35,10 @@ import android.widget.TextView;
import android.widget.ProgressBar;
import android.os.PowerManager;
+// private NM API
+import android.app.INotificationManager;
+import com.android.internal.statusbar.StatusBarNotification;
+
public class NotificationTestList extends TestActivity
{
private final static String TAG = "NotificationTestList";
@@ -205,6 +209,15 @@ public class NotificationTestList extends TestActivity
}
},
+ new Test("Null Icon #1 (when=now)") {
+ public void run() {
+ Notification n = new Notification(0, null, System.currentTimeMillis());
+ n.setLatestEventInfo(NotificationTestList.this, "Persistent #1",
+ "This is the same notification!!!", makeIntent());
+ mNM.notify(1, n);
+ }
+ },
+
new Test("Bad resource #1 (when=create)") {
public void run() {
Notification n = new Notification(R.drawable.icon2,
@@ -752,6 +765,30 @@ public class NotificationTestList extends TestActivity
}
},
+ new Test("System priority notification") {
+ public void run() {
+ Notification n = new Notification.Builder(NotificationTestList.this)
+ .setSmallIcon(R.drawable.notification1)
+ .setContentTitle("System priority")
+ .setContentText("This should appear before all others")
+ .getNotification();
+
+ int[] idOut = new int[1];
+ try {
+ INotificationManager directLine = mNM.getService();
+ directLine.enqueueNotificationWithTagPriority(
+ getPackageName(),
+ null,
+ 1,
+ StatusBarNotification.PRIORITY_SYSTEM,
+ n,
+ idOut);
+ } catch (android.os.RemoteException ex) {
+ // oh well
+ }
+ }
+ },
+
new Test("Crash") {
public void run()
{