summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-04-15 15:11:33 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-04-16 12:14:04 +0000
commita9979e98431fe202d77680168b23a9b6c81f5c43 (patch)
treed55867217f95ba1d0da9a1e9df5486b08ec9892d /android/src
parent64eff2bbff8265169a7c79e50a8f158843506d2e (diff)
downloadmullvadvpn-a9979e98431fe202d77680168b23a9b6c81f5c43.tar.xz
mullvadvpn-a9979e98431fe202d77680168b23a9b6c81f5c43.zip
Remove old shared preferences clean-up code
On versions 2019.8-beta1 and older, the app stored the application version information as shared preferences. On 2019.9-beta1 that changed so that the information was handled by the Rust daemon, and some code was added to clear those shared preferences so that users that update from the old versions don't have any left over data. This commit removes that migration code, because it's been more than a year since that change has happened and none of those versions are supported anymore. A user that updates from one of the old versions before 2019.9-beta1 to a version from this commit onwards will have some extra data stored in shared preferences (which should be less than 1 KiB) that won't be ever used. The only way to remove that data is to manually clear the app storage, reinstall the app, or to upgrade to a version from 2020 before updating to future versions.
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AppVersionInfoCache.kt12
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt2
2 files changed, 2 insertions, 12 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AppVersionInfoCache.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AppVersionInfoCache.kt
index 7f428a716a..0c95293ae7 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AppVersionInfoCache.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/AppVersionInfoCache.kt
@@ -1,16 +1,11 @@
package net.mullvad.mullvadvpn.service.endpoint
-import android.content.Context
import kotlin.properties.Delegates.observable
import net.mullvad.mullvadvpn.ipc.Event
import net.mullvad.mullvadvpn.model.AppVersionInfo
import net.mullvad.mullvadvpn.service.MullvadDaemon
-class AppVersionInfoCache(context: Context, endpoint: ServiceEndpoint) {
- companion object {
- val LEGACY_SHARED_PREFERENCES = "app_version_info_cache"
- }
-
+class AppVersionInfoCache(endpoint: ServiceEndpoint) {
private val daemon = endpoint.intermittentDaemon
var appVersionInfo by observable<AppVersionInfo?>(null) { _, _, info ->
@@ -24,11 +19,6 @@ class AppVersionInfoCache(context: Context, endpoint: ServiceEndpoint) {
private set
init {
- context.getSharedPreferences(LEGACY_SHARED_PREFERENCES, Context.MODE_PRIVATE)
- .edit()
- .clear()
- .commit()
-
daemon.registerListener(this) { newDaemon ->
newDaemon?.let { daemon ->
initializeCurrentVersion(daemon)
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 06c0c3926f..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
@@ -40,7 +40,7 @@ class ServiceEndpoint(
val settingsListener = SettingsListener(this)
val accountCache = AccountCache(this)
- val appVersionInfoCache = AppVersionInfoCache(context, this)
+ val appVersionInfoCache = AppVersionInfoCache(this)
val customDns = CustomDns(this)
val keyStatusListener = KeyStatusListener(this)
val locationInfoCache = LocationInfoCache(this)