diff options
author | Domingos Lopes <domingos86lopes+github@gmail.com> | 2016-04-16 10:23:40 -0400 |
---|---|---|
committer | Domingos Lopes <domingos86lopes+github@gmail.com> | 2016-04-23 21:39:58 -0400 |
commit | 8a18adf50c85de94d6fab036f2066c1c4dd56e74 (patch) | |
tree | 4cc5fc11d4f124942ab2936b162533aadde2dcbf | |
parent | 2762af8d50f397bec110a990a85bf6b69660fb4a (diff) | |
download | AntennaPod-8a18adf50c85de94d6fab036f2066c1c4dd56e74.zip |
disconnect cast session if user disables it in preferences and PlaybackService isn't running
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/CastEnabledActivity.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/CastEnabledActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/CastEnabledActivity.java index 9177a1f1c..dd7cef428 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/CastEnabledActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/CastEnabledActivity.java @@ -11,6 +11,7 @@ import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.cast.CastManager; import de.danoeh.antennapod.core.cast.SwitchableMediaRouteActionProvider; import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.core.service.playback.PlaybackService; /** * Activity that allows for showing the MediaRouter button whenever there's a cast device in the @@ -97,7 +98,9 @@ public abstract class CastEnabledActivity extends AppCompatActivity mCastManager.decrementUiCounter(); castUICounter--; } - //TODO disable any current casting (or possibly do it within the PlaybackService) + if (!PlaybackService.isRunning) { + CastManager.getInstance().disconnect(); + } } } } |