Update text for User & accounts page.
- Add the user name to the Account preference group title. - Add the summary text to Emergency information. Bug: 34976320 Test: make RunSettingsRoboTests Change-Id: I771e355ce3b313ffa50feb5c5e7907b1f3857592
This commit is contained in:
@@ -190,6 +190,25 @@ public class AccountPreferenceControllerTest {
|
||||
verify(mScreen, times(2)).removePreference(preferenceGroup);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class})
|
||||
public void onResume_oneProfile_shouldSetAccountTitleWithUserName() {
|
||||
final List<UserInfo> infos = new ArrayList<>();
|
||||
infos.add(new UserInfo(1, "user 1", UserInfo.FLAG_MANAGED_PROFILE));
|
||||
when(mUserManager.isManagedProfile()).thenReturn(false);
|
||||
when(mUserManager.isLinkedUser()).thenReturn(false);
|
||||
when(mUserManager.getProfiles(anyInt())).thenReturn(infos);
|
||||
AccessiblePreferenceCategory preferenceGroup = mock(AccessiblePreferenceCategory.class);
|
||||
when(mAccountHelper.createAccessiblePreferenceCategory(any(Context.class))).thenReturn(
|
||||
preferenceGroup);
|
||||
|
||||
mController.onResume();
|
||||
|
||||
verify(preferenceGroup).setTitle(
|
||||
mContext.getString(R.string.account_for_section_header, "user 1"));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(shadows = {ShadowAccountManager.class, ShadowContentResolver.class})
|
||||
public void onResume_noPreferenceScreen_shouldNotCrash() {
|
||||
|
Reference in New Issue
Block a user