diff options
author | Pyry Haulos <phaulos@google.com> | 2015-11-18 20:02:07 -0500 |
---|---|---|
committer | Pyry Haulos <phaulos@google.com> | 2015-11-18 20:02:07 -0500 |
commit | dd949913166b91c2cc2653dbce571f8b19850b1d (patch) | |
tree | f86a57200f26f0db05ddffab8b669a11b4273ed5 /android | |
parent | 54694703587ada9058685b7118c685f699e7e3d0 (diff) | |
parent | afe236a43784a68daadff5dd89421b54cd3796b6 (diff) | |
download | VK-GL-CTS-dd949913166b91c2cc2653dbce571f8b19850b1d.tar.gz VK-GL-CTS-dd949913166b91c2cc2653dbce571f8b19850b1d.tar.bz2 VK-GL-CTS-dd949913166b91c2cc2653dbce571f8b19850b1d.zip |
Merge branch 'cts_mlentine' into 'master'
Use NotificationBuilder instead of Notification
Use of new Notification(...) was deprecated in API 11 and is fully
removed as of API 23. NotificationBuilder is the preferred replacement.
See merge request !73
Diffstat (limited to 'android')
-rw-r--r-- | android/package/src/com/drawelements/deqp/execserver/ExecService.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/android/package/src/com/drawelements/deqp/execserver/ExecService.java b/android/package/src/com/drawelements/deqp/execserver/ExecService.java index bd65f9236..f8d040dac 100644 --- a/android/package/src/com/drawelements/deqp/execserver/ExecService.java +++ b/android/package/src/com/drawelements/deqp/execserver/ExecService.java @@ -25,6 +25,7 @@ package com.drawelements.deqp.execserver; import android.app.Service; import android.app.Notification; +import android.app.Notification.Builder; import android.app.PendingIntent; import android.content.Intent; import android.os.Binder; @@ -82,8 +83,11 @@ public class ExecService extends Service { PendingIntent pm = PendingIntent.getActivity(this, 0, launchIntent, 0); // Start as foreground service. - Notification notification = new Notification(R.drawable.deqp_app_small, "dEQP ExecServer", System.currentTimeMillis()); - notification.setLatestEventInfo(this, "dEQP ExecServer", "ExecServer is running in the background.", pm); + Notification.Builder builder = new Notification.Builder(this); + Notification notification = builder.setContentIntent(pm) + .setSmallIcon(R.drawable.deqp_app_small).setTicker("ExecServer is running in the background.") + .setWhen(System.currentTimeMillis()).setAutoCancel(true).setContentTitle("dEQP ExecServer") + .setContentText("ExecServer is running in the background.").build(); startForeground(1, notification); return START_STICKY; // Keep us running until explictly stopped |