|
|
|
@ -66,7 +66,6 @@ import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
|
|
|
import java.util.concurrent.RejectedExecutionException;
|
|
|
|
|
|
|
|
|
|
import javax.mail.AuthenticationFailedException;
|
|
|
|
|
import javax.mail.Folder;
|
|
|
|
@ -788,6 +787,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final DB db = DB.getInstance(this);
|
|
|
|
|
final ExecutorService executor =
|
|
|
|
|
Helper.getBackgroundExecutor(1, "account_" + account.id);
|
|
|
|
|
|
|
|
|
|
state.setBackoff(CONNECT_BACKOFF_START);
|
|
|
|
|
while (state.isRunning()) {
|
|
|
|
@ -835,9 +836,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
final ExecutorService executor =
|
|
|
|
|
Helper.getBackgroundExecutor(1, "account_" + account.id);
|
|
|
|
|
|
|
|
|
|
final Map<EntityFolder, IMAPFolder> mapFolders = new HashMap<>();
|
|
|
|
|
List<Thread> idlers = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
@ -1194,7 +1192,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
" operations=" + partitions.get(key).size());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
final long sequence = state.getSequence(folder.id, key.getPriority());
|
|
|
|
|
|
|
|
|
|
executor.submit(new Helper.PriorityRunnable(key.getPriority(), key.getOrder()) {
|
|
|
|
@ -1275,10 +1272,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} catch (RejectedExecutionException ex) {
|
|
|
|
|
Log.i(ex);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1433,8 +1426,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
executor.shutdown();
|
|
|
|
|
|
|
|
|
|
// Close folders
|
|
|
|
|
for (EntityFolder folder : mapFolders.keySet())
|
|
|
|
|
if (folder.synchronize && !folder.poll && mapFolders.get(folder) != null) {
|
|
|
|
|