diff options
Diffstat (limited to 'core/tests')
-rw-r--r-- | core/tests/notificationtests/src/android/app/NotificationStressTest.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/tests/notificationtests/src/android/app/NotificationStressTest.java b/core/tests/notificationtests/src/android/app/NotificationStressTest.java index 52ea1c4..4cb617e 100644 --- a/core/tests/notificationtests/src/android/app/NotificationStressTest.java +++ b/core/tests/notificationtests/src/android/app/NotificationStressTest.java @@ -77,15 +77,20 @@ public class NotificationStressTest extends InstrumentationTestCase { } private void sendNotification(int id, CharSequence text) { - // Create "typical" notification with random icon - Notification notification = new Notification(ICONS[mRandom.nextInt(ICONS.length)], text, - System.currentTimeMillis()); // Fill in arbitrary content Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, intent, 0); CharSequence title = text + " " + id; CharSequence subtitle = String.valueOf(System.currentTimeMillis()); - notification.setLatestEventInfo(mContext, title, subtitle, pendingIntent); + // Create "typical" notification with random icon + Notification notification = new Notification.Builder(mContext) + .setSmallIcon(ICONS[mRandom.nextInt(ICONS.length)]) + .setTicker(text) + .setWhen(System.currentTimeMillis()) + .setContentTitle(title) + .setContentText(subtitle) + .setContentIntent(pendingIntent) + .build(); mNotificationManager.notify(id, notification); SystemClock.sleep(10); } |