Merge "Restrict launcher bubble shortcut option." into main

This commit is contained in:
Treehugger Robot
2025-05-21 17:48:53 -07:00
committed by Android (Google) Code Review
@@ -426,6 +426,16 @@ public abstract class SystemShortcut<T extends ActivityContext> extends ItemInfo
&& !(itemInfo instanceof WorkspaceItemInfo)) {
return null;
}
if (itemInfo instanceof WorkspaceItemInfo) {
// Don't show bubble shortcut option for non-resizeable apps on small screens.
// TODO(b/411558731): isPhone just checks for smallest width < 600dp, so it
// basically is a check for small screens including Foldables when folded.
// However, the name is a bit misleading, so considering renaming.
WorkspaceItemInfo wsItemInfo = (WorkspaceItemInfo) itemInfo;
if (wsItemInfo.isNonResizeable() && activity.getDeviceProfile().isPhone) {
return null;
}
}
return new BubbleShortcut<>(activity, itemInfo, originalView);
};