From 91a9bcb5fb4710793b3a1774dbc7e995e432173a Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 8 Aug 2014 16:33:53 -0700 Subject: If nextSetup is true, use playNext regardless If nextSetup is true, then the media player has already called setNextMediaPlayer. Since this is already inside of the onCompletion, there is a pretty good chance that the next media player is already playing. In this case we can't risk going into the condition where the current media player will be restarted. --- src/github/daneren2005/dsub/service/DownloadService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/github') diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index c4837260..250dcf37 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1493,7 +1493,7 @@ public class DownloadService extends Service { int pos = cachedPosition; Log.i(TAG, "Ending position " + pos + " of " + duration); - if (!isPartial || (downloadFile.isWorkDone() && (Math.abs(duration - pos) < 10000))) { + if (!isPartial || (downloadFile.isWorkDone() && (Math.abs(duration - pos) < 10000)) || nextSetup) { playNext(); // Finished loading, delete when list is cleared -- cgit v1.2.3 From 8ac7e0f2fec8f1ba475696b4d1bf2d7065eae2f9 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Fri, 8 Aug 2014 16:41:47 -0700 Subject: Lower wakelock time to hopefully improve on active battery usage --- src/github/daneren2005/dsub/service/DownloadService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/github') diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index 250dcf37..5f58e7fa 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -1487,7 +1487,7 @@ public class DownloadService extends Service { // Acquire a temporary wakelock, since when we return from // this callback the MediaPlayer will release its wakelock // and allow the device to go to sleep. - wakeLock.acquire(60000); + wakeLock.acquire(30000); setPlayerStateCompleted(); -- cgit v1.2.3