Skip to content

Commit e7e9b6e

Browse files
committed
Fix NPEs in StatusBarTest.
Change-Id: I9245a297a9a09c09415dd38e662692665ae7e109
1 parent 5380cdc commit e7e9b6e

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -715,20 +715,28 @@ public void run() {
715715
new Test("Ten Notifications") {
716716
public void run() {
717717
for (int i = 0; i < 2; i++) {
718-
Notification n = new Notification(NotificationTestList.this,
718+
Notification n = new Notification(
719719
kNumberedIconResIDs[i],
720-
null, System.currentTimeMillis(), "Persistent #" + i,
721-
"Notify me!!!" + i, null);
722-
n.flags |= Notification.FLAG_ONGOING_EVENT;
720+
null, System.currentTimeMillis());
723721
n.number = i;
722+
n.setLatestEventInfo(
723+
NotificationTestList.this,
724+
"Persistent #" + i,
725+
"Notify me!!!" + i,
726+
null);
727+
n.flags |= Notification.FLAG_ONGOING_EVENT;
724728
mNM.notify((i+1)*10, n);
725729
}
726730
for (int i = 2; i < 10; i++) {
727-
Notification n = new Notification(NotificationTestList.this,
731+
Notification n = new Notification(
728732
kNumberedIconResIDs[i],
729-
null, System.currentTimeMillis(), "Persistent #" + i,
730-
"Notify me!!!" + i, null);
733+
null, System.currentTimeMillis());
731734
n.number = i;
735+
n.setLatestEventInfo(
736+
NotificationTestList.this,
737+
"Persistent #" + i,
738+
"Notify me!!!" + i,
739+
null);
732740
mNM.notify((i+1)*10, n);
733741
}
734742
}

0 commit comments

Comments
 (0)