summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorChris Wren <cwren@android.com>2015-06-11 10:19:43 -0400
committerChris Wren <cwren@android.com>2015-06-12 10:16:04 -0400
commit1ce4b6d3c6cb5b2eb9c9d00472be12245db92427 (patch)
treed8c7d63276de0a8609ff5bb2422a2e55bad1562a /core/tests
parent08f247fe2e073a5ec62dc0469d83f514aab31c42 (diff)
downloadframeworks_base-1ce4b6d3c6cb5b2eb9c9d00472be12245db92427.zip
frameworks_base-1ce4b6d3c6cb5b2eb9c9d00472be12245db92427.tar.gz
frameworks_base-1ce4b6d3c6cb5b2eb9c9d00472be12245db92427.tar.bz2
remove usage of deprecated method setLatestEventInfo
Bug: 18510449 Change-Id: I56a77991c729990e501f402e007dfa79ee57621e
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/notificationtests/src/android/app/NotificationStressTest.java13
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);
}