diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-05-20 10:35:37 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-05-20 10:35:37 -0300 |
| commit | bd084dffaabc4c8fd99e5575680c23f66282f188 (patch) | |
| tree | 6fc056f23f93f7f516f1afa02693d54fb7a00182 | |
| parent | dbf72def667286640568e8dbb9e2df63359a839e (diff) | |
| parent | fbf23db8737a566e704c4d6f14d68d3a7a3f7557 (diff) | |
| download | mullvadvpn-bd084dffaabc4c8fd99e5575680c23f66282f188.tar.xz mullvadvpn-bd084dffaabc4c8fd99e5575680c23f66282f188.zip | |
Merge branch 'fix-bind-handling'
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt | 12 |
2 files changed, 4 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ed5ec05f2..5741f2b9f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Line wrap the file at 100 chars. Th #### Android - Fix crash when that happened sometimes when the app tried to start the daemon service on recent Android versions. +- Fix quitting the app sometimes failing. ## [2020.5-beta1] - 2020-05-18 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 } |
