diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-01-06 21:07:42 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-04-16 12:14:04 +0000 |
| commit | e09a6fbc19241a0c843d847662c60de3d5407273 (patch) | |
| tree | 46e7272828a76811ff0f3b4cbc6e1fb68a09afcf | |
| parent | c08d85d52b50c0d5497dd822cde13b30f2f654b8 (diff) | |
| download | mullvadvpn-e09a6fbc19241a0c843d847662c60de3d5407273.tar.xz mullvadvpn-e09a6fbc19241a0c843d847662c60de3d5407273.zip | |
Use service side `AppVersionInfoCache`
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt index f44b045a15..4a753bc01d 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt @@ -28,8 +28,6 @@ class ServiceEndpoint( private val listeners = mutableSetOf<Messenger>() private val registrationQueue: SendChannel<Messenger> = startRegistrator() - private var version: String? = null - internal val dispatcher = DispatchingHandler(looper) { message -> Request.fromMessage(message) } @@ -42,6 +40,7 @@ class ServiceEndpoint( val settingsListener = SettingsListener(this) val accountCache = AccountCache(this) + val appVersionInfoCache = AppVersionInfoCache(this) val customDns = CustomDns(this) val keyStatusListener = KeyStatusListener(this) val locationInfoCache = LocationInfoCache(this) @@ -51,13 +50,6 @@ class ServiceEndpoint( dispatcher.registerHandler(Request.RegisterListener::class) { request -> registrationQueue.sendBlocking(request.listener) } - - intermittentDaemon.registerListener(this) { newDaemon -> - if (version == null && newDaemon != null) { - version = newDaemon.getCurrentVersion() - sendEvent(Event.CurrentVersion(version)) - } - } } fun onDestroy() { @@ -65,6 +57,7 @@ class ServiceEndpoint( registrationQueue.close() accountCache.onDestroy() + appVersionInfoCache.onDestroy() connectionProxy.onDestroy() customDns.onDestroy() keyStatusListener.onDestroy() @@ -118,7 +111,8 @@ class ServiceEndpoint( Event.NewLocation(locationInfoCache.location), Event.WireGuardKeyStatus(keyStatusListener.keyStatus), Event.SplitTunnelingUpdate(splitTunneling.onChange.latestEvent), - Event.CurrentVersion(version), + Event.CurrentVersion(appVersionInfoCache.currentVersion), + Event.AppVersionInfo(appVersionInfoCache.appVersionInfo), Event.ListenerReady ) |
