aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-05-10 18:43:21 -0700
committerScott Jackson <daneren2005@gmail.com>2013-05-10 18:43:21 -0700
commit4b4c6da597d0b12c7e66acca472ec52856b9966a (patch)
treefb9da071e86cabecfa1e7a2fe59ab4bdea67a97b
parentd2de4b4cd48218301975802d8ed9a549aaf1765f (diff)
downloaddsub-4b4c6da597d0b12c7e66acca472ec52856b9966a.tar.gz
dsub-4b4c6da597d0b12c7e66acca472ec52856b9966a.tar.bz2
dsub-4b4c6da597d0b12c7e66acca472ec52856b9966a.zip
Don't require double press on widget after idle for a long time
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java7
1 files changed, 5 insertions, 2 deletions
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<MusicDirectory.Entry> 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();