[Android] Specify media button receiver for crappy firmwares

Geoffrey Métais git at videolan.org
Wed Dec 2 14:18:45 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Dec  2 10:32:47 2015 +0100| [391e688497472d7d09edabd1adf65b0e188bcfd0] | committer: Geoffrey Métais

Specify media button receiver for crappy firmwares

(cherry picked from commit 6bae40c69f4dc6193fa63852a338b17f3b63524a)

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=391e688497472d7d09edabd1adf65b0e188bcfd0
---

 vlc-android/src/org/videolan/vlc/PlaybackService.java |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index f25e921..f6e3c19 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -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);
-
         }
     }
 



More information about the Android mailing list