ITADN

Legacy shortcut widget can't be place in workspace

#6814Openvalidcube 创建于 2026-05-30
bugstatus: reviewed
V
validcubecommented
### Describe the bug Some widgets that are essentially just shortcut can't be placed because AOSP removed the ability to create legacy shortcut since AOSP Launcher3 14 (see https://cs.android.com/android/_/android/platform/packages/apps/Launcher3/+/84b48d8deba68d47ea17bc89b7db97b612541d8a) hence widget like settings shortcut or Lawnchair's own shortcut can't be place. See [`[completeAddShortcut]`](https://github.com/LawnchairLauncher/lawnchair/blob/16-dev/src/com/android/launcher3/Launcher.java#L1375) around [L1386-L1389](https://github.com/LawnchairLauncher/lawnchair/blob/16-dev/src/com/android/launcher3/Launcher.java#L1386-L1389) because legacy shortcut will return null info so AOSP will ignore those request to add shortcut because it's not a valid shortcut thus why we can't place shortcut widget in workspace. This may be the reason why some people are unable to add widgets even though they have the build with BAL fix from Lawnchair 16 and the Lawnchair 15 Beta 2 backport. ### Steps to reproduce Any version of unreleased Lawnchair 13 all the way to unreleased Lawnchair 16 0. Launch Lawnchair 1. Try to place a shortcut widget, like Android Settings' shortcut widget 2. Observe the widget disappeared without any reason. ### Expected behavior Lawnchair must place those legacy shortcut down or handle it into deep shortcuts. ### Screenshots _No response_ ### Device information - Device: Google Pixel 7, Nothing (3a)-series, Honor 10 lite - OS: Pixel (Android 17 QPR1 Beta 3), Nothing OS (Android 16, Magisk rooted), EMUI 10 (Android 10) ### App version Inclusive all starting from Lawnchair 13 ### Additional context We can just reimplement the feature by reverting or carefully reimplement it. See [Lawnchair 13's `[completeAddShortcut]` L1454-1469](https://github.com/LawnchairLauncher/lawnchair/blob/13-dev/src/com/android/launcher3/Launcher.java#L1454-L1469)` Note: * Strangely, Lawnchair 16 is able to add widget on Honor 10 lite (Android 10) just fine however they will not be any background for them and they're all in low-res. Tested with Lawnchair's open allapps shortcut.
1 条评论