Fix rebinding to the service
This commit is contained in:
parent
dc6e3ec53b
commit
656223f57d
1 changed files with 10 additions and 1 deletions
|
@ -216,7 +216,16 @@ class AmneziaVpnService : VpnService() {
|
||||||
clientMessenger.reset()
|
clientMessenger.reset()
|
||||||
if (isUnknown || isDisconnected) stopSelf()
|
if (isUnknown || isDisconnected) stopSelf()
|
||||||
}
|
}
|
||||||
return super.onUnbind(intent)
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onRebind(intent: Intent?) {
|
||||||
|
Log.d(TAG, "onRebind by $intent")
|
||||||
|
if (intent?.action != "android.net.VpnService") {
|
||||||
|
isServiceBound = true
|
||||||
|
if (isConnected) launchSendingStatistics()
|
||||||
|
}
|
||||||
|
super.onRebind(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onRevoke() {
|
override fun onRevoke() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue