diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java index f223eaa600..bf02e03f99 100644 --- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java +++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java @@ -435,6 +435,7 @@ public class AlphabeticalAppsList implement } if (currentItem.itemInfo != null && Objects.equals( currentItem.itemInfo.getTargetPackage(), PRIVATE_SPACE_PACKAGE)) { + currentItem.itemInfo.bitmap = mPrivateProviderManager.preparePSBitmapInfo(); currentItem.itemInfo.bitmap.creationFlags |= FLAG_NO_BADGE; currentItem.itemInfo.contentDescription = mPrivateProviderManager.getPsAppContentDesc(); diff --git a/src/com/android/launcher3/allapps/PrivateProfileManager.java b/src/com/android/launcher3/allapps/PrivateProfileManager.java index 1bc1b17d15..0e6a5b867b 100644 --- a/src/com/android/launcher3/allapps/PrivateProfileManager.java +++ b/src/com/android/launcher3/allapps/PrivateProfileManager.java @@ -190,15 +190,11 @@ public class PrivateProfileManager extends UserProfileManager { /** Adds Private Space install app button to the layout. */ public void addPrivateSpaceInstallAppButton(List adapterItems) { Context context = mAllApps.getContext(); - // Prepare bitmapInfo - Intent.ShortcutIconResource shortcut = Intent.ShortcutIconResource.fromContext( - context, com.android.launcher3.R.drawable.private_space_install_app_icon); - BitmapInfo bitmapInfo = LauncherIcons.obtain(context).createIconBitmap(shortcut); PrivateSpaceInstallAppButtonInfo itemInfo = new PrivateSpaceInstallAppButtonInfo(); itemInfo.title = context.getResources().getString(R.string.ps_add_button_label); itemInfo.intent = mAppInstallerIntent; - itemInfo.bitmap = bitmapInfo; + itemInfo.bitmap = preparePSBitmapInfo(); itemInfo.contentDescription = context.getResources().getString( com.android.launcher3.R.string.ps_add_button_content_description); itemInfo.runtimeStatusFlags |= FLAG_NOT_PINNABLE; @@ -218,6 +214,13 @@ public class PrivateProfileManager extends UserProfileManager { .get(mAllApps.getContext()).getValue(PRIVATE_SPACE_HIDE_WHEN_LOCKED_URI, 0); } + BitmapInfo preparePSBitmapInfo() { + Context context = mAllApps.getContext(); + Intent.ShortcutIconResource shortcut = Intent.ShortcutIconResource.fromContext( + context, com.android.launcher3.R.drawable.private_space_install_app_icon); + return LauncherIcons.obtain(context).createIconBitmap(shortcut); + } + /** * Resets the current state of Private Profile, w.r.t. to Launcher. The decorator should only * be applied upon expand before animating. When collapsing, reset() will remove the decorator