Loading core/java/android/content/pm/CrossProfileApps.java +2 −1 Original line number Diff line number Diff line Loading @@ -282,7 +282,8 @@ public class CrossProfileApps { final boolean isManagedProfile = mUserManager.isManagedProfile(userHandle.getIdentifier()); if (isManagedProfile) { return mResources.getDrawable(R.drawable.ic_corp_badge, null); return mContext.getPackageManager().getUserBadgeForDensityNoBackground( userHandle, /* density= */ 0); } else { return UserIcons.getDefaultUserIcon( mResources, UserHandle.USER_SYSTEM, true /* light */); Loading core/tests/coretests/src/android/content/pm/CrossProfileAppsTest.java +5 −1 Original line number Diff line number Diff line Loading @@ -71,6 +71,8 @@ public class CrossProfileAppsTest { private Resources mResources; @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Drawable mDrawable; @Mock private PackageManager mPackageManager; private CrossProfileApps mCrossProfileApps; @Before Loading @@ -87,6 +89,7 @@ public class CrossProfileAppsTest { Context.DEVICE_POLICY_SERVICE); when(mContext.getSystemService(Context.DEVICE_POLICY_SERVICE)).thenReturn( mDevicePolicyManager); when(mContext.getPackageManager()).thenReturn(mPackageManager); } @Before Loading Loading @@ -131,7 +134,8 @@ public class CrossProfileAppsTest { setValidTargetProfile(MANAGED_PROFILE); mCrossProfileApps.getProfileSwitchingIconDrawable(MANAGED_PROFILE); verify(mResources).getDrawable(R.drawable.ic_corp_badge, null); verify(mPackageManager).getUserBadgeForDensityNoBackground( MANAGED_PROFILE, /* density= */0); } @Test Loading Loading
core/java/android/content/pm/CrossProfileApps.java +2 −1 Original line number Diff line number Diff line Loading @@ -282,7 +282,8 @@ public class CrossProfileApps { final boolean isManagedProfile = mUserManager.isManagedProfile(userHandle.getIdentifier()); if (isManagedProfile) { return mResources.getDrawable(R.drawable.ic_corp_badge, null); return mContext.getPackageManager().getUserBadgeForDensityNoBackground( userHandle, /* density= */ 0); } else { return UserIcons.getDefaultUserIcon( mResources, UserHandle.USER_SYSTEM, true /* light */); Loading
core/tests/coretests/src/android/content/pm/CrossProfileAppsTest.java +5 −1 Original line number Diff line number Diff line Loading @@ -71,6 +71,8 @@ public class CrossProfileAppsTest { private Resources mResources; @Mock(answer = Answers.RETURNS_DEEP_STUBS) private Drawable mDrawable; @Mock private PackageManager mPackageManager; private CrossProfileApps mCrossProfileApps; @Before Loading @@ -87,6 +89,7 @@ public class CrossProfileAppsTest { Context.DEVICE_POLICY_SERVICE); when(mContext.getSystemService(Context.DEVICE_POLICY_SERVICE)).thenReturn( mDevicePolicyManager); when(mContext.getPackageManager()).thenReturn(mPackageManager); } @Before Loading Loading @@ -131,7 +134,8 @@ public class CrossProfileAppsTest { setValidTargetProfile(MANAGED_PROFILE); mCrossProfileApps.getProfileSwitchingIconDrawable(MANAGED_PROFILE); verify(mResources).getDrawable(R.drawable.ic_corp_badge, null); verify(mPackageManager).getUserBadgeForDensityNoBackground( MANAGED_PROFILE, /* density= */0); } @Test Loading