Commit 51e77f2e authored by Boris Sazonov's avatar Boris Sazonov Committed by Commit Bot

[Signin][Android] Fix sign-out check in AccountManagementFragment

Revise primary account check in AccountManagementFragment's sign-out
flow. Since sign-out doesn't depend on sync consent - primary account
should be queried using ConsentLevel.NOT_REQUIRED.

Bug: 1130526
Change-Id: I411dc2d9312793ed0e80e7b63dce584a5cc026b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421897Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809288}
parent 27dec6c1
......@@ -360,9 +360,10 @@ public class AccountManagementFragment extends PreferenceFragmentCompat
public void onSignOutClicked(boolean forceWipeUserData) {
// In case the user reached this fragment without being signed in, we guard the sign out so
// we do not hit a native crash.
if (!IdentityServicesProvider.get()
if (IdentityServicesProvider.get()
.getIdentityManager(Profile.getLastUsedRegularProfile())
.hasPrimaryAccount()) {
.getPrimaryAccountInfo(ConsentLevel.NOT_REQUIRED)
== null) {
return;
}
final DialogFragment clearDataProgressDialog = new ClearDataProgressDialog();
......
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