Commit b709fc42 authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][WebSignin] Add metric SuppressedSigninNotAllowed for account picker

This CL adds a metric SuppressedSigninNotAllowed to
Signin.AccountConsistencyPromoAction when web sign-in bottom sheet is
not shown due to sign-in not allowed.

Change-Id: Ic2f3334a28c1a46da955ed4bd1069f3d76651e00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2450090Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814583}
parent 0530d9e9
...@@ -85,6 +85,8 @@ public class SigninUtils { ...@@ -85,6 +85,8 @@ public class SigninUtils {
SigninManager signinManager = IdentityServicesProvider.get().getSigninManager( SigninManager signinManager = IdentityServicesProvider.get().getSigninManager(
Profile.getLastUsedRegularProfile()); Profile.getLastUsedRegularProfile());
if (!signinManager.isSignInAllowed()) { if (!signinManager.isSignInAllowed()) {
AccountPickerDelegate.recordAccountConsistencyPromoAction(
AccountConsistencyPromoAction.SUPPRESSED_SIGNIN_NOT_ALLOWED);
return; return;
} }
if (AccountManagerFacadeProvider.getInstance().tryGetGoogleAccounts().isEmpty()) { if (AccountManagerFacadeProvider.getInstance().tryGetGoogleAccounts().isEmpty()) {
......
...@@ -24,6 +24,7 @@ import java.lang.annotation.RetentionPolicy; ...@@ -24,6 +24,7 @@ import java.lang.annotation.RetentionPolicy;
AccountConsistencyPromoAction.SIGNED_IN_WITH_DEFAULT_ACCOUNT, AccountConsistencyPromoAction.SIGNED_IN_WITH_DEFAULT_ACCOUNT,
AccountConsistencyPromoAction.SIGNED_IN_WITH_NON_DEFAULT_ACCOUNT, AccountConsistencyPromoAction.SIGNED_IN_WITH_NON_DEFAULT_ACCOUNT,
AccountConsistencyPromoAction.SHOWN, AccountConsistencyPromoAction.SHOWN,
AccountConsistencyPromoAction.SUPPRESSED_SIGNIN_NOT_ALLOWED,
}) })
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
public @interface AccountConsistencyPromoAction { public @interface AccountConsistencyPromoAction {
...@@ -64,5 +65,11 @@ public @interface AccountConsistencyPromoAction { ...@@ -64,5 +65,11 @@ public @interface AccountConsistencyPromoAction {
*/ */
int SHOWN = 6; int SHOWN = 6;
int MAX = 7; /**
* Promo is not shown due to sign-in being disallowed either by an enterprise policy
* or by |Allow Chrome sign-in| toggle.
*/
int SUPPRESSED_SIGNIN_NOT_ALLOWED = 7;
int MAX = 8;
} }
...@@ -965,9 +965,13 @@ Unknown properties are collapsed to zero. --> ...@@ -965,9 +965,13 @@ Unknown properties are collapsed to zero. -->
User has selected the default account and signed in with it. User has selected the default account and signed in with it.
</int> </int>
<int value="5" label="SignedInWithNonDefaultAccount"> <int value="5" label="SignedInWithNonDefaultAccount">
User has selected one of the non default accounta and signed in with it. User has selected one of the non default account and signed in with it.
</int> </int>
<int value="6" label="Shown">The promo was shown to user.</int> <int value="6" label="Shown">The promo was shown to user.</int>
<int value="7" label="SuppressedSigninNotAllowed">
Promo is not shown due to sign-in being disallowed either by an enterprise
policy or by |Allow Chrome sign-in| toggle.
</int>
</enum> </enum>
<enum name="AccountManagerAccountAdditionSource"> <enum name="AccountManagerAccountAdditionSource">
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