summaryrefslogtreecommitdiff
path: root/tests/FrameworkPerf
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 /tests/FrameworkPerf
parent08f247fe2e073a5ec62dc0469d83f514aab31c42 (diff)
remove usage of deprecated method setLatestEventInfo
Bug: 18510449 Change-Id: I56a77991c729990e501f402e007dfa79ee57621e
Diffstat (limited to 'tests/FrameworkPerf')
-rw-r--r--tests/FrameworkPerf/src/com/android/frameworkperf/SchedulerService.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/FrameworkPerf/src/com/android/frameworkperf/SchedulerService.java b/tests/FrameworkPerf/src/com/android/frameworkperf/SchedulerService.java
index 7691e644843f..fc3f39027348 100644
--- a/tests/FrameworkPerf/src/com/android/frameworkperf/SchedulerService.java
+++ b/tests/FrameworkPerf/src/com/android/frameworkperf/SchedulerService.java
@@ -26,15 +26,18 @@ public class SchedulerService extends Service {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
- Notification status = new Notification(R.drawable.stat_happy, null,
- System.currentTimeMillis());
- status.flags |= Notification.FLAG_ONGOING_EVENT;
- status.setLatestEventInfo(this, "Scheduler Test running",
- "Scheduler Test running", PendingIntent.getActivity(this, 0,
- new Intent(this, FrameworkPerfActivity.class)
- .setAction(Intent.ACTION_MAIN)
- .addCategory(Intent.CATEGORY_LAUNCHER)
- .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 0));
+ Notification status = new Notification.Builder(this)
+ .setSmallIcon(R.drawable.stat_happy)
+ .setWhen(System.currentTimeMillis())
+ .setContentTitle("Scheduler Test running")
+ .setContentText("Scheduler Test running")
+ .setContentIntent(PendingIntent.getActivity(this, 0,
+ new Intent(this, FrameworkPerfActivity.class)
+ .setAction(Intent.ACTION_MAIN)
+ .addCategory(Intent.CATEGORY_LAUNCHER)
+ .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 0))
+ .setOngoing(true)
+ .build();
startForeground(1, status);
return START_STICKY;
}