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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user