summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt13
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/ServiceInstance.kt7
2 files changed, 5 insertions, 15 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 9224246eb0..9a3962bcb7 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt
@@ -185,8 +185,6 @@ class MullvadVpnService : TalpidVpnService() {
}
}
- val accountCache = AccountCache(daemon, settingsListener)
-
val connectionProxy = ConnectionProxy(this, daemon).apply {
when (pendingAction) {
PendingAction.Connect -> {
@@ -203,16 +201,7 @@ class MullvadVpnService : TalpidVpnService() {
pendingAction = null
}
- val locationInfoCache = LocationInfoCache(daemon, connectionProxy, connectivityListener)
-
- instance = ServiceInstance(
- daemon,
- accountCache,
- connectionProxy,
- connectivityListener,
- locationInfoCache,
- settingsListener
- )
+ instance = ServiceInstance(daemon, connectionProxy, connectivityListener, settingsListener)
}
private fun stop() {
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ServiceInstance.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ServiceInstance.kt
index ceb7be792c..37f90f332c 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ServiceInstance.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/ServiceInstance.kt
@@ -2,14 +2,15 @@ package net.mullvad.mullvadvpn.service
import net.mullvad.talpid.ConnectivityListener
-data class ServiceInstance(
+class ServiceInstance(
val daemon: MullvadDaemon,
- val accountCache: AccountCache,
val connectionProxy: ConnectionProxy,
val connectivityListener: ConnectivityListener,
- val locationInfoCache: LocationInfoCache,
val settingsListener: SettingsListener
) {
+ val accountCache = AccountCache(daemon, settingsListener)
+ val locationInfoCache = LocationInfoCache(daemon, connectionProxy, connectivityListener)
+
fun onDestroy() {
accountCache.onDestroy()
connectionProxy.onDestroy()