Commit ef2d8de4 authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Commit Bot

[Android] Don't show sign-in promo when user is in SignedIn state

SignInPreference class shows the signin promo when there is no primary
syncing account present in chrome. Because the user can now be in
signed in state this can show sync promos and signin promos at the same
time.
SigninInPreference class should instead check for if there is signed in
account in chrome.

Bug: 1126008
Change-Id: I45cd4a80b1206171d1634346865502fc1c94c1cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2398542
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806605}
parent 370a88d8
......@@ -16,6 +16,7 @@ import androidx.preference.PreferenceViewHolder;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.firstrun.FirstRunSignInProcessor;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
import org.chromium.chrome.browser.profiles.Profile;
......@@ -173,10 +174,15 @@ public class SignInPreference
return;
}
@ConsentLevel
int consentLevel =
ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
? ConsentLevel.NOT_REQUIRED
: ConsentLevel.SYNC;
CoreAccountInfo accountInfo =
IdentityServicesProvider.get()
.getIdentityManager(Profile.getLastUsedRegularProfile())
.getPrimaryAccountInfo(ConsentLevel.SYNC);
.getPrimaryAccountInfo(consentLevel);
if (accountInfo != null) {
setupSignedIn(accountInfo.getEmail());
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