Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix service restart after app upgrade #99

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

efryntov
Copy link
Collaborator

Android blocks startService from background during app upgrade on some devices with the following error

ConduitUpdateReceiver [Error]: Failed to restart Conduit service after update: Not allowed to start service Intent { act=ca.psiphon.conduit.nativemodule.StartInProxyWithLastParams cmp=ca.psiphon.conduit/.nativemodule.ConduitService }: app is in background uid UidRecord{5cf9a53 u0a29 RCVR idle change:idle|uncached procs:1 seq(0,0,0)}

Use startForegroundService instead because ACTION_MY_PACKAGE_REPLACED broadcasts are exempted from background service start restrictions.

… upgrade

Android blocks startService from background during app upgrade on some devices. Use startForegroundService with ACTION_MY_PACKAGE_REPLACED exemption for reliable service restart.
@tmgrask tmgrask merged commit 6e1f7d9 into main Jan 24, 2025
2 checks passed
@tmgrask tmgrask deleted the e.fryntov/app-upgrade-restart-fix branch January 24, 2025 15:12
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