Commit 391e6884 authored by Geoffrey Métais's avatar Geoffrey Métais

Specify media button receiver for crappy firmwares

(cherry picked from commit 6bae40c6)
parent f84798f2
......@@ -1030,8 +1030,10 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
}
private void initMediaSession() {
ComponentName mediaButtonEventReceiver = new ComponentName(this,
RemoteControlClientReceiver.class);
mSessionCallback = new MediaSessionCallback();
mMediaSession = new MediaSessionCompat(this, "VLC");
mMediaSession = new MediaSessionCompat(this, "VLC", mediaButtonEventReceiver, null);
mMediaSession.setFlags(MediaSessionCompat.FLAG_HANDLES_MEDIA_BUTTONS
| MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);
mMediaSession.setCallback(mSessionCallback);
......@@ -1045,7 +1047,6 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
mMediaSession.setActive(false);
mMediaSession.setFlags(MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);
mMediaSession.setActive(true);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment