summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-12-05 07:58:51 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-12-05 07:58:51 -0300
commit6ccbfeb4f739293fdccbc552ea14c4d182c96d92 (patch)
tree2b6e16beae68e2154685e9d23a29db70c0a6a7a2 /android
parent6b0edd2cd9e4f7b60c6f1d092d88ac5fb2dba2a1 (diff)
parente4b5cf2256b0ba36c46b0cea2a683c5fb655cbe5 (diff)
downloadmullvadvpn-6ccbfeb4f739293fdccbc552ea14c4d182c96d92.tar.xz
mullvadvpn-6ccbfeb4f739293fdccbc552ea14c4d182c96d92.zip
Merge branch 'fix-app-version-update-on-wrong-thread'
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt
index ff6330d975..c5cd816ce2 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt
@@ -41,6 +41,8 @@ class NotificationBanner(
private val message: TextView = parentView.findViewById(R.id.notification_message)
private val icon: View = parentView.findViewById(R.id.notification_icon)
+ private var updateJob: Job? = null
+
private var externalLink: ExternalLink? = null
private var visible = false
@@ -83,11 +85,14 @@ class NotificationBanner(
}
fun onResume() {
- versionInfoCache.onUpdate = { update() }
+ versionInfoCache.onUpdate = {
+ updateJob = GlobalScope.launch(Dispatchers.Main) { update() }
+ }
}
fun onPause() {
versionInfoCache.onUpdate = null
+ updateJob?.cancel()
keyManagementController.onPause()
}