Merge "Let psApp change according to theme." into main
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index f223eaa..bf02e03 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -435,6 +435,7 @@
}
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 1bc1b17..0e6a5b8 100644
--- a/src/com/android/launcher3/allapps/PrivateProfileManager.java
+++ b/src/com/android/launcher3/allapps/PrivateProfileManager.java
@@ -190,15 +190,11 @@
/** Adds Private Space install app button to the layout. */
public void addPrivateSpaceInstallAppButton(List<BaseAllAppsAdapter.AdapterItem> 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 @@
.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