Merge "Let psApp change according to theme." into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
95cb740e76
@@ -435,6 +435,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> 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();
|
||||
|
||||
@@ -190,15 +190,11 @@ public class PrivateProfileManager extends UserProfileManager {
|
||||
/** 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 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user