diff options
Diffstat (limited to 'android/src')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/LocationInfoCache.kt | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/LocationInfoCache.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/LocationInfoCache.kt index acfb93296b..38e0dc209a 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/LocationInfoCache.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/LocationInfoCache.kt @@ -138,7 +138,7 @@ class LocationInfoCache( val fetchId = newFetchId() val previousFetch = activeFetch - activeFetch = GlobalScope.launch(Dispatchers.Main) { + activeFetch = GlobalScope.launch(Dispatchers.Default) { val delays = ExponentialBackoff().apply { scale = 50 cap = 30 /* min */ * 60 /* s */ * 1000 /* ms */ @@ -151,7 +151,7 @@ class LocationInfoCache( while (newLocation == null && fetchId == fetchIdCounter) { delay(delays.next()) - newLocation = executeFetch().await() + newLocation = daemon.getCurrentLocation() } synchronized(this@LocationInfoCache) { @@ -165,8 +165,4 @@ class LocationInfoCache( } } } - - private fun executeFetch() = GlobalScope.async(Dispatchers.Default) { - daemon.getCurrentLocation() - } } |
