Commit db9ed303 authored by Boris Sazonov's avatar Boris Sazonov Committed by Commit Bot

[Signin][Android] Replace Handler with ThreadUtils in SigninManager

This CL replaces 'new Handler().post(...)' statements with
'ThreadUtils.postOnUiThread(...)'. This is safe, as all SigninManager
methods are invoked on the UI thread.

Bug: 906193
Change-Id: I9638a96074762b5db6e3cfb9d80ea48685b499f3
Reviewed-on: https://chromium-review.googlesource.com/c/1343257Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609650}
parent 05048d0f
...@@ -8,7 +8,6 @@ import android.accounts.Account; ...@@ -8,7 +8,6 @@ import android.accounts.Account;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.os.Handler;
import org.chromium.base.ActivityState; import org.chromium.base.ActivityState;
import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.ApiCompatibilityUtils;
...@@ -312,7 +311,7 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed ...@@ -312,7 +311,7 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
} }
private void notifySignInAllowedChanged() { private void notifySignInAllowedChanged() {
new Handler().post(() -> { ThreadUtils.postOnUiThread(() -> {
for (SignInAllowedObserver observer : mSignInAllowedObservers) { for (SignInAllowedObserver observer : mSignInAllowedObservers) {
observer.onSignInAllowedChanged(); observer.onSignInAllowedChanged();
} }
...@@ -671,7 +670,7 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed ...@@ -671,7 +670,7 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed
assert mSignOutState != null; assert mSignOutState != null;
if (mSignOutState.callback != null) { if (mSignOutState.callback != null) {
new Handler().post(mSignOutState.callback); ThreadUtils.postOnUiThread(mSignOutState.callback);
} }
mSignOutState = null; mSignOutState = null;
......
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