Skip to content

Add mode selection buttons to Android notification#1828

Open
ArtemYurov wants to merge 3 commits intochen08209:mainfrom
ArtemYurov:claude/android-mode-selection-buttons-1ZeBr
Open

Add mode selection buttons to Android notification#1828
ArtemYurov wants to merge 3 commits intochen08209:mainfrom
ArtemYurov:claude/android-mode-selection-buttons-1ZeBr

Conversation

@ArtemYurov
Copy link

Summary

  • Add three mode switching buttons (Rule, Global, Direct) to Android notification
  • Display current active mode in notification content text before speed stats
  • Tapping a mode button changes the proxy mode in the app via TilePlugin MethodChannel

Test plan

  • Verified on physical Samsung device
  • Verified on Android emulator (API 36)
  • Test mode switching updates notification text correctly
  • Test mode switching reflects in app UI
  • Test notification persists after app backgrounded

…tion

Show three mode switching buttons in the notification with the current
mode displayed in the content text before speed stats. Tapping a mode
button changes the proxy mode in the app via TilePlugin MethodChannel.
- Add missing intent-filter entries for MODE_RULE, MODE_GLOBAL,
  MODE_DIRECT actions in AndroidManifest.xml so TempActivity can
  receive notification button intents
- Add fallback in handleChangeModeAction to update mode directly
  in Go core via Service.invokeAction when Flutter engine is not
  running
Replace PendingIntent.getActivity (TempActivity) with
PendingIntent.getBroadcast for mode switching buttons. Handle mode
change directly in service process via Core JNI call, bypassing the
app process entirely. Fixes mode buttons not working when app is
killed by system or Samsung battery optimization.
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.

1 participant