OSDN Git Service

Eleven: Fix crash after receiving media button intent
authorLuK1337 <priv.luk@gmail.com>
Wed, 10 Oct 2018 16:26:40 +0000 (18:26 +0200)
committerToni Ananta <townex22@gmail.com>
Wed, 17 Oct 2018 03:34:42 +0000 (05:34 +0200)
* Since eleven is not allowed to launch background services
  we need to use ctx.startForegroundService().

Change-Id: Id8eea0f43c3fec982dc14ee289229793ab908739

src/org/lineageos/eleven/MediaButtonIntentReceiver.java

index 4933825..bd1a55a 100644 (file)
@@ -76,6 +76,6 @@ public class MediaButtonIntentReceiver extends WakefulBroadcastReceiver {
         i.putExtra(MusicPlaybackService.CMDNAME, command);
         i.putExtra(MusicPlaybackService.FROM_MEDIA_BUTTON, true);
         i.putExtra(MusicPlaybackService.TIMESTAMP, timestamp);
-        startWakefulService(context, i);
+        context.startForegroundService(i);
     }
 }