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

[Signin][Mice] Remove openAndroidAccountCreationScreen

This CL removes openAndroidAccountCreationScreen from
AccountManagementScreenHelper as this flow is almost never triggered
(see UMA link in the bug).

Bug: 938554
Change-Id: Id323846f45a4677cb164f92c6fb6f0498a20eb11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504015
Auto-Submit: Boris Sazonov <bsazonov@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638053}
parent f3926bd0
...@@ -4,34 +4,22 @@ ...@@ -4,34 +4,22 @@
package org.chromium.chrome.browser.signin; package org.chromium.chrome.browser.signin;
import android.content.Intent;
import android.provider.Settings;
import org.chromium.base.ContextUtils; import org.chromium.base.ContextUtils;
import org.chromium.base.ThreadUtils; import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.CalledByNative;
import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.profiles.ProfileAccountManagementMetrics;
import org.chromium.components.signin.GAIAServiceType; import org.chromium.components.signin.GAIAServiceType;
/** /**
* Stub entry points and implementation interface for the account management fragment delegate. * Stub entry points and implementation interface for the account management fragment delegate.
*/ */
public class AccountManagementScreenHelper { public class AccountManagementScreenHelper {
private static final String EXTRA_ACCOUNT_TYPES = "account_types";
private static final String EXTRA_VALUE_GOOGLE_ACCOUNTS = "com.google";
@CalledByNative @CalledByNative
private static void openAccountManagementScreen( private static void openAccountManagementScreen(
Profile profile, @GAIAServiceType int gaiaServiceType) { Profile profile, @GAIAServiceType int gaiaServiceType) {
ThreadUtils.assertOnUiThread(); ThreadUtils.assertOnUiThread();
if (gaiaServiceType == GAIAServiceType.GAIA_SERVICE_TYPE_SIGNUP) {
openAndroidAccountCreationScreen();
return;
}
if (ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)) { if (ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)) {
SigninUtils.openSettingsForAllAccounts(ContextUtils.getApplicationContext()); SigninUtils.openSettingsForAllAccounts(ContextUtils.getApplicationContext());
return; return;
...@@ -40,23 +28,6 @@ public class AccountManagementScreenHelper { ...@@ -40,23 +28,6 @@ public class AccountManagementScreenHelper {
AccountManagementFragment.openAccountManagementScreen(gaiaServiceType); AccountManagementFragment.openAccountManagementScreen(gaiaServiceType);
} }
/**
* Opens the Android account manager for adding or creating a Google account.
*/
private static void openAndroidAccountCreationScreen() {
logEvent(ProfileAccountManagementMetrics.DIRECT_ADD_ACCOUNT,
GAIAServiceType.GAIA_SERVICE_TYPE_SIGNUP);
Intent createAccountIntent = new Intent(Settings.ACTION_ADD_ACCOUNT);
createAccountIntent.putExtra(
EXTRA_ACCOUNT_TYPES, new String[]{EXTRA_VALUE_GOOGLE_ACCOUNTS});
createAccountIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
| Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
ContextUtils.getApplicationContext().startActivity(createAccountIntent);
}
/** /**
* Log a UMA event for a given metric and a signin type. * Log a UMA event for a given metric and a signin type.
* @param metric One of ProfileAccountManagementMetrics constants. * @param metric One of ProfileAccountManagementMetrics constants.
......
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