AsyncTask terminating with exception calls onCancelled
Test: cts/tests/tests/os/src/android/os/cts/AsyncTaskTest.java b/30304893 Change-Id: Icb50cda8026ddd70d457b5e62eb29c81313ee47d
This commit is contained in:
@@ -304,6 +304,9 @@ public abstract class AsyncTask<Params, Progress, Result> {
|
|||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
result = doInBackground(mParams);
|
result = doInBackground(mParams);
|
||||||
Binder.flushPendingCommands();
|
Binder.flushPendingCommands();
|
||||||
|
} catch (Throwable tr) {
|
||||||
|
mCancelled.set(true);
|
||||||
|
throw tr;
|
||||||
} finally {
|
} finally {
|
||||||
postResult(result);
|
postResult(result);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user