mirror of https://github.com/M66B/FairEmail.git
Report store alerts, reset account errors after verifying connection
This commit is contained in:
parent
b5b0e56fea
commit
d864b655c8
|
@ -740,10 +740,12 @@ public class ServiceSynchronize extends LifecycleService {
|
||||||
public void notification(StoreEvent e) {
|
public void notification(StoreEvent e) {
|
||||||
try {
|
try {
|
||||||
wl.acquire();
|
wl.acquire();
|
||||||
Log.i(Helper.TAG, account.name + " event: " + e.getMessage());
|
String type = (e.getMessageType() == StoreEvent.ALERT ? "alert" : "notice");
|
||||||
if (BuildConfig.DEBUG)
|
EntityLog.log(ServiceSynchronize.this, account.name + " " + type + ": " + e.getMessage());
|
||||||
|
if (e.getMessageType() == StoreEvent.ALERT) {
|
||||||
db.account().setAccountError(account.id, e.getMessage());
|
db.account().setAccountError(account.id, e.getMessage());
|
||||||
state.error();
|
state.error();
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
wl.release();
|
wl.release();
|
||||||
}
|
}
|
||||||
|
@ -841,7 +843,6 @@ public class ServiceSynchronize extends LifecycleService {
|
||||||
Log.i(Helper.TAG, account.name + " idle=" + capIdle);
|
Log.i(Helper.TAG, account.name + " idle=" + capIdle);
|
||||||
|
|
||||||
db.account().setAccountState(account.id, "connected");
|
db.account().setAccountState(account.id, "connected");
|
||||||
db.account().setAccountError(account.id, capIdle ? null : getString(R.string.title_no_idle));
|
|
||||||
|
|
||||||
NotificationManager nm = getSystemService(NotificationManager.class);
|
NotificationManager nm = getSystemService(NotificationManager.class);
|
||||||
nm.cancel("receive", account.id.intValue());
|
nm.cancel("receive", account.id.intValue());
|
||||||
|
@ -1199,6 +1200,7 @@ public class ServiceSynchronize extends LifecycleService {
|
||||||
|
|
||||||
// Record successful connection
|
// Record successful connection
|
||||||
db.account().setAccountConnected(account.id, new Date().getTime());
|
db.account().setAccountConnected(account.id, new Date().getTime());
|
||||||
|
db.account().setAccountError(account.id, capIdle ? null : getString(R.string.title_no_idle));
|
||||||
|
|
||||||
// Schedule keep alive alarm
|
// Schedule keep alive alarm
|
||||||
EntityLog.log(this, account.name + " wait=" + account.poll_interval);
|
EntityLog.log(this, account.name + " wait=" + account.poll_interval);
|
||||||
|
|
Loading…
Reference in New Issue