diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-04-14 09:39:24 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-04-14 09:39:24 -0700 |
commit | 35f974d8ce7e225a1ec01d82d79aa74856a2b3e8 (patch) | |
tree | 64ac271177cb4eef572c81df7775bc8724e02b36 | |
parent | fd391fb6c4ba57b8baf62414edc18ffd508cfb2a (diff) | |
download | dsub-35f974d8ce7e225a1ec01d82d79aa74856a2b3e8.tar.gz dsub-35f974d8ce7e225a1ec01d82d79aa74856a2b3e8.tar.bz2 dsub-35f974d8ce7e225a1ec01d82d79aa74856a2b3e8.zip |
Remove monitor to see if it fixes ANR
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java index e04f2cac..a7b99902 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/DownloadServiceImpl.java @@ -884,14 +884,16 @@ public class DownloadServiceImpl extends Service implements DownloadService { thread = Thread.currentThread(); while(isRunning) { try { - // Add a monitor for not running while mediaPlayer state is changing - synchronized(DownloadServiceImpl.this) { - if(mediaPlayer != null && playerState == STARTED) { - cachedPosition = mediaPlayer.getCurrentPosition(); - } + if(mediaPlayer != null && playerState == STARTED) { + cachedPosition = mediaPlayer.getCurrentPosition(); } Thread.sleep(200L); } + catch (InterruptedException e) { + // Purposely interrupted, don't log error + isRunning = false; + positionCache = null; + } catch(Exception e) { Log.w(TAG, "Crashed getting current position", e); isRunning = false; |