diff options
author | Meir Schwarz <meir@imdde.com> | 2016-07-02 01:13:27 -0700 |
---|---|---|
committer | Meir Schwarz <meir@imdde.com> | 2016-07-02 01:13:27 -0700 |
commit | b227c12f397472e37b574f394a24f77766435313 (patch) | |
tree | a7c8a2e48630b06a2d6121536c7851a8896e24d1 /core/src | |
parent | a806d58966bca19cb89ca0b2b2d287f2611c3e36 (diff) | |
download | AntennaPod-b227c12f397472e37b574f394a24f77766435313.zip |
Fix binding issues by only using the MediaBrowserService onBind when the intent's action is MediaBrowserService and otherwise returning the LocalBinder.
Diffstat (limited to 'core/src')
-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..d1fe8a968 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 && intent.getAction().equals("android.media.browse.MediaBrowserService")) { + return super.onBind(intent); + } else { + return mBinder; + } } @Override |