From 726fbcf00359f1b533c887ffc86053b9a5ee1ba3 Mon Sep 17 00:00:00 2001 From: Brandon Dayauon Date: Wed, 12 Mar 2025 18:52:45 +0000 Subject: Don't show system shortcuts for the psApp bug: 360313403 Test: manually - https://hsv.googleplex.com/5320142379548672 Flag: android.multiuser.enable_moving_content_into_private_space Change-Id: Ibb3322ab7793d3d9e925d5392a80bb6bd16568fd --- src/com/android/launcher3/popup/PopupContainerWithArrow.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java index e52ca6d23d..6a1f8cb3ea 100644 --- a/src/com/android/launcher3/popup/PopupContainerWithArrow.java +++ b/src/com/android/launcher3/popup/PopupContainerWithArrow.java @@ -16,9 +16,12 @@ package com.android.launcher3.popup; +import static android.multiuser.Flags.enableMovingContentIntoPrivateSpace; + import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_SHORTCUTS; import static com.android.launcher3.Utilities.squaredHypot; import static com.android.launcher3.Utilities.squaredTouchSlop; +import static com.android.launcher3.allapps.AlphabeticalAppsList.PRIVATE_SPACE_PACKAGE; import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_NOT_PINNABLE; import static com.android.launcher3.popup.PopupPopulator.MAX_SHORTCUTS; import static com.android.launcher3.util.Executors.MODEL_EXECUTOR; @@ -65,6 +68,7 @@ import com.android.launcher3.views.ActivityContext; import com.android.launcher3.views.BaseDragLayer; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.Optional; @@ -207,7 +211,10 @@ public class PopupContainerWithArrow container = (PopupContainerWithArrow) launcher.getLayoutInflater().inflate( R.layout.popup_container, launcher.getDragLayer(), false); container.configureForLauncher(launcher, item); - container.populateAndShowRows(icon, deepShortcutCount, systemShortcuts); + boolean shouldHideSystemShortcuts = enableMovingContentIntoPrivateSpace() + && Objects.equals(item.getTargetPackage(), PRIVATE_SPACE_PACKAGE); + container.populateAndShowRows(icon, deepShortcutCount, + shouldHideSystemShortcuts ? Collections.emptyList() : systemShortcuts); launcher.refreshAndBindWidgetsForPackageUser(PackageUserKey.fromItemInfo(item)); container.requestFocus(); return container; -- cgit v1.2.3-59-g8ed1b