pin-shortcut: Move flag to lse

Bug: 375648361
Test: EXEMPT changing flag
Flag: EXEMPT moving flag
Change-Id: I13065db6dcf42e26e87aba27f395e4345c569d6f
This commit is contained in:
Wen-Chien Wang committed 2025-04-01 18:29:59 +00:00
1 parent f0ab519440
commit 9d962c8c3e
4 files changed
+6 -11

No files matched your search

-7
View File
@@ -524,13 +524,6 @@ flag {
bug: "377496684"
}
flag {
name: "enable_pinning_app_with_context_menu"
namespace: "launcher"
description: "Add options to pin/unpin to taskbar to app context menus."
bug: "375648361"
}
flag {
name: "enable_launcher_icon_shapes"
namespace: "launcher"
@@ -19,6 +19,7 @@ import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_ALL_APP
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_HOTSEAT;
import static com.android.launcher3.model.data.AppInfo.COMPONENT_KEY_COMPARATOR;
import static com.android.launcher3.util.SplitConfigurationOptions.getLogEventForPosition;
import static com.android.window.flags.Flags.enablePinningAppWithContextMenu;
import android.content.Intent;
import android.content.pm.LauncherApps;
@@ -147,7 +148,7 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba
ItemInfo itemInfo = null;
if (icon.getTag() instanceof ItemInfo item && ShortcutUtil.supportsShortcuts(item)) {
itemInfo = item;
} else if (Flags.enablePinningAppWithContextMenu()
} else if (enablePinningAppWithContextMenu()
&& icon.getTag() instanceof SingleTask task) {
Task.TaskKey key = task.getTask().getKey();
AppInfo appInfo = getApp(
@@ -172,7 +173,7 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba
.collect(Collectors.toList());
// TODO(b/375648361): Revisit to see if this can be implemented within getSystemShortcuts().
if (Flags.enablePinningAppWithContextMenu()) {
if (enablePinningAppWithContextMenu()) {
SystemShortcut shortcut = createPinShortcut(context, itemInfo, icon);
if (shortcut != null) {
systemShortcuts.add(0, shortcut);
@@ -31,6 +31,7 @@ import com.android.quickstep.RecentsModel
import com.android.quickstep.util.DesktopTask
import com.android.quickstep.util.GroupTask
import com.android.quickstep.util.SingleTask
import com.android.window.flags.Flags.enablePinningAppWithContextMenu
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus
import java.io.PrintWriter
@@ -331,7 +332,7 @@ class TaskbarRecentAppsController(context: Context, private val recentsModel: Re
.filter {
it is SingleTask &&
it.task.key.id in deduplicatedDesktopTasks.map { it.task.key.id } &&
(!Flags.enablePinningAppWithContextMenu() ||
(!enablePinningAppWithContextMenu() ||
shownHotseatItems.none { hotseatItem ->
it.containsPackage(
hotseatItem.targetPackage,
@@ -23,7 +23,6 @@ import android.util.SparseArray
import com.android.launcher3.AbstractFloatingView
import com.android.launcher3.BubbleTextView
import com.android.launcher3.Flags.FLAG_ENABLE_MULTI_INSTANCE_MENU_TASKBAR
import com.android.launcher3.Flags.FLAG_ENABLE_PINNING_APP_WITH_CONTEXT_MENU
import com.android.launcher3.R
import com.android.launcher3.model.data.AppInfo
import com.android.launcher3.model.data.WorkspaceItemInfo
@@ -36,6 +35,7 @@ import com.android.launcher3.taskbar.rules.TaskbarWindowSandboxContext
import com.android.launcher3.util.LauncherMultivalentJUnit
import com.android.launcher3.util.LauncherMultivalentJUnit.EmulatedDevices
import com.android.quickstep.util.GroupTask
import com.android.window.flags.Flags.FLAG_ENABLE_PINNING_APP_WITH_CONTEXT_MENU
import com.google.common.truth.Truth.assertThat
import org.junit.Before
import org.junit.Rule