aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-03-10 16:01:40 -0700
committerScott Jackson <daneren2005@gmail.com>2014-03-10 16:01:40 -0700
commit78f6179cbdfc5db80634ec38be3e6b6d85cffca5 (patch)
treec3994a8e2897aa9a44d09518812082e4f99e98f3 /src/github/daneren2005
parentbc1c4d26ecfd9b33b79cbdf1e200ac790188e996 (diff)
downloaddsub-78f6179cbdfc5db80634ec38be3e6b6d85cffca5.tar.gz
dsub-78f6179cbdfc5db80634ec38be3e6b6d85cffca5.tar.bz2
dsub-78f6179cbdfc5db80634ec38be3e6b6d85cffca5.zip
#306 Make sure internal shutdown changes DownloadService remoteState
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/service/ChromeCastController.java12
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();
}
}
}