Skip to content

Commit

Permalink
Remove AddEduAccountFromAccountSettingsForSupervisedUsers Flag
Browse files Browse the repository at this point in the history
- This feature is now launched so this change will remove all usages of the feature flag

- Delete strings and drawables that are now unused

Bug: b/280043325
Change-Id: I96b252c75180b128f82fc7b838e0fd15fbabcfa1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4506687
Commit-Queue: Liza Bipin <mlbipin@google.com>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Alex Ilin <alexilin@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1147128}
  • Loading branch information
Liza Bipin authored and Chromium LUCI CQ committed May 22, 2023
1 parent 977e981 commit 3c70fd8
Show file tree
Hide file tree
Showing 20 changed files with 8 additions and 246 deletions.
6 changes: 0 additions & 6 deletions chrome/android/chrome_java_resources.gni
Expand Up @@ -38,7 +38,6 @@ chrome_java_resources = [
"java/res/drawable-hdpi/ic_dialer_not_found_red_40dp.png",
"java/res/drawable-hdpi/ic_download_pause.png",
"java/res/drawable-hdpi/ic_download_pending.png",
"java/res/drawable-hdpi/ic_drive_site_white_24dp.png",
"java/res/drawable-hdpi/ic_email_googblue_36dp.png",
"java/res/drawable-hdpi/ic_error_grey800_24dp_filled.png",
"java/res/drawable-hdpi/ic_error_outline_red_24dp.png",
Expand Down Expand Up @@ -108,7 +107,6 @@ chrome_java_resources = [
"java/res/drawable-mdpi/ic_dialer_not_found_red_40dp.png",
"java/res/drawable-mdpi/ic_download_pause.png",
"java/res/drawable-mdpi/ic_download_pending.png",
"java/res/drawable-mdpi/ic_drive_site_white_24dp.png",
"java/res/drawable-mdpi/ic_email_googblue_36dp.png",
"java/res/drawable-mdpi/ic_error_grey800_24dp_filled.png",
"java/res/drawable-mdpi/ic_error_outline_red_24dp.png",
Expand Down Expand Up @@ -178,7 +176,6 @@ chrome_java_resources = [
"java/res/drawable-xhdpi/ic_dialer_not_found_red_40dp.png",
"java/res/drawable-xhdpi/ic_download_pause.png",
"java/res/drawable-xhdpi/ic_download_pending.png",
"java/res/drawable-xhdpi/ic_drive_site_white_24dp.png",
"java/res/drawable-xhdpi/ic_email_googblue_36dp.png",
"java/res/drawable-xhdpi/ic_error_grey800_24dp_filled.png",
"java/res/drawable-xhdpi/ic_error_outline_red_24dp.png",
Expand Down Expand Up @@ -242,7 +239,6 @@ chrome_java_resources = [
"java/res/drawable-xxhdpi/ic_dialer_not_found_red_40dp.png",
"java/res/drawable-xxhdpi/ic_download_pause.png",
"java/res/drawable-xxhdpi/ic_download_pending.png",
"java/res/drawable-xxhdpi/ic_drive_site_white_24dp.png",
"java/res/drawable-xxhdpi/ic_email_googblue_36dp.png",
"java/res/drawable-xxhdpi/ic_error_grey800_24dp_filled.png",
"java/res/drawable-xxhdpi/ic_error_outline_red_24dp.png",
Expand Down Expand Up @@ -304,7 +300,6 @@ chrome_java_resources = [
"java/res/drawable-xxxhdpi/ic_devices_16dp.png",
"java/res/drawable-xxxhdpi/ic_dialer_icon_blue_40dp.png",
"java/res/drawable-xxxhdpi/ic_dialer_not_found_red_40dp.png",
"java/res/drawable-xxxhdpi/ic_drive_site_white_24dp.png",
"java/res/drawable-xxxhdpi/ic_email_googblue_36dp.png",
"java/res/drawable-xxxhdpi/ic_error_grey800_24dp_filled.png",
"java/res/drawable-xxxhdpi/ic_error_outline_red_24dp.png",
Expand Down Expand Up @@ -650,7 +645,6 @@ chrome_java_resources = [
"java/res/values/values.xml",
"java/res/xml/about_chrome_preferences.xml",
"java/res/xml/account_management_preferences.xml",
"java/res/xml/account_management_preferences_legacy.xml",
"java/res/xml/ad_services_config.xml",
"java/res/xml/bookmark_widget_info.xml",
"java/res/xml/clear_browsing_data_preferences_tab.xml",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Expand Up @@ -5,14 +5,13 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<!--Used only when ChromeFeatureList.ADD_EDU_ACCOUNT_FROM_ACCOUNT_SETTINGS_FOR_SUPERVISED_USERS is enabled-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<org.chromium.components.browser_ui.settings.TextMessagePreference
android:key="parent_account_category"
tools:summary="@string/account_management_two_parent_names"/>
tools:summary="@string/account_management_header_two_parent_names"/>

<PreferenceCategory
android:key="accounts_category"
Expand Down

This file was deleted.

Expand Up @@ -7,8 +7,6 @@
import android.accounts.Account;
import android.content.Context;
import android.content.Intent;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.UserManager;

Expand All @@ -20,9 +18,7 @@
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceScreen;

import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.preferences.Pref;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.profiles.ProfileAccountManagementMetrics;
Expand All @@ -34,15 +30,13 @@
import org.chromium.chrome.browser.signin.services.SigninManager;
import org.chromium.chrome.browser.signin.services.SigninManager.SignInStateObserver;
import org.chromium.chrome.browser.signin.services.SigninMetricsUtils;
import org.chromium.chrome.browser.superviseduser.FilteringBehavior;
import org.chromium.chrome.browser.sync.SyncService;
import org.chromium.chrome.browser.ui.signin.SignOutDialogCoordinator;
import org.chromium.chrome.browser.ui.signin.SignOutDialogCoordinator.Listener;
import org.chromium.chrome.browser.ui.signin.SigninUtils;
import org.chromium.components.browser_ui.settings.ChromeBasePreference;
import org.chromium.components.browser_ui.settings.CustomDividerFragment;
import org.chromium.components.browser_ui.settings.SettingsLauncher;
import org.chromium.components.browser_ui.styles.SemanticColorUtils;
import org.chromium.components.prefs.PrefService;
import org.chromium.components.signin.AccountManagerFacade;
import org.chromium.components.signin.AccountManagerFacadeProvider;
Expand Down Expand Up @@ -173,18 +167,9 @@ public void update() {
mProfileDataCache.getProfileDataOrDefault(mSignedInAccountName);
getActivity().setTitle(SyncSettingsUtils.getDisplayableFullNameOrEmailWithPreference(
profileData, getContext(), SyncSettingsUtils.TitlePreference.FULL_NAME));

if (ChromeFeatureList.isEnabled(
ChromeFeatureList.ADD_EDU_ACCOUNT_FROM_ACCOUNT_SETTINGS_FOR_SUPERVISED_USERS)) {
addPreferencesFromResource(R.xml.account_management_preferences);
configureSignOutSwitch();
configureChildAccountPreferences();
} else {
addPreferencesFromResource(R.xml.account_management_preferences_legacy);
configureSignOutSwitch();
configureChildAccountPreferencesLegacy();
}

addPreferencesFromResource(R.xml.account_management_preferences);
configureSignOutSwitch();
configureChildAccountPreferences();
AccountManagerFacadeProvider.getInstance().getAccounts().then(this::updateAccountsList);
}

Expand Down Expand Up @@ -266,52 +251,6 @@ private void configureChildAccountPreferences() {
}
}

private void configureChildAccountPreferencesLegacy() {
Preference parentAccounts = findPreference(PREF_PARENT_ACCOUNTS);
Preference childContent = findPreference(PREF_CHILD_CONTENT);
if (mProfile.isChild()) {
PrefService prefService = UserPrefs.get(mProfile);

String firstParent = prefService.getString(Pref.SUPERVISED_USER_CUSTODIAN_EMAIL);
String secondParent =
prefService.getString(Pref.SUPERVISED_USER_SECOND_CUSTODIAN_EMAIL);
String parentText;

if (!secondParent.isEmpty()) {
parentText = getString(
R.string.account_management_two_parent_names, firstParent, secondParent);
} else if (!firstParent.isEmpty()) {
parentText = getString(R.string.account_management_one_parent_name, firstParent);
} else {
parentText = getString(R.string.account_management_no_parental_data);
}
parentAccounts.setSummary(parentText);

final int childContentSummary;
int defaultBehavior =
prefService.getInteger(Pref.DEFAULT_SUPERVISED_USER_FILTERING_BEHAVIOR);
if (defaultBehavior == FilteringBehavior.BLOCK) {
childContentSummary = R.string.account_management_child_content_approved;
} else if (prefService.getBoolean(Pref.SUPERVISED_USER_SAFE_SITES)) {
childContentSummary = R.string.account_management_child_content_filter_mature;
} else {
childContentSummary = R.string.account_management_child_content_all;
}
childContent.setSummary(childContentSummary);

Drawable newIcon = ApiCompatibilityUtils.getDrawable(
getResources(), R.drawable.ic_drive_site_white_24dp);
newIcon.mutate().setColorFilter(
SemanticColorUtils.getDefaultIconColor(getContext()), PorterDuff.Mode.SRC_IN);
childContent.setIcon(newIcon);
} else {
PreferenceScreen prefScreen = getPreferenceScreen();
prefScreen.removePreference(findPreference(PREF_PARENTAL_SETTINGS));
prefScreen.removePreference(parentAccounts);
prefScreen.removePreference(childContent);
}
}

private void updateAccountsList(List<Account> accounts) {
// This method is called asynchronously on accounts fetched from AccountManagerFacade.
// Make sure the fragment is alive before updating preferences.
Expand Down Expand Up @@ -339,13 +278,7 @@ private void updateAccountsList(List<Account> accounts) {
accountsCategory.addPreference(createAccountPreference(account));
}
}

if (!mProfile.isChild()
|| ChromeFeatureList.isEnabled(
ChromeFeatureList
.ADD_EDU_ACCOUNT_FROM_ACCOUNT_SETTINGS_FOR_SUPERVISED_USERS)) {
accountsCategory.addPreference(createAddAccountPreference());
}
accountsCategory.addPreference(createAddAccountPreference());
}

private Preference createAccountPreference(Account account) {
Expand Down
Expand Up @@ -90,30 +90,15 @@ public void setUp() {
@Test
@MediumTest
@Feature("RenderTest")
@DisableFeatures({ChromeFeatureList.ADD_EDU_ACCOUNT_FROM_ACCOUNT_SETTINGS_FOR_SUPERVISED_USERS,
ChromeFeatureList.HIDE_NON_DISPLAYABLE_ACCOUNT_EMAIL})
public void
testAccountManagementFragmentView() throws Exception {
@DisableFeatures(ChromeFeatureList.HIDE_NON_DISPLAYABLE_ACCOUNT_EMAIL)
public void testAccountManagementFragmentView() throws Exception {
mSigninTestRule.addTestAccountThenSigninAndEnableSync();
mSettingsActivityTestRule.startSettingsActivity();
View view = mSettingsActivityTestRule.getFragment().getView();
onViewWaiting(allOf(is(view), isDisplayed()));
mRenderTestRule.render(view, "account_management_fragment_view");
}

@Test
@MediumTest
@Feature("RenderTest")
@EnableFeatures(ChromeFeatureList.ADD_EDU_ACCOUNT_FROM_ACCOUNT_SETTINGS_FOR_SUPERVISED_USERS)
public void testAccountManagementFragmentViewWithAddEduAccountEnabled() throws Exception {
mSigninTestRule.addTestAccountThenSigninAndEnableSync();
mSettingsActivityTestRule.startSettingsActivity();
View view = mSettingsActivityTestRule.getFragment().getView();
onViewWaiting(allOf(is(view), isDisplayed()));
mRenderTestRule.render(
view, "account_management_fragment_view_with_add_account_for_supervised_users");
}

@Test
@MediumTest
@Feature("RenderTest")
Expand All @@ -140,26 +125,6 @@ public void testSignedInAccountShownOnTop() throws Exception {
mRenderTestRule.render(view, "account_management_fragment_signed_in_account_on_top");
}

@Test
@MediumTest
@Feature("RenderTest")
@DisableFeatures({ChromeFeatureList.ADD_EDU_ACCOUNT_FROM_ACCOUNT_SETTINGS_FOR_SUPERVISED_USERS})
public void testAccountManagementViewForChildAccount() throws Exception {
mSigninTestRule.addAccountAndWaitForSeeding(CHILD_ACCOUNT_NAME);
final Profile profile = TestThreadUtils.runOnUiThreadBlockingNoException(
Profile::getLastUsedRegularProfile);
CriteriaHelper.pollUiThread(profile::isChild);
mSettingsActivityTestRule.startSettingsActivity();
CriteriaHelper.pollUiThread(() -> {
return mSettingsActivityTestRule.getFragment()
.getProfileDataCacheForTesting()
.hasProfileDataForTesting(CHILD_ACCOUNT_NAME);
});
View view = mSettingsActivityTestRule.getFragment().getView();
onViewWaiting(allOf(is(view), isDisplayed()));
mRenderTestRule.render(view, "account_management_fragment_for_child_account");
}

@Test
@MediumTest
@EnableFeatures({ChromeFeatureList.HIDE_NON_DISPLAYABLE_ACCOUNT_EMAIL})
Expand Down Expand Up @@ -215,9 +180,7 @@ public void testAccountManagementViewForChildAccountWithNonDisplayableAccountEma
@Test
@MediumTest
@Feature("RenderTest")
@EnableFeatures(ChromeFeatureList.ADD_EDU_ACCOUNT_FROM_ACCOUNT_SETTINGS_FOR_SUPERVISED_USERS)
public void testAccountManagementViewForChildAccountWithAddEduAccountEnabled()
throws Exception {
public void testAccountManagementViewForChildAccount() throws Exception {
mSigninTestRule.addAccountAndWaitForSeeding(CHILD_ACCOUNT_NAME);
final Profile profile = TestThreadUtils.runOnUiThreadBlockingNoException(
Profile::getLastUsedRegularProfile);
Expand All @@ -237,35 +200,8 @@ public void testAccountManagementViewForChildAccountWithAddEduAccountEnabled()
@Test
@MediumTest
@Feature("RenderTest")
@DisableFeatures({ChromeFeatureList.ADD_EDU_ACCOUNT_FROM_ACCOUNT_SETTINGS_FOR_SUPERVISED_USERS})
public void testAccountManagementViewForChildAccountWithSecondaryEduAccount() throws Exception {
mSigninTestRule.addAccount(CHILD_ACCOUNT_NAME);
// The code under test doesn't care what account type this is, though in practice only
// EDU accounts are supported on devices where the primary account is a child account.
mSigninTestRule.addAccount("account@school.com");
mSigninTestRule.waitForSeeding();
final Profile profile = TestThreadUtils.runOnUiThreadBlockingNoException(
Profile::getLastUsedRegularProfile);
CriteriaHelper.pollUiThread(profile::isChild);
mSettingsActivityTestRule.startSettingsActivity();
CriteriaHelper.pollUiThread(() -> {
return mSettingsActivityTestRule.getFragment()
.getProfileDataCacheForTesting()
.hasProfileDataForTesting(CHILD_ACCOUNT_NAME);
});
View view = mSettingsActivityTestRule.getFragment().getView();
onViewWaiting(allOf(is(view), isDisplayed()));
mRenderTestRule.render(view, "account_management_fragment_for_child_and_edu_accounts");
}

@Test
@MediumTest
@Feature("RenderTest")
@EnableFeatures(ChromeFeatureList.ADD_EDU_ACCOUNT_FROM_ACCOUNT_SETTINGS_FOR_SUPERVISED_USERS)
public void
testAccountManagementViewForChildAccountWithSecondaryEduAccountAndAddEduAccountEnabled()
throws Exception {
mSigninTestRule.addAccount(CHILD_ACCOUNT_NAME);
mSigninTestRule.addAccount("account@school.com");
mSigninTestRule.waitForSeeding();
final Profile profile = TestThreadUtils.runOnUiThreadBlockingNoException(
Expand Down
7 changes: 0 additions & 7 deletions chrome/browser/about_flags.cc
Expand Up @@ -4598,13 +4598,6 @@ const FeatureEntry kFeatureEntries[] = {
{"cormorant", flag_descriptions::kCormorantName,
flag_descriptions::kCormorantDescription, kOsAndroid,
FEATURE_VALUE_TYPE(feed::kCormorant)},
{"add-edu-account-for-supervised-users",
flag_descriptions::kAddEduAccountFromAccountSettingsForSupervisedUsersName,
flag_descriptions::
kAddEduAccountFromAccountSettingsForSupervisedUsersDescription,
kOsAndroid,
FEATURE_VALUE_TYPE(
chrome::android::kAddEduAccountFromAccountSettingsForSupervisedUsers)},
{"hide-non-displayable-account-email",
flag_descriptions::kHideNonDisplayableAccountEmailName,
flag_descriptions::kHideNonDisplayableAccountEmailDescription, kOsAndroid,
Expand Down
8 changes: 0 additions & 8 deletions chrome/browser/flag-metadata.json
Expand Up @@ -68,14 +68,6 @@
"owners": [ "thanhdng", "alanlxl" ],
"expiry_milestone": 118
},
{
"name": "add-edu-account-for-supervised-users",
"owners": [
"mlbipin",
"chrome-kids-eng@google.com"
],
"expiry_milestone": 118
},
{
"name": "add-identity-in-can-make-payment",
"owners": [ "rouslan", "chrome-payments-team@google.com" ],
Expand Down
7 changes: 0 additions & 7 deletions chrome/browser/flag_descriptions.cc
Expand Up @@ -44,13 +44,6 @@ const char kPdfUseSkiaRendererName[] =
const char kPdfUseSkiaRendererDescription[] = "Use Skia as the PDF renderer.";
#endif

extern const char kAddEduAccountFromAccountSettingsForSupervisedUsersName[] =
"Add Edu Account From Account Settings For Supervised Users";
extern const char
kAddEduAccountFromAccountSettingsForSupervisedUsersDescription[] =
"Enables supervised users to add additional Edu accounts and "
"simplifies settings UI";

const char kAppDeduplicationServiceFondueName[] =
"Identify duplicate app groups.";
const char kAppDeduplicationServiceFondueDescription[] =
Expand Down
4 changes: 0 additions & 4 deletions chrome/browser/flag_descriptions.h
Expand Up @@ -59,10 +59,6 @@ extern const char kPdfUseSkiaRendererName[];
extern const char kPdfUseSkiaRendererDescription[];
#endif

extern const char kAddEduAccountFromAccountSettingsForSupervisedUsersName[];
extern const char
kAddEduAccountFromAccountSettingsForSupervisedUsersDescription[];

extern const char kAlignWakeUpsName[];
extern const char kAlignWakeUpsDescription[];

Expand Down

0 comments on commit 3c70fd8

Please sign in to comment.