From eb1ad23b49cfd4de477c73279cda7d5c1ad3b1a9 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 16 Jan 2015 12:35:11 -0800 Subject: Fix crash on startup after casting due to a check not to do anything if remoteState hasn't changed --- src/github/daneren2005/dsub/service/DownloadService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index 29fb00b2..37741b92 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -414,10 +414,10 @@ public class DownloadService extends Service { public synchronized void restore(List songs, List toDelete, int currentPlayingIndex, int currentPlayingPosition) { SharedPreferences prefs = Util.getPreferences(this); - remoteState = RemoteControlState.values()[prefs.getInt(Constants.PREFERENCES_KEY_CONTROL_MODE, 0)]; - if(remoteState != LOCAL) { + RemoteControlState newState = RemoteControlState.values()[prefs.getInt(Constants.PREFERENCES_KEY_CONTROL_MODE, 0)]; + if(newState != LOCAL) { String id = prefs.getString(Constants.PREFERENCES_KEY_CONTROL_ID, null); - setRemoteState(remoteState, null, id); + setRemoteState(newState, null, id); } if(prefs.getBoolean(Constants.PREFERENCES_KEY_REMOVE_PLAYED, false)) { removePlayed = true; -- cgit v1.2.3