Skip to content

Fix external Clash control shortcuts - #805

Merged
wwqgtxx merged 1 commit into
MetaCubeX:mainfrom
ZenX404:fix-external-control-shortcuts
Aug 16, 2026
Merged

wwqgtxx merged 1 commit into
MetaCubeX:mainfrom
ZenX404:fix-external-control-shortcuts

Conversation

@ZenX404

@ZenX404 ZenX404 commented Jul 25, 2026

Copy link
Copy Markdown

Summary

Fix external Clash control shortcuts when the app's UI process has not initialized or refreshed its cached service state.

Changes

  • Use StatusClient to query the service state for start and toggle actions.
  • Always dispatch the stop request for ACTION_STOP_CLASH.
  • Remove the dependency on Remote.broadcasts.clashRunning from external shortcut handling.

Result

The stop shortcut can now stop Clash even when the main application interface has not been opened.

Related discussion: #775

Replace the cached Remote.broadcasts.clashRunning state with a direct StatusClient query for start and toggle actions.

Always dispatch the stop request for ACTION_STOP_CLASH, ensuring the stop shortcut works even when the app process has not initialized or refreshed its cached service state.
@wwqgtxx
wwqgtxx merged commit 12d4a5f into MetaCubeX:main Aug 16, 2026
1 check passed
cscws added a commit to cscws/ClashMetaForAndroid that referenced this pull request Sep 8, 2026
Upstream commits: 2.11.32/2.11.33 version bumps, dependency updates (MetaCubeX#796, MetaCubeX#804), CI actions bump, external Clash control shortcut fix (MetaCubeX#805).
cscws pushed a commit to cscws/ClashMetaForAndroid that referenced this pull request Sep 8, 2026
Replace the cached Remote.broadcasts.clashRunning state with a direct StatusClient query for start and toggle actions.

Always dispatch the stop request for ACTION_STOP_CLASH, ensuring the stop shortcut works even when the app process has not initialized or refreshed its cached service state.
cscws added a commit to cscws/ClashMetaForAndroid that referenced this pull request Sep 8, 2026
Upstream commits: 2.11.32/2.11.33 version bumps, dependency updates (MetaCubeX#796, MetaCubeX#804), CI actions bump, external Clash control shortcut fix (MetaCubeX#805).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants