Skip to content
Snippets Groups Projects
Commit eae98504 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Remove startService call from NotificationHelper

parent 803e5c8c
No related branches found
No related tags found
No related merge requests found
...@@ -79,12 +79,12 @@ public class NotificationHelper { ...@@ -79,12 +79,12 @@ public class NotificationHelper {
builder.addAction(R.drawable.ic_widget_close_w, ctx.getString(R.string.stop), piStop); builder.addAction(R.drawable.ic_widget_close_w, ctx.getString(R.string.stop), piStop);
if (AndroidDevices.showMediaStyle) { if (AndroidDevices.showMediaStyle) {
builder.setStyle(new Notification.MediaStyle() final Notification.MediaStyle ms = new Notification.MediaStyle()
.setMediaSession((MediaSession.Token) sessionToken.getToken()) .setShowActionsInCompactView(0,1,2);
.setShowActionsInCompactView(0,1,2) if (sessionToken != null)
); ms.setMediaSession((MediaSession.Token) sessionToken.getToken());
builder.setStyle(ms);
} }
ctx.startForegroundService(new Intent(ctx, PlaybackService.class));
return builder.build(); return builder.build();
} else { } else {
final NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx); final NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx);
...@@ -114,7 +114,6 @@ public class NotificationHelper { ...@@ -114,7 +114,6 @@ public class NotificationHelper {
.setCancelButtonIntent(piStop) .setCancelButtonIntent(piStop)
); );
} }
ctx.startService(new Intent(ctx, PlaybackService.class));
return builder.build(); return builder.build();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment