summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-05-18 21:31:01 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-05-20 13:15:58 +0000
commit86df9ae6187efec36406388d78a84b56d8bfa371 (patch)
tree58a3973144ce686d6a2e54a5f4d38edff0ee773c
parentdbf72def667286640568e8dbb9e2df63359a839e (diff)
downloadmullvadvpn-86df9ae6187efec36406388d78a84b56d8bfa371.tar.xz
mullvadvpn-86df9ae6187efec36406388d78a84b56d8bfa371.zip
Consider unbound when `onUnbind` is called
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt12
1 files changed, 3 insertions, 9 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt
index 44cbf5ae6f..0cbc994b4f 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt
@@ -58,12 +58,6 @@ class MullvadVpnService : TalpidVpnService() {
}
}
- private var bindCount = 0
- set(value) {
- field = value
- isBound = bindCount != 0
- }
-
private var isBound = false
set(value) {
field = value
@@ -93,13 +87,13 @@ class MullvadVpnService : TalpidVpnService() {
}
override fun onBind(intent: Intent): IBinder {
- bindCount += 1
+ isBound = true
return super.onBind(intent) ?: binder
}
override fun onRebind(intent: Intent) {
- bindCount += 1
+ isBound = true
if (isStopping) {
restart()
@@ -112,7 +106,7 @@ class MullvadVpnService : TalpidVpnService() {
}
override fun onUnbind(intent: Intent): Boolean {
- bindCount -= 1
+ isBound = false
return true
}