backgroundTasksRunning.postValue(cnt > 0);
}
public static void setCurrentProfile(MobileLedgerProfile newProfile) {
- MLDB.setOption(MLDB.OPT_PROFILE_UUID, newProfile.getUuid());
+ MLDB.setOption(MLDB.OPT_PROFILE_UUID, (newProfile == null) ? null : newProfile.getUuid());
stopTransactionsRetrieval();
profile.postValue(newProfile);
}
Logger.debug("db", "Ignoring request for transaction retrieval - already active");
return;
}
+ MobileLedgerProfile pr = profile.getValue();
+ if (pr == null) throw new IllegalStateException("No current profile");
+
retrieveTransactionsTask =
new RetrieveTransactionsTask(new WeakReference<>(activity), profile.getValue());
Logger.debug("db", "Created a background transaction retrieval task");