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:
1 parent
a5fa9bc911
commit
1cc100844c
8 files changed
+179
-8
No files matched your search
@@ -25,6 +25,7 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.Flags;
|
||||
import com.android.launcher3.LauncherSettings;
|
||||
@@ -97,6 +98,8 @@ public class WorkspaceItemInfo extends ItemInfoWithIcon {
|
||||
|
||||
public int options;
|
||||
|
||||
@Nullable
|
||||
private ShortcutInfo mShortcutInfo = null;
|
||||
|
||||
public WorkspaceItemInfo() {
|
||||
itemType = LauncherSettings.Favorites.ITEM_TYPE_APPLICATION;
|
||||
@@ -175,6 +178,9 @@ public class WorkspaceItemInfo extends ItemInfoWithIcon {
|
||||
|
||||
public void updateFromDeepShortcutInfo(@NonNull final ShortcutInfo shortcutInfo,
|
||||
@NonNull final Context context) {
|
||||
if (com.android.wm.shell.Flags.enableBubbleAnything()) {
|
||||
mShortcutInfo = shortcutInfo;
|
||||
}
|
||||
// {@link ShortcutInfo#getActivity} can change during an update. Recreate the intent
|
||||
intent = ShortcutKey.makeIntent(shortcutInfo);
|
||||
title = shortcutInfo.getShortLabel();
|
||||
@@ -204,6 +210,11 @@ public class WorkspaceItemInfo extends ItemInfoWithIcon {
|
||||
: Arrays.stream(persons).map(Person::getKey).sorted().toArray(String[]::new);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ShortcutInfo getDeepShortcutInfo() {
|
||||
return mShortcutInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code true} if the shortcut is disabled due to its app being a lower version.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user