mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-26 23:50:58 +01:00
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user