|
|
@ -490,6 +490,9 @@ public class ServiceSynchronize extends LifecycleService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
// Process pending operations
|
|
|
|
|
|
|
|
processOperations(folder, isession, istore, ifolder);
|
|
|
|
|
|
|
|
|
|
|
|
// Listen for new and deleted messages
|
|
|
|
// Listen for new and deleted messages
|
|
|
|
ifolder.addMessageCountListener(new MessageCountAdapter() {
|
|
|
|
ifolder.addMessageCountListener(new MessageCountAdapter() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -715,14 +718,6 @@ public class ServiceSynchronize extends LifecycleService {
|
|
|
|
lbm.registerReceiver(processFolder, f);
|
|
|
|
lbm.registerReceiver(processFolder, f);
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// Process pending folder operations
|
|
|
|
|
|
|
|
Log.i(Helper.TAG, "listen process folder");
|
|
|
|
|
|
|
|
for (final EntityFolder folder : folders.keySet())
|
|
|
|
|
|
|
|
if (!EntityFolder.OUTBOX.equals(folder.type))
|
|
|
|
|
|
|
|
lbm.sendBroadcast(new Intent(ACTION_PROCESS_OPERATIONS)
|
|
|
|
|
|
|
|
.setType("account/" + account.id)
|
|
|
|
|
|
|
|
.putExtra("folder", folder.id));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Keep store alive
|
|
|
|
// Keep store alive
|
|
|
|
while (state.running && istore.isConnected()) {
|
|
|
|
while (state.running && istore.isConnected()) {
|
|
|
|
Log.i(Helper.TAG, "Checking folders");
|
|
|
|
Log.i(Helper.TAG, "Checking folders");
|
|
|
|