Repository navigation
feat(shortcuts): support pinned shortcuts from "Add to home screen" - #1104
Merged
CreativeCodeCat merged 1 commit intoOct 2, 2026
Merged
Conversation
Handle ACTION_CONFIRM_PIN_SHORTCUT so browsers and other apps can add web apps and shortcuts to mLauncher (closes CodeWorksCreativeHub#283). - PinShortcutActivity lets the user name the shortcut before adding it - Pinned shortcuts are listed as AppListItem (activityClass = "shortcut:<id>") and can be launched, put on home or gestures, renamed, tagged, hidden, locked, pinned and deleted - Per-item settings use AppListItem.settingsKey so a shortcut never shares alias/lock/pin with the app that created it - Settings, home slots and gesture slots of shortcuts that disappear (removed by the app, app uninstalled) are cleaned up via LauncherApps.Callback and on app list refresh - Search, home widget, icons and home usage row handle shortcuts
Contributor
|
you have done a good job with this and it works just as i would have wanted it to. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Pre-Submission Checklist
bug/,feat/,clean/,release/)Before Submitting Your Pull Request
Closes #XXXXorFixes #XXXX(if applicable)Summary of Changes
Closes #283
As discussed in #283, mLauncher now answers Android's standard "Add to home screen" request (
ACTION_CONFIRM_PIN_SHORTCUT), the same API stock launchers use. Browsers and other apps can now add web apps and pinned shortcuts. There is no WebView: the shortcut still opens in the app that created it, throughLauncherApps.startShortcut. No new permissions are added. Users who never add a shortcut see no change.Key Changes
ui/shortcuts/PinShortcutActivityshows a small dialog where the user can name the shortcut before it is added. The dialog says where the shortcut comes from, e.g. "Web shortcut · Chrome" or "Shortcut · Maps". It uses a translucent theme, so the browser stays visible behind it.AppListItem, withactivityClass = "shortcut:<id>"andactivityPackageset to the creating app. This lets home slots, gestures, favorites and the file cache work without changing how items are stored.MainViewModel.launchAppstarts them via the newhelper/ShortcutHelper, so the lock check still applies.AppListItem.settingsKey(<package>/shortcut:<id>for shortcuts, the package for apps) is used for alias, tag, lock and pin. The behaviour for apps is unchanged. Renaming, hiding, locking or pinning a shortcut never affects the browser, and the reverse holds too.LauncherApps.Callbacktriggers the same cleanup and the home screen redraws. Cleanup only runs when every profile could be read, so a locked private space never loses settings.Test Information
Screenshots
Add shortcut dialog (on top of Chrome)
App list: shortcut with its own icon
Home screen: shortcut in a home slot