Commit d8d381f7 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Gerrit Code Review
Browse files

Merge "Issue 186618:run cts...

Merge "Issue 186618:run cts com.android.cts.appsecurity.DocumentsTest--testTree--fail5.1_r2 [root cause]in testTree method, the second writeFully(...) task may be executed in the AsyncTask after readFully(...) task, or they may be executed at the same time. Since the read and write operation is not protected by synchronized. Two tasks running on different thread my access doc.contents at the same time, and may lead to a null pointer crash [changesY] using AsyncTask.SERIAL_EXECUTOR instead of AsyncTask.THREAD_POOL_EXECUTOR"
parents f4c93a6f 1da654cc
......@@ -252,7 +252,7 @@ public class MyDocumentsProvider extends DocumentsProvider {
}
return null;
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
return pipe[1];
} else {
new AsyncTask<Void, Void, Void>() {
......@@ -275,7 +275,7 @@ public class MyDocumentsProvider extends DocumentsProvider {
}
return null;
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
return pipe[0];
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment