Commit b78848e3 authored by Sam Maier's avatar Sam Maier Committed by Commit Bot

Android: AccountsChangedReceiver and SigninHelper explicitly using SERIAL_EXECUTOR

Currently, AsyncTask.execute() defaults to the SERIAL_EXECUTOR. This
exector is good for preventing concurrency errors since it guarantees
serial execution, but bad for performance since the entire app shares
this single queue.

It looks like these callsites are stuck with the SERIAL_EXECUTOR, since
they both call updateAccountRenameData() which is not thread safe.

Bug: 869907
Change-Id: I23ac4430cd10acb61842ee1b37c36d8c36f0f8af
Reviewed-on: https://chromium-review.googlesource.com/1161092Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581283}
parent 6465f049
...@@ -46,7 +46,7 @@ public class AccountsChangedReceiver extends BroadcastReceiver { ...@@ -46,7 +46,7 @@ public class AccountsChangedReceiver extends BroadcastReceiver {
continueHandleAccountChangeIfNeeded(appContext); continueHandleAccountChangeIfNeeded(appContext);
} }
}; };
task.execute(); task.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
} }
private void continueHandleAccountChangeIfNeeded(final Context context) { private void continueHandleAccountChangeIfNeeded(final Context context) {
......
...@@ -171,7 +171,7 @@ public class SigninHelper { ...@@ -171,7 +171,7 @@ public class SigninHelper {
} }
} }
}; };
task.execute(); task.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
return; return;
} }
......
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