Add a bubble option to launcher long press menus

- Add a launcher "system shortcut" to bubble deep shortcuts or apps
- For shortcuts, save the shortcut info to use to produce the bubble
- Add an interface so that the system shortcut can call through to
  sysui proxy

Flag: com.android.wm.shell.enable_bubble_anything
Test: manual - enable the flag and try to bubble a shortcut via the
               longpress menu on launcher
             - try bubbling an app on launcher
             - try bubbling an app from the taskbar
Bug: 342245211
Change-Id: I1ef49e1628ba0be9cea05073ecd9cd66bf67f88f
This commit is contained in:
Mady Mellor
2024-02-05 09:30:03 -08:00
parent a5fa9bc911
commit 1cc100844c
8 changed files with 179 additions and 8 deletions
@@ -53,6 +53,7 @@ import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.util.LogUtils;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
@@ -69,6 +70,9 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba
private static final SystemShortcut.Factory<BaseTaskbarContext>
APP_INFO = SystemShortcut.AppInfo::new;
private static final SystemShortcut.Factory<BaseTaskbarContext>
BUBBLE = SystemShortcut.BubbleShortcut::new;
private final TaskbarActivityContext mContext;
private final PopupDataProvider mPopupDataProvider;
@@ -182,10 +186,13 @@ public class TaskbarPopupController implements TaskbarControllers.LoggableTaskba
// Create a Stream of all applicable system shortcuts
private Stream<SystemShortcut.Factory> getSystemShortcuts() {
// append split options to APP_INFO shortcut, the order here will reflect in the popup
return Stream.concat(
Stream.of(APP_INFO),
mControllers.uiController.getSplitMenuOptions()
);
ArrayList<SystemShortcut.Factory> shortcuts = new ArrayList<>();
shortcuts.add(APP_INFO);
shortcuts.addAll(mControllers.uiController.getSplitMenuOptions().toList());
if (com.android.wm.shell.Flags.enableBubbleAnything()) {
shortcuts.add(BUBBLE);
}
return shortcuts.stream();
}
@Override