diff --git a/res/values/strings.xml b/res/values/strings.xml
index fd2300cec5e..fee92e76059 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -7814,10 +7814,10 @@
Recent apps, default apps
Notification access is not available for apps in the work profile.
-
+
Passwords and accounts
-
- No accounts added
+
+ Saved passwords, autofill, synced accounts
Default apps
diff --git a/src/com/android/settings/accounts/TopLevelAccountEntryPreferenceController.java b/src/com/android/settings/accounts/TopLevelAccountEntryPreferenceController.java
index 7cd746f445f..174ef0f7a92 100644
--- a/src/com/android/settings/accounts/TopLevelAccountEntryPreferenceController.java
+++ b/src/com/android/settings/accounts/TopLevelAccountEntryPreferenceController.java
@@ -17,19 +17,11 @@
package com.android.settings.accounts;
import android.content.Context;
-import android.icu.text.ListFormatter;
-import android.os.UserHandle;
-import android.text.BidiFormatter;
-import android.text.TextUtils;
import android.util.FeatureFlagUtils;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.FeatureFlags;
-import com.android.settingslib.accounts.AuthenticatorHelper;
-
-import java.util.ArrayList;
-import java.util.List;
public class TopLevelAccountEntryPreferenceController extends BasePreferenceController {
public TopLevelAccountEntryPreferenceController(Context context, String preferenceKey) {
@@ -47,29 +39,6 @@ public class TopLevelAccountEntryPreferenceController extends BasePreferenceCont
if (FeatureFlagUtils.isEnabled(mContext, FeatureFlags.SILKY_HOME)) {
return null;
}
-
- final AuthenticatorHelper authHelper = new AuthenticatorHelper(mContext,
- UserHandle.of(UserHandle.myUserId()), null /* OnAccountsUpdateListener */);
- final String[] types = authHelper.getEnabledAccountTypes();
- final BidiFormatter bidiFormatter = BidiFormatter.getInstance();
- final List summaries = new ArrayList<>();
-
- if (types == null || types.length == 0) {
- summaries.add(mContext.getString(R.string.account_dashboard_default_summary));
- } else {
- // Show up to 3 account types, ignore any null value
- int accountToAdd = Math.min(3, types.length);
-
- for (int i = 0; i < types.length && accountToAdd > 0; i++) {
- final CharSequence label = authHelper.getLabelForType(mContext, types[i]);
- if (TextUtils.isEmpty(label)) {
- continue;
- }
-
- summaries.add(bidiFormatter.unicodeWrap(label));
- accountToAdd--;
- }
- }
- return ListFormatter.getInstance().format(summaries);
+ return mContext.getString(R.string.account_dashboard_default_summary);
}
}
diff --git a/tests/robotests/src/com/android/settings/accounts/TopLevelAccountEntryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accounts/TopLevelAccountEntryPreferenceControllerTest.java
index 3a67d7fb04f..1d63cd11295 100644
--- a/tests/robotests/src/com/android/settings/accounts/TopLevelAccountEntryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accounts/TopLevelAccountEntryPreferenceControllerTest.java
@@ -23,63 +23,32 @@ import android.util.FeatureFlagUtils;
import com.android.settings.R;
import com.android.settings.core.FeatureFlags;
-import com.android.settings.testutils.shadow.ShadowAuthenticationHelper;
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
-import org.robolectric.annotation.Config;
@RunWith(RobolectricTestRunner.class)
-@Config(shadows = {ShadowAuthenticationHelper.class})
public class TopLevelAccountEntryPreferenceControllerTest {
private TopLevelAccountEntryPreferenceController mController;
private Context mContext;
- private String[] LABELS;
- private String[] TYPES;
@Before
public void setUp() {
mContext = RuntimeEnvironment.application;
mController = new TopLevelAccountEntryPreferenceController(mContext, "test_key");
- LABELS = ShadowAuthenticationHelper.getLabels();
- TYPES = ShadowAuthenticationHelper.getTypes();
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.SILKY_HOME, false);
}
- @After
- public void tearDown() {
- ShadowAuthenticationHelper.reset();
- }
-
- @Test
- public void updateSummary_hasAccount_shouldDisplayUpTo3AccountTypes() {
- assertThat(mController.getSummary())
- .isEqualTo(LABELS[0] + ", " + LABELS[1] + ", and " + LABELS[2]);
- }
-
@Test
public void updateSummary_noAccount_shouldDisplayDefaultSummary() {
- ShadowAuthenticationHelper.setEnabledAccount(null);
-
assertThat(mController.getSummary()).isEqualTo(
mContext.getText(R.string.account_dashboard_default_summary));
}
- @Test
- public void updateSummary_noAccountTypeLabel_shouldNotDisplayNullEntry() {
- final String[] enabledAccounts = {TYPES[0], "unlabeled_account_type", TYPES[1]};
- ShadowAuthenticationHelper.setEnabledAccount(enabledAccounts);
-
-
- // should only show the 2 accounts with labels
- assertThat(mController.getSummary()).isEqualTo(LABELS[0] + " and " + LABELS[1]);
- }
-
@Test
public void getSummary_silkyHomeEnabled_shouldBeNull() {
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.SILKY_HOME, true);