[Android] Apply the VersionMigration sooner

Nicolas Pomepuy git at videolan.org
Thu Sep 22 12:59:12 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Sep 22 08:52:25 2022 +0200| [26b2a5aa2597bdc73d13d0d53e00265c194637a3] | committer: Nicolas Pomepuy

Apply the VersionMigration sooner

It can be useful when trying to migrate settings used by the
VLCInstance init to make sure the setting is migrated before

> https://code.videolan.org/videolan/vlc-android/commit/26b2a5aa2597bdc73d13d0d53e00265c194637a3
---

 .../app/src/main/java/org/videolan/mobile/app/AppSetupDelegate.kt       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/app/src/main/java/org/videolan/mobile/app/AppSetupDelegate.kt b/application/app/src/main/java/org/videolan/mobile/app/AppSetupDelegate.kt
index a141ef4f4..5eff20763 100644
--- a/application/app/src/main/java/org/videolan/mobile/app/AppSetupDelegate.kt
+++ b/application/app/src/main/java/org/videolan/mobile/app/AppSetupDelegate.kt
@@ -91,13 +91,13 @@ class AppSetupDelegate : AppDelegate,
 
     // init operations executed in background threads
     private fun Context.backgroundInit() = AppScope.launch outerLaunch@ {
+        VersionMigration.migrateVersion(this at backgroundInit)
         launch(Dispatchers.IO) innerLaunch@ {
             if (!VLCInstance.testCompatibleCPU(AppContextProvider.appContext)) return at innerLaunch
             Dialog.setCallbacks(VLCInstance.getInstance(this at backgroundInit), DialogDelegate)
         }
         packageManager.setComponentEnabledSetting(ComponentName(this at backgroundInit, SendCrashActivity::class.java),
                 if (BuildConfig.BETA) PackageManager.COMPONENT_ENABLED_STATE_ENABLED else PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP)
-        VersionMigration.migrateVersion(this at backgroundInit)
         if (!AndroidDevices.isAndroidTv) sendBroadcast(Intent(MiniPlayerAppWidgetProvider.ACTION_WIDGET_INIT).apply {
             component = ComponentName(appContextProvider.appContext, MiniPlayerAppWidgetProvider::class.java)
         })



More information about the Android mailing list