[Android] Fix download subtitle on external card
Nicolas Pomepuy
git at videolan.org
Thu Oct 8 09:48:58 CEST 2020
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Oct 7 11:47:53 2020 +0200| [84a019cc34170244001dd9af236a2f53b3bbf5b0] | committer: Jean-Baptiste Kempf
Fix download subtitle on external card
Fixes #1478
> https://code.videolan.org/videolan/vlc-android/commit/84a019cc34170244001dd9af236a2f53b3bbf5b0
---
.../src/org/videolan/vlc/gui/helpers/hf/WriteExternalDelegate.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/hf/WriteExternalDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/hf/WriteExternalDelegate.kt
index 35cd9d299..787b01900 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/hf/WriteExternalDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/hf/WriteExternalDelegate.kt
@@ -104,7 +104,7 @@ class WriteExternalDelegate : BaseHeadlessFragment() {
fun needsWritePermission(uri: Uri) : Boolean {
val path = uri.path ?: return false
- return AndroidUtil.isLolliPopOrLater && "file" == uri.scheme
+ return AndroidUtil.isLolliPopOrLater && ("file" == uri.scheme || uri.scheme == null)
&& path.isNotEmpty() && path.startsWith('/')
&& !path.startsWith(AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY)
&& !(FileUtils.findFile(uri)?.canWrite() ?: false)
More information about the Android
mailing list