Fix crash when Hide App Icon is enabled alongside dynamic shortcuts#46
Fix crash when Hide App Icon is enabled alongside dynamic shortcuts#46
Conversation
Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
7be6606 to
23794d0
Compare
There was a problem hiding this comment.
Pull request overview
Fixes an app-launch crash when dynamic shortcuts are registered while the launcher activity-alias is disabled (via the “Hide App Icon” setting), by guarding shortcut registration and proactively clearing shortcuts when hiding the icon.
Changes:
- Add a component-enabled-state guard in
MainApplication.setupShortcuts()to avoid callingShortcutManagerCompat.setDynamicShortcuts()when the launcher alias is disabled, and clear stale shortcuts instead. - Clear all dynamic shortcuts immediately when “Hide App Icon” is enabled in
AppSettingsActivity.onHideIconChange().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| app/src/main/java/com/github/kr328/clash/MainApplication.kt | Avoids shortcut registration when the launcher alias is disabled to prevent Launcher activity not found crashes. |
| app/src/main/java/com/github/kr328/clash/AppSettingsActivity.kt | Removes dynamic shortcuts right after hiding the icon so launcher shortcuts disappear without restart. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/Goooler/ClashMetaForAndroid/sessions/b7ffbbd6-0818-4a57-92ef-eb94bd6e358c Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
Updated in 6869549. The guard now skips shortcut registration (and clears any stale shortcuts) for all non-active states — |
|
Addressed to MetaCubeX#701. |
IllegalStateExceptioncrash inMainApplication.setupShortcuts()when "Hide App Icon" is enabledDISABLED,DISABLED_USER,DISABLED_UNTIL_USED) — not justDISABLEDAppSettingsActivity.onHideIconChange()when hiding the icon, so shortcuts disappear immediately✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.