From 4b4c6da597d0b12c7e66acca472ec52856b9966a Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 10 May 2013 18:43:21 -0700 Subject: Don't require double press on widget after idle for a long time --- .../src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'subsonic-android/src/github/daneren2005') diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index 66339445..dc1e2f0f 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -130,6 +130,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { private Timer sleepTimer; private int timerDuration; + private boolean autoPlayStart = false; static { if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { @@ -326,10 +327,11 @@ public class DownloadServiceImpl extends Service implements DownloadService { public void restore(List songs, int currentPlayingIndex, int currentPlayingPosition) { download(songs, false, false, false, false); if (currentPlayingIndex != -1) { - play(currentPlayingIndex, false); + play(currentPlayingIndex, autoPlayStart); if (currentPlaying.isCompleteFileAvailable()) { - doPlay(currentPlaying, currentPlayingPosition, false); + doPlay(currentPlaying, currentPlayingPosition, autoPlayStart); } + autoPlayStart = false; } } @@ -663,6 +665,7 @@ public class DownloadServiceImpl extends Service implements DownloadService { if (playerState == PAUSED || playerState == COMPLETED || playerState == STOPPED) { start(); } else if (playerState == STOPPED || playerState == IDLE) { + autoPlayStart = true; play(); } else if (playerState == STARTED) { pause(); -- cgit v1.2.3