Increase default user icon size.

This increases the size of the default user icon to the size specified
by the system (190dp), using the new method added in ag/16847427.

Bug: 218838295
Test: visual inspection
Test: make RunSettingsRoboTests -j40 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"
Change-Id: I3d88fbd1e148f0f63c796a272cd5771f4447812d
This commit is contained in:
Oli Lan
2022-02-11 11:27:21 +00:00
parent 6e6527657e
commit 43412bcccd
3 changed files with 30 additions and 4 deletions

View File

@@ -193,6 +193,29 @@ public class UserSettingsTest {
assertThat(UserSettings.assignDefaultPhoto(null, ACTIVE_USER_ID)).isFalse();
}
@Test
public void testAssignDefaultPhoto_hasDefaultUserIconSize() {
doReturn(mUserManager).when(mContext).getSystemService(Context.USER_SERVICE);
int size = 100;
try {
SettingsShadowResources.overrideResource(
com.android.internal.R.dimen.user_icon_size,
size);
assertThat(UserSettings.assignDefaultPhoto(mContext, ACTIVE_USER_ID)).isTrue();
int pxSize = mContext.getResources()
.getDimensionPixelSize(com.android.internal.R.dimen.user_icon_size);
ArgumentCaptor<Bitmap> captor = ArgumentCaptor.forClass(Bitmap.class);
verify(mUserManager).setUserIcon(eq(ACTIVE_USER_ID), captor.capture());
Bitmap bitmap = captor.getValue();
assertThat(bitmap.getWidth()).isEqualTo(pxSize);
assertThat(bitmap.getHeight()).isEqualTo(pxSize);
} finally {
SettingsShadowResources.reset();
}
}
@Test
public void testExitGuest_ShouldLogAction() {
mUserCapabilities.mIsGuest = true;