[Android] Ensure 'isWorking' variable is up-to-date

Geoffrey Métais git at videolan.org
Fri Dec 29 11:00:29 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Dec 29 10:33:03 2017 +0100| [47f9f65d69bf300951c11fa7bc69f43e76f97c67] | committer: Geoffrey Métais

Ensure 'isWorking' variable is up-to-date

> https://code.videolan.org/videolan/vlc-android/commit/47f9f65d69bf300951c11fa7bc69f43e76f97c67
---

 medialibrary/src/org/videolan/medialibrary/Medialibrary.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
index a4e9ca234..8d9e67404 100644
--- a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
+++ b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
@@ -60,7 +60,7 @@ public class Medialibrary {
 
     private long mInstanceID;
     private volatile boolean mIsInitiated = false;
-    private boolean mIsWorking = false;
+    private volatile boolean mIsWorking = false;
 
     private MediaUpdatedCb mediaUpdatedCb = null;
     private MediaAddedCb mediaAddedCb = null;
@@ -411,8 +411,8 @@ public class Medialibrary {
 
     @SuppressWarnings("unused")
     public void onBackgroundTasksIdleChanged(boolean isIdle) {
-        LocalBroadcastManager.getInstance(sContext).sendBroadcast(new Intent(ACTION_IDLE).putExtra(STATE_IDLE, isIdle));
         mIsWorking = !isIdle;
+        LocalBroadcastManager.getInstance(sContext).sendBroadcast(new Intent(ACTION_IDLE).putExtra(STATE_IDLE, isIdle));
     }
 
     void onReloadStarted(String entryPoint) {



More information about the Android mailing list