diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-12-16 19:40:32 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-12-17 17:03:26 +0000 |
| commit | 87e515f32d7e34985d2c5cdf57102ea629245909 (patch) | |
| tree | 02b811ece52b82b1abdb9808118e7096578fdedb /android/src | |
| parent | 6bb5719b352c3aa96052bcb61f5853dc3023b52d (diff) | |
| download | mullvadvpn-87e515f32d7e34985d2c5cdf57102ea629245909.tar.xz mullvadvpn-87e515f32d7e34985d2c5cdf57102ea629245909.zip | |
Replace `resetComplete` with `isStopping` flag
Diffstat (limited to 'android/src')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt | 9 |
1 files changed, 4 insertions, 5 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 fb2c92736c..f22094dfe9 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt @@ -3,7 +3,6 @@ package net.mullvad.mullvadvpn.service import android.content.Intent import android.os.Binder import android.os.IBinder -import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.Deferred import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope @@ -16,7 +15,7 @@ import net.mullvad.talpid.util.EventNotifier class MullvadVpnService : TalpidVpnService() { private val binder = LocalBinder() - private var resetComplete: CompletableDeferred<Unit>? = null + private var isStopping = false private lateinit var daemon: Deferred<MullvadDaemon> private lateinit var connectionProxy: ConnectionProxy @@ -34,10 +33,10 @@ class MullvadVpnService : TalpidVpnService() { } override fun onRebind(intent: Intent) { - resetComplete?.let { reset -> + if (isStopping) { tearDown() setUp() - reset.complete(Unit) + isStopping = false } } @@ -88,7 +87,7 @@ class MullvadVpnService : TalpidVpnService() { } private fun stop() { - resetComplete = CompletableDeferred() + isStopping = true serviceNotifier.notify(null) |
