Closed SaadAhmedGit closed 1 month ago
Access to the variable vpnAdapter
isn't synchronised, and so the check for vpnAdapter == null
in the io
coroutine is suspect.
Anyhow, thanks for the fix. I'll tag Hussain for review.
Access to the variable
vpnAdapter
isn't synchronised, and so the check forvpnAdapter == null
in theio
coroutine is suspect.
But super.onRevoke()
only calls stopself()
which doesn't use vpnAdapter
. Even in signalStopService()
, stopSelf()
doesn't wait for stopVpnAdapter()
to finish.
vpnAdapter == null
check is problematic regardless of what calls what, since one coroutine setting vpnAdapter
to null
will not be known to another coroutine unless there is a lock/serialisation (via Volatile).
Don't worry about it too much, we'll take a look at it as a separate issue.
Closing because already fixed.
@SaadAhmedGit Thank you!!
fixes: #1545
This small change fixes the issue mentioned in the referenced issue. When another app takes over the VPN,
onRevoke()
method of theVpnService()
is called which wasn't overriden to callstopVpnAdapter()
which closes the tunnel.Overriding
onRevoke()
to callstopVpnAdapter()
ensures the tunnel is closed gracefully when another app starts the VPN.