mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-25 09:17:58 +00:00
Properly abort operations
This commit is contained in:
parent
d5e1cf1ae1
commit
f11867bedb
2 changed files with 4 additions and 1 deletions
|
@ -530,6 +530,8 @@ class Core {
|
|||
|
||||
if (ops.size() == 0)
|
||||
state.batchCompleted(folder.id, priority, sequence);
|
||||
else
|
||||
state.error(new OperationCanceledException("Processing"), session);
|
||||
} finally {
|
||||
Log.i(folder.name + " end process state=" + state + " pending=" + ops.size());
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ import android.net.NetworkInfo;
|
|||
import android.net.NetworkRequest;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.OperationCanceledException;
|
||||
import android.os.PowerManager;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.text.TextUtils;
|
||||
|
@ -1358,7 +1359,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
ServiceSynchronize.this,
|
||||
folder.name + " " + Log.formatThrowable(ex, false));
|
||||
db.folder().setFolderError(folder.id, Log.formatThrowable(ex));
|
||||
state.error(ex, session);
|
||||
state.error(new OperationCanceledException("Process"), session);
|
||||
} finally {
|
||||
if (shouldClose) {
|
||||
if (ifolder != null && ifolder.isOpen()) {
|
||||
|
|
Loading…
Reference in a new issue