summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author Brandon Dayauon <brdayauon@google.com> 2025-03-13 11:03:01 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2025-03-13 11:03:01 -0700
commitd6e638c5cd880752746c0c419872feea12534c99 (patch)
treeab974b655f45da473b7167a3bd9fb8d618b163cd /src
parentbf31635e254d5dbea5a45af390768c8741ce5d87 (diff)
parent0e3de5621131082d246c39428373cde8910f2447 (diff)
Merge changes from topic "privateProfileMoveContent" into main
* changes: Change private space app content description Don't show system shortcuts for the psApp
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/allapps/AlphabeticalAppsList.java2
-rw-r--r--src/com/android/launcher3/allapps/PrivateProfileManager.java7
-rw-r--r--src/com/android/launcher3/popup/PopupContainerWithArrow.java9
3 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index 870c891f47..f223eaa600 100644
--- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -436,6 +436,8 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
if (currentItem.itemInfo != null && Objects.equals(
currentItem.itemInfo.getTargetPackage(), PRIVATE_SPACE_PACKAGE)) {
currentItem.itemInfo.bitmap.creationFlags |= FLAG_NO_BADGE;
+ currentItem.itemInfo.contentDescription =
+ mPrivateProviderManager.getPsAppContentDesc();
privateSpaceAppIndex = i;
}
}
diff --git a/src/com/android/launcher3/allapps/PrivateProfileManager.java b/src/com/android/launcher3/allapps/PrivateProfileManager.java
index 609edd2c99..1bc1b17d15 100644
--- a/src/com/android/launcher3/allapps/PrivateProfileManager.java
+++ b/src/com/android/launcher3/allapps/PrivateProfileManager.java
@@ -142,6 +142,7 @@ public class PrivateProfileManager extends UserProfileManager {
private PrivateSpaceSettingsButton mPrivateSpaceSettingsButton;
@Nullable
private ConstraintLayout mFloatingMaskView;
+ private final String mPrivateSpaceAppContentDesc;
private final String mLockedStateContentDesc;
private final String mUnLockedStateContentDesc;
@@ -157,6 +158,8 @@ public class PrivateProfileManager extends UserProfileManager {
UI_HELPER_EXECUTOR.post(() -> initializeInBackgroundThread(appContext));
mPsHeaderHeight = mAllApps.getContext().getResources().getDimensionPixelSize(
R.dimen.ps_header_height);
+ mPrivateSpaceAppContentDesc = mAllApps.getContext()
+ .getString(R.string.ps_app_content_description);
mLockedStateContentDesc = mAllApps.getContext()
.getString(R.string.ps_container_lock_button_content_description);
mUnLockedStateContentDesc = mAllApps.getContext()
@@ -929,6 +932,10 @@ public class PrivateProfileManager extends UserProfileManager {
return mPsHeaderHeight;
}
+ String getPsAppContentDesc() {
+ return mPrivateSpaceAppContentDesc;
+ }
+
boolean isPrivateSpaceItem(BaseAllAppsAdapter.AdapterItem item) {
return getItemInfoMatcher().test(item.itemInfo) || item.decorationInfo != null
|| (item.itemInfo instanceof PrivateSpaceInstallAppButtonInfo);
diff --git a/src/com/android/launcher3/popup/PopupContainerWithArrow.java b/src/com/android/launcher3/popup/PopupContainerWithArrow.java
index aad1400865..39f68bfe70 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<T extends Context & ActivityContext>
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;