Fix rebinding to the service

This commit is contained in:
albexk 2023-12-05 16:57:53 +03:00
parent dc6e3ec53b
commit 656223f57d

View file

@ -216,7 +216,16 @@ class AmneziaVpnService : VpnService() {
clientMessenger.reset()
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() {