diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-03-10 16:01:40 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-03-10 16:01:40 -0700 |
commit | 78f6179cbdfc5db80634ec38be3e6b6d85cffca5 (patch) | |
tree | c3994a8e2897aa9a44d09518812082e4f99e98f3 /src/github | |
parent | bc1c4d26ecfd9b33b79cbdf1e200ac790188e996 (diff) | |
download | dsub-78f6179cbdfc5db80634ec38be3e6b6d85cffca5.tar.gz dsub-78f6179cbdfc5db80634ec38be3e6b6d85cffca5.tar.bz2 dsub-78f6179cbdfc5db80634ec38be3e6b6d85cffca5.zip |
#306 Make sure internal shutdown changes DownloadService remoteState
Diffstat (limited to 'src/github')
-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(); } } } |