Small improvement

pull/187/head
M66B 5 years ago
parent 2168d4d7de
commit 95319146d5

@ -206,7 +206,7 @@ public class EntityFolder extends EntityOrder implements Serializable {
static final int DEFAULT_KEEP = 30; // days static final int DEFAULT_KEEP = 30; // days
static final int DEFAULT_KEEP_DRAFTS = 180; // days static final int DEFAULT_KEEP_DRAFTS = 180; // days
private static final List<String> SYSTEM_FOLDER_SYNC = Collections.unmodifiableList(Arrays.asList( static final List<String> SYSTEM_FOLDER_SYNC = Collections.unmodifiableList(Arrays.asList(
INBOX, INBOX,
DRAFTS, DRAFTS,
SENT, SENT,
@ -214,7 +214,7 @@ public class EntityFolder extends EntityOrder implements Serializable {
TRASH, TRASH,
JUNK JUNK
)); ));
private static final List<Boolean> SYSTEM_FOLDER_POLL = Collections.unmodifiableList(Arrays.asList( static final List<Boolean> SYSTEM_FOLDER_POLL = Collections.unmodifiableList(Arrays.asList(
false, // inbox false, // inbox
false, // drafts false, // drafts
false, // sent false, // sent
@ -222,7 +222,7 @@ public class EntityFolder extends EntityOrder implements Serializable {
true, // trash true, // trash
true // junk true // junk
)); // MUST match SYSTEM_FOLDER_SYNC )); // MUST match SYSTEM_FOLDER_SYNC
private static final List<Boolean> SYSTEM_FOLDER_DOWNLOAD = Collections.unmodifiableList(Arrays.asList( static final List<Boolean> SYSTEM_FOLDER_DOWNLOAD = Collections.unmodifiableList(Arrays.asList(
true, // inbox true, // inbox
true, // drafts true, // drafts
false, // sent false, // sent

@ -1588,11 +1588,15 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
Throwable e = ex; Throwable e = ex;
while (e != null) { while (e != null) {
if (ConnectionHelper.isMaxConnections(e.getMessage())) { if (ConnectionHelper.isMaxConnections(e.getMessage())) {
for (String ft : new String[]{EntityFolder.TRASH, EntityFolder.JUNK}) { for (int i = 0; i < EntityFolder.SYSTEM_FOLDER_SYNC.size(); i++)
EntityFolder f = db.folder().getFolderByType(account.id, ft); if (EntityFolder.SYSTEM_FOLDER_POLL.get(i)) {
if (f != null) String ft = EntityFolder.SYSTEM_FOLDER_SYNC.get(i);
db.folder().setFolderPoll(f.id, true); EntityFolder f = db.folder().getFolderByType(account.id, ft);
} if (f != null && f.synchronize) {
EntityLog.log(ServiceSynchronize.this, account.name + "/" + f.name + "=poll");
db.folder().setFolderPoll(f.id, true);
}
}
} }
e = e.getCause(); e = e.getCause();
} }

Loading…
Cancel
Save