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