diff options
author | Chris Wren <cwren@android.com> | 2015-06-12 19:28:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-12 19:28:54 +0000 |
commit | 17de4b2a73996366ff3d7759793a6809654caebe (patch) | |
tree | ea4b1be97c53e507c124120681efde58e2c20ad3 /core/tests | |
parent | 6161eb3494837cb7031b940e02fcbf5449e5be77 (diff) | |
parent | 1ce4b6d3c6cb5b2eb9c9d00472be12245db92427 (diff) | |
download | frameworks_base-17de4b2a73996366ff3d7759793a6809654caebe.zip frameworks_base-17de4b2a73996366ff3d7759793a6809654caebe.tar.gz frameworks_base-17de4b2a73996366ff3d7759793a6809654caebe.tar.bz2 |
Merge "remove usage of deprecated method setLatestEventInfo" into mnc-dev
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); } |