[Android] ML: start ml but not scan without permissions

Duncan McNamara git at videolan.org
Wed Mar 16 12:42:12 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Tue Mar 15 17:50:06 2022 +0100| [8358f7484e18b669e79a03d147801e77070109cc] | committer: Duncan McNamara

ML: start ml but not scan without permissions

This stop the medialibrary from scanning the filesystem without
permissions

> https://code.videolan.org/videolan/vlc-android/commit/8358f7484e18b669e79a03d147801e77070109cc
---

 .../resources/src/main/java/org/videolan/resources/util/Extensions.kt   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/resources/src/main/java/org/videolan/resources/util/Extensions.kt b/application/resources/src/main/java/org/videolan/resources/util/Extensions.kt
index 6281583e0..f05206f79 100644
--- a/application/resources/src/main/java/org/videolan/resources/util/Extensions.kt
+++ b/application/resources/src/main/java/org/videolan/resources/util/Extensions.kt
@@ -82,7 +82,7 @@ fun Context.startMedialibrary(firstRun: Boolean = false, upgrade: Boolean = fals
             .putExtra(EXTRA_FIRST_RUN, firstRun)
             .putExtra(EXTRA_UPGRADE, upgrade)
             .putExtra(EXTRA_REMOVE_DEVICE, removeDevices)
-            .putExtra(EXTRA_PARSE, parse && scanOpt != ML_SCAN_OFF))
+            .putExtra(EXTRA_PARSE, parse && scanOpt != ML_SCAN_OFF && canReadStorage(this at startMedialibrary)))
 }
 
 suspend fun Context.dbExists(coroutineContextProvider: CoroutineContextProvider = CoroutineContextProvider()) = withContext(coroutineContextProvider.IO) {



More information about the Android mailing list