From e7e9b6e0339f2636afefc8d3f4cd9d807d94b901 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Fri, 4 May 2012 13:14:57 -0400 Subject: [PATCH] Fix NPEs in StatusBarTest. Change-Id: I9245a297a9a09c09415dd38e662692665ae7e109 --- .../statusbartest/NotificationTestList.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index a90af159272ad..70e2aac96d925 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -715,20 +715,28 @@ public class NotificationTestList extends TestActivity new Test("Ten Notifications") { public void run() { for (int i = 0; i < 2; i++) { - Notification n = new Notification(NotificationTestList.this, + Notification n = new Notification( kNumberedIconResIDs[i], - null, System.currentTimeMillis(), "Persistent #" + i, - "Notify me!!!" + i, null); - n.flags |= Notification.FLAG_ONGOING_EVENT; + null, System.currentTimeMillis()); n.number = i; + n.setLatestEventInfo( + NotificationTestList.this, + "Persistent #" + i, + "Notify me!!!" + i, + null); + n.flags |= Notification.FLAG_ONGOING_EVENT; mNM.notify((i+1)*10, n); } for (int i = 2; i < 10; i++) { - Notification n = new Notification(NotificationTestList.this, + Notification n = new Notification( kNumberedIconResIDs[i], - null, System.currentTimeMillis(), "Persistent #" + i, - "Notify me!!!" + i, null); + null, System.currentTimeMillis()); n.number = i; + n.setLatestEventInfo( + NotificationTestList.this, + "Persistent #" + i, + "Notify me!!!" + i, + null); mNM.notify((i+1)*10, n); } }