]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/async/UpdateAccountsTask.java
migrate backgroundTaskCount to an atomic counter and "running" boolean LiveData
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / async / UpdateAccountsTask.java
index 65f272220557501c2a9dc37fd0b24f741e2e699a..743e8df2be1ce4fb76def73abde67f317d06beac 100644 (file)
@@ -31,7 +31,7 @@ import java.util.ArrayList;
 
 public class UpdateAccountsTask extends AsyncTask<Void, Void, ArrayList<LedgerAccount>> {
     protected ArrayList<LedgerAccount> doInBackground(Void... params) {
-        Data.backgroundTaskCount.incrementAndGet();
+        Data.backgroundTaskStarted();
         try {
             MobileLedgerProfile profile = Data.profile.get();
             String profileUUID = profile.getUuid();
@@ -57,7 +57,7 @@ public class UpdateAccountsTask extends AsyncTask<Void, Void, ArrayList<LedgerAc
         }
         finally {
             Log.d("UAT", "decrementing background task count");
-            Data.backgroundTaskCount.decrementAndGet();
+            Data.backgroundTaskFinished();
         }
     }
 }