From fe791d11aa768ce93d128c459159b85d6ac6b332 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Thu, 18 Apr 2024 08:59:57 -0700 Subject: [PATCH] Fix install apps button - Setting the button's user via iteminfo to the privateprofile user doesn't let the user to go into the play store. This was initially done so that we can check the itemInfo to see if item is private space instead of just checking if the item has a decorationInfo for collapse animation. - The itemInfo change is reverted and we can check that case by checking with instanceOf PrivateSpaceInstallAppButtonInfo bug:335600922 Test manually video: https://drive.google.com/file/d/1N2zOHvPmBptBaBf8SCqjBAM6UhV0lQBI/view?usp=sharing Flag: ACONFIG com.android.launcher3.enable_private_space TRUNKFOOD Change-Id: I09f22c9df5b4f9408eea6995eafea83e30c93a0d --- src/com/android/launcher3/allapps/PrivateProfileManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/allapps/PrivateProfileManager.java b/src/com/android/launcher3/allapps/PrivateProfileManager.java index 90ed3eb5cc..8fa07772f9 100644 --- a/src/com/android/launcher3/allapps/PrivateProfileManager.java +++ b/src/com/android/launcher3/allapps/PrivateProfileManager.java @@ -159,7 +159,6 @@ public class PrivateProfileManager extends UserProfileManager { itemInfo.contentDescription = context.getResources().getString( com.android.launcher3.R.string.ps_add_button_content_description); itemInfo.runtimeStatusFlags |= FLAG_NOT_PINNABLE; - itemInfo.user = getProfileUser(); BaseAllAppsAdapter.AdapterItem item = new BaseAllAppsAdapter.AdapterItem(VIEW_TYPE_ICON); item.itemInfo = itemInfo; @@ -747,6 +746,7 @@ public class PrivateProfileManager extends UserProfileManager { } boolean isPrivateSpaceItem(BaseAllAppsAdapter.AdapterItem item) { - return getItemInfoMatcher().test(item.itemInfo) || item.decorationInfo != null; + return getItemInfoMatcher().test(item.itemInfo) || item.decorationInfo != null + || (item.itemInfo instanceof PrivateSpaceInstallAppButtonInfo); } }