mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-03 18:26:20 +00:00
Handle auth connection error
This commit is contained in:
parent
7512f6ec5f
commit
85356f24bc
1 changed files with 8 additions and 1 deletions
|
@ -48,6 +48,7 @@ import androidx.lifecycle.MutableLiveData;
|
||||||
import androidx.lifecycle.Observer;
|
import androidx.lifecycle.Observer;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
|
import com.sun.mail.iap.ConnectionException;
|
||||||
import com.sun.mail.imap.IMAPFolder;
|
import com.sun.mail.imap.IMAPFolder;
|
||||||
import com.sun.mail.imap.IMAPStore;
|
import com.sun.mail.imap.IMAPStore;
|
||||||
|
|
||||||
|
@ -855,13 +856,19 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||||
boolean max = isMaxConnections(c.getMessage());
|
boolean max = isMaxConnections(c.getMessage());
|
||||||
if (max)
|
if (max)
|
||||||
state.setMaxConnections();
|
state.setMaxConnections();
|
||||||
if (c instanceof IOException || max) {
|
if (max ||
|
||||||
|
c instanceof IOException ||
|
||||||
|
c instanceof ConnectionException ||
|
||||||
|
"failed to connect".equals(ex.getMessage())) {
|
||||||
ioError = true;
|
ioError = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
c = c.getCause();
|
c = c.getCause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!BuildConfig.PLAY_STORE_RELEASE)
|
||||||
|
Log.e(ex);
|
||||||
|
|
||||||
if (!ioError) {
|
if (!ioError) {
|
||||||
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
nm.notify("receive:" + account.id, 1,
|
nm.notify("receive:" + account.id, 1,
|
||||||
|
|
Loading…
Reference in a new issue