mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-06 11:39:49 +00:00
parent
a721196cdb
commit
b7f5bfe55e
1 changed files with 7 additions and 13 deletions
|
@ -130,7 +130,8 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
|||
try {
|
||||
onPreExecute(args);
|
||||
} catch (Throwable ex) {
|
||||
error(args, ex);
|
||||
Log.e(ex);
|
||||
onException(args, ex);
|
||||
}
|
||||
|
||||
future = getExecutor(context).submit(new Runnable() {
|
||||
|
@ -194,7 +195,8 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
|||
try {
|
||||
onPostExecute(args);
|
||||
} catch (Throwable ex) {
|
||||
error(args, ex);
|
||||
Log.e(ex);
|
||||
onException(args, ex);
|
||||
} finally {
|
||||
try {
|
||||
if (ex == null) {
|
||||
|
@ -207,9 +209,10 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
|||
|
||||
onExecuted(args, (T) data);
|
||||
} else
|
||||
error(args, ex);
|
||||
onException(args, ex);
|
||||
} catch (Throwable ex) {
|
||||
error(args, ex);
|
||||
Log.e(ex);
|
||||
onException(args, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -218,15 +221,6 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
|||
});
|
||||
}
|
||||
|
||||
void error(Bundle args, Throwable ex) {
|
||||
try {
|
||||
Log.e(ex);
|
||||
onException(args, ex);
|
||||
} catch (Throwable exex) {
|
||||
Log.e(exex);
|
||||
}
|
||||
}
|
||||
|
||||
void cancel(Context context) {
|
||||
if (future != null)
|
||||
if (future.cancel(false)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue