[Android] Fix path encoding for 3rd party provided ones

Geoffrey Métais git at videolan.org
Fri May 6 10:10:57 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May  6 10:10:06 2016 +0200| [4d0eb1718fe7a7ac5d3a4bfa46da7d156e1f4a34] | committer: Geoffrey Métais

Fix path encoding for 3rd party provided ones

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

 vlc-android/src/org/videolan/vlc/util/FileUtils.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/FileUtils.java b/vlc-android/src/org/videolan/vlc/util/FileUtils.java
index 73a588b..e2a1df3 100644
--- a/vlc-android/src/org/videolan/vlc/util/FileUtils.java
+++ b/vlc-android/src/org/videolan/vlc/util/FileUtils.java
@@ -91,9 +91,8 @@ public class FileUtils {
     public static Uri convertLocalUri(Uri uri) {
         if (!TextUtils.equals(uri.getScheme(), "file") || !uri.getPath().startsWith("/sdcard"))
             return uri;
-        String path = uri.getPath();
-        path = path.replace("/sdcard", AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY);
-        return Uri.parse("file://"+path);
+        String path = uri.toString();
+        return Uri.parse(path.replace("/sdcard", AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY));
     }
 
     public static String getPathFromURI(Uri contentUri) {



More information about the Android mailing list