Ensure AndroidSyncSettings is used only from the UI thread
After crrev.com/c/2415150, the class is no longer used from a background thread. This allows for a number of simplifications. - Removing all the synchronization code (synchronized blocks and lock). - updateSyncability() is now synchronous, so no need to expose the artificial callback parameter in ctor/updateAccount(). The associated code in the test file (CallbackHelper and updateAccountAndWait()) can also be removed. This also requires some adaptations: - Every call to the public API is guarded by assertOnUiThread(). - Tests that called the API from the test thread now use the methods in AndroidSyncSettingsTestUtil on runOnUIThreadBlocking(). Non-related to all this, the CL also takes care of the quick cleanup post crrev.com/c/2415150: AndroidSyncSettingsObserver implementations don't have to post a task anymore, since they are now notified directly in the UI thread. Fixed: 1028568 Change-Id: I8526cf67b26c97b3303510fbf0f4f0fc737617f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2414194 Commit-Queue: Victor Vianna <victorvianna@google.com> Reviewed-by:Marc Treib <treib@chromium.org> Cr-Commit-Position: refs/heads/master@{#808359}
Showing
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment