summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-12-16 21:03:02 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-03-31 14:36:30 +0000
commit2fd0d05876d5c841e8b6548e0d1f09053426ca64 (patch)
treec3f618033a2d06957d6e667763149430da5b69a4 /android/src
parent77ab48076cfdb17e64805a4f558688e02b2749a5 (diff)
downloadmullvadvpn-2fd0d05876d5c841e8b6548e0d1f09053426ca64.tar.xz
mullvadvpn-2fd0d05876d5c841e8b6548e0d1f09053426ca64.zip
Send account history change events
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt4
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt1
2 files changed, 5 insertions, 0 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt
index 9c582480b7..158fb15d5e 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AccountCache.kt
@@ -65,6 +65,10 @@ class AccountCache(private val endpoint: ServiceEndpoint) {
handleNewAccountNumber(accountNumber)
}
+ onAccountHistoryChange.subscribe(this) { history ->
+ endpoint.sendEvent(Event.AccountHistory(history))
+ }
+
onLoginStatusChange.subscribe(this) { status ->
endpoint.sendEvent(Event.LoginStatus(status))
}
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 d95e2cf6ec..70dd295d5f 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
@@ -92,6 +92,7 @@ class ServiceEndpoint(
val initialEvents = listOf(
Event.LoginStatus(accountCache.onLoginStatusChange.latestEvent),
+ Event.AccountHistory(accountCache.onAccountHistoryChange.latestEvent),
Event.SettingsUpdate(settingsListener.settings),
Event.NewLocation(locationInfoCache.location),
Event.WireGuardKeyStatus(keyStatusListener.keyStatus),