From 78f6179cbdfc5db80634ec38be3e6b6d85cffca5 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 10 Mar 2014 16:01:40 -0700 Subject: #306 Make sure internal shutdown changes DownloadService remoteState --- .../daneren2005/dsub/service/ChromeCastController.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/github') 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(); } } } -- cgit v1.2.3