diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-12-05 07:58:51 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-12-05 07:58:51 -0300 |
| commit | 6ccbfeb4f739293fdccbc552ea14c4d182c96d92 (patch) | |
| tree | 2b6e16beae68e2154685e9d23a29db70c0a6a7a2 | |
| parent | 6b0edd2cd9e4f7b60c6f1d092d88ac5fb2dba2a1 (diff) | |
| parent | e4b5cf2256b0ba36c46b0cea2a683c5fb655cbe5 (diff) | |
| download | mullvadvpn-6ccbfeb4f739293fdccbc552ea14c4d182c96d92.tar.xz mullvadvpn-6ccbfeb4f739293fdccbc552ea14c4d182c96d92.zip | |
Merge branch 'fix-app-version-update-on-wrong-thread'
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/NotificationBanner.kt | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 737c283db0..9536e25052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,9 @@ Line wrap the file at 100 chars. Th - Minor adjustment in online/offline detection logic. This change addresses misbehaving drivers that report the adapter flags incorrectly. +#### Android +- Fix crash when a new version event is received while the app is in the main screen. + ### Security - Force OpenVPN to use TLS 1.2 or newer. And limit the TLS 1.3 ciphers to only the strongest ones. The Mullvad servers have never allowed any insecure ciphers, so this was not really a problem. 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() } |
