diff options
-rw-r--r-- | src/github/daneren2005/dsub/service/ChromeCastController.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/service/ChromeCastController.java b/src/github/daneren2005/dsub/service/ChromeCastController.java index dccadd59..2a8a8e93 100644 --- a/src/github/daneren2005/dsub/service/ChromeCastController.java +++ b/src/github/daneren2005/dsub/service/ChromeCastController.java @@ -39,6 +39,7 @@ import java.io.IOException; import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.MusicDirectory; import github.daneren2005.dsub.domain.PlayerState; +import github.daneren2005.dsub.domain.RemoteControlState; import github.daneren2005.dsub.util.Constants; import github.daneren2005.dsub.util.FileUtil; import github.daneren2005.dsub.util.Util; @@ -98,7 +99,7 @@ public class ChromeCastController extends RemoteController { @Override public void onApplicationDisconnected(int errorCode) { - shutdown(); + shutdownInternal(); } }; @@ -170,6 +171,11 @@ public class ChromeCastController extends RemoteController { } } + private void shutdownInternal() { + // This will call this.shutdown() indirectly + downloadService.setRemoteEnabled(RemoteControlState.LOCAL, null); + } + @Override public void updatePlaylist() { @@ -375,7 +381,7 @@ public class ChromeCastController extends RemoteController { applicationStarted = true; setupChannel(); } else { - shutdown(); + shutdownInternal(); } } }); @@ -444,7 +450,7 @@ public class ChromeCastController extends RemoteController { private class ConnectionFailedListener implements GoogleApiClient.OnConnectionFailedListener { @Override public void onConnectionFailed(ConnectionResult result) { - shutdown(); + shutdownInternal(); } } } |