diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/service/DownloadService.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java index 7c80ca56..6641d040 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -2616,7 +2616,7 @@ public class DownloadService extends Service { public void addOnSongChangedListener(OnSongChangedListener listener) { addOnSongChangedListener(listener, false); } - public void addOnSongChangedListener(OnSongChangedListener listener, boolean run) { + public synchronized void addOnSongChangedListener(OnSongChangedListener listener, boolean run) { int index = onSongChangedListeners.indexOf(listener); if(index == -1) { onSongChangedListeners.add(listener); @@ -2637,7 +2637,7 @@ public class DownloadService extends Service { } } } - public void removeOnSongChangeListener(OnSongChangedListener listener) { + public synchronized void removeOnSongChangeListener(OnSongChangedListener listener) { int index = onSongChangedListeners.indexOf(listener); if(index != -1) { onSongChangedListeners.remove(index); @@ -2718,7 +2718,7 @@ public class DownloadService extends Service { } } } - private void onStateUpdate() { + private synchronized void onStateUpdate() { final long atRevision = revision; for(final OnSongChangedListener listener: onSongChangedListeners) { handler.post(new Runnable() { |