fix(android): start vpn via foreground service path#13
Merged
Hidden-Node merged 2 commits intoMay 14, 2026
Merged
Conversation
Contributor
AmirrezaFarnamTaheri
commented
May 11, 2026
- Use ContextCompat.startForegroundService for connect requests
- promote the VpnService immediately when handling ACTION_CONNECT, matching Android foreground-service requirements before the longer profile/core startup work begins.
- Bound the partial wake lock to the existing long SOCKS startup window plus a small grace period so setup work is protected without holding an indefinite wake lock.
Use ContextCompat.startForegroundService for connect requests and promote the VpnService immediately when handling ACTION_CONNECT, matching Android foreground-service requirements before the longer profile/core startup work begins. Bound the partial wake lock to the existing long SOCKS startup window plus a small grace period so setup work is protected without holding an indefinite wake lock.
Add structured Android-side logs around VPN teardown so support reports can show TUN close, DNS-aware TUN bridge stop, Go core stop, Android job cleanup, and foreground notification cleanup. Also log that the current Android VPN route is IPv4-only, making the existing behavior explicit without changing core routing or mobile bridge behavior.
Owner
|
Thanks for this great contribution! The move to a foreground service and the smart Wake Lock handling are excellent improvements for the app's stability and battery life. Solid work, appreciate it! |
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.