Fix AsyncTask to handle exceptions in doInBackground am: 78a8e9d293
am: 7697ba2602
Change-Id: Iec4b849fb0badc94f37791bd7389eacc63b68bc2
This commit is contained in:
@@ -298,12 +298,16 @@ public abstract class AsyncTask<Params, Progress, Result> {
|
||||
mWorker = new WorkerRunnable<Params, Result>() {
|
||||
public Result call() throws Exception {
|
||||
mTaskInvoked.set(true);
|
||||
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
|
||||
//noinspection unchecked
|
||||
Result result = doInBackground(mParams);
|
||||
Binder.flushPendingCommands();
|
||||
return postResult(result);
|
||||
Result result = null;
|
||||
try {
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
|
||||
//noinspection unchecked
|
||||
result = doInBackground(mParams);
|
||||
Binder.flushPendingCommands();
|
||||
} finally {
|
||||
postResult(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user