diff options
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 10386a423..5e1057716 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -209,6 +209,8 @@ public class PlaybackService extends MediaBrowserServiceCompat { private static volatile MediaType currentMediaType = MediaType.UNKNOWN; + private final IBinder mBinder = new LocalBinder(); + public class LocalBinder extends Binder { public PlaybackService getService() { return PlaybackService.this; @@ -384,7 +386,11 @@ public class PlaybackService extends MediaBrowserServiceCompat { @Override public IBinder onBind(Intent intent) { Log.d(TAG, "Received onBind event"); - return super.onBind(intent); + if(intent.getAction() != null && TextUtils.equals(intent.getAction(), MediaBrowserServiceCompat.SERVICE_INTERFACE)) { + return super.onBind(intent); + } else { + return mBinder; + } } @Override |