[Android] Apply the VersionMigration sooner

Nicolas Pomepuy git at videolan.org
Thu Sep 22 14:01:21 UTC 2022


vlc-android | branch: 3.5.x | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Sep 22 08:52:25 2022 +0200| [616354d059f59b7e786e71bdaa3e44271667e619] | committer: Duncan McNamara

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/616354d059f59b7e786e71bdaa3e44271667e619
---

 .../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