[Android] Fix the onboarding option to avoid adding folders to the ML

Nicolas Pomepuy git at videolan.org
Fri Jan 21 10:59:34 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Jan 20 09:11:28 2022 +0100| [9244da5b837ed7c46bf187eaba3e828709869650] | committer: Nicolas Pomepuy

Fix the onboarding option to avoid adding folders to the ML

Fixes #2335

> https://code.videolan.org/videolan/vlc-android/commit/9244da5b837ed7c46bf187eaba3e828709869650
---

 .../vlc-android/src/org/videolan/vlc/util/VersionMigration.kt     | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/util/VersionMigration.kt b/application/vlc-android/src/org/videolan/vlc/util/VersionMigration.kt
index 4d90294e3..60e83ef9b 100644
--- a/application/vlc-android/src/org/videolan/vlc/util/VersionMigration.kt
+++ b/application/vlc-android/src/org/videolan/vlc/util/VersionMigration.kt
@@ -32,8 +32,10 @@ import androidx.core.content.edit
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.withContext
 import org.videolan.medialibrary.interfaces.Medialibrary
+import org.videolan.resources.AndroidDevices
 import org.videolan.resources.util.getFromMl
 import org.videolan.tools.*
+import org.videolan.vlc.gui.onboarding.ONBOARDING_DONE_KEY
 import java.io.File
 import java.io.IOException
 
@@ -98,7 +100,11 @@ object VersionMigration {
                 Log.e(this::class.java.simpleName, e.message, e)
             }
         }
-        context.getFromMl { flushUserProvidedThumbnails() }
+        val settings = Settings.getInstance(context)
+        val onboarding = !settings.getBoolean(ONBOARDING_DONE_KEY, false)
+        val tv = AndroidDevices.isAndroidTv || !AndroidDevices.isChromeBook && !AndroidDevices.hasTsp ||
+                settings.getBoolean("tv_ui", false)
+        if (!tv && !onboarding) context.getFromMl { flushUserProvidedThumbnails() }
     }
 
     /**



More information about the Android mailing list