Use foreground worker

This commit is contained in:
M66B
2019-03-03 09:09:11 +00:00
parent 4ada53ff0f
commit d7e7371603
5 changed files with 157 additions and 96 deletions

View File

@@ -259,17 +259,14 @@ public class ServiceSynchronize extends LifecycleService {
public void notification(StoreEvent e) {
try {
wlAccount.acquire();
String type = (e.getMessageType() == StoreEvent.ALERT ? "alert" : "notice");
if (e.getMessageType() == StoreEvent.ALERT) {
Log.w(account.name + " " + type + ": " + e.getMessage());
EntityLog.log(ServiceSynchronize.this, account.name + " " + type + ": " + e.getMessage());
db.account().setAccountError(account.id, e.getMessage());
Core.reportError(
ServiceSynchronize.this, account, null,
new Core.AlertException(e.getMessage()));
state.error();
} else
Log.i(account.name + " " + type + ": " + e.getMessage());
Log.i(account.name + " notice: " + e.getMessage());
} finally {
wlAccount.release();
}