Skip to content

Commit

Permalink
Fix Random Service starts in the client (#3492)
Browse files Browse the repository at this point in the history
  • Loading branch information
strseb authored May 11, 2022
1 parent e8243bb commit a137512
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ class VPNService : android.net.VpnService() {
intent?.let {
if (intent.getBooleanExtra("startOnly", false)) {
Log.i(tag, "Start only!")
return super.onStartCommand(intent, flags, startId)
// If this is a Start Only request, the client will soon
// bind to the service anyway.
// We should return START_NOT_STICKY so that after an unbind()
// the OS will not try to restart the service.
return START_NOT_STICKY
}
}
// This start is from always-on
Expand Down

0 comments on commit a137512

Please sign in to comment.