From e074884d99505e76cad94eb6a95c7fc5a0882911 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 5 Mar 2019 19:06:57 +0000 Subject: [PATCH] Let's finally fix this ... --- .../main/java/eu/faircode/email/ServiceSynchronize.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index f7a2567bf7..2d46f2a634 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -362,7 +362,7 @@ public class ServiceSynchronize extends LifecycleService { Throwable warning = new Throwable( getString(R.string.title_no_sync, SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT) - .format((account.last_connected))), ex); + .format(account.last_connected)), ex); NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); nm.notify("receive", account.id.intValue(), Core.getNotificationError(this, "warning", account.name, warning, false) @@ -737,9 +737,9 @@ public class ServiceSynchronize extends LifecycleService { backoff = CONNECT_BACKOFF_START; // Record successful connection - Date last_connected = new Date(); - EntityLog.log(this, account.name + " set last_connected=" + last_connected); - db.account().setAccountConnected(account.id, last_connected.getTime()); + account.last_connected = new Date().getTime(); + EntityLog.log(this, account.name + " set last_connected=" + new Date(account.last_connected)); + db.account().setAccountConnected(account.id, account.last_connected); db.account().setAccountError(account.id, capIdle ? null : getString(R.string.title_no_idle)); NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);