[Android] Simpler write permission check

Geoffrey Métais git at videolan.org
Sat May 21 20:26:41 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Sat May 21 20:26:10 2016 +0200| [4f2dac100dd130e2b7bf2edd9fce1bbe84f84db2] | committer: Geoffrey Métais

Simpler write permission check

> https://code.videolan.org/videolan/vlc-android/commit/4f2dac100dd130e2b7bf2edd9fce1bbe84f84db2
---

 vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java b/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
index 694b0ec..addf1c8 100644
--- a/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
+++ b/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
@@ -343,7 +343,7 @@ public class SubtitlesDownloader {
             long fileLength = 0;
             Uri mediaUri = media.getUri();
             if (firstPass) {
-                if (TextUtils.equals(mediaUri.getScheme(), "file") && FileUtils.canWrite(mediaUri.toString())) {
+                if (FileUtils.canWrite(mediaUri)) {
                     File videoFile = new File(mediaUri.getPath());
                     hash = FileUtils.computeHash(videoFile);
                     fileLength = videoFile.length();



More information about the Android mailing list