[Android] Util getExternalStorageDirectories

Geoffrey Métais git at videolan.org
Tue Nov 22 09:55:40 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Nov 22 09:54:09 2016 +0100| [4a5f8f766db8a16c1d15aff44e8e8154fcc74bd7] | committer: Geoffrey Métais

Util getExternalStorageDirectories

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

 vlc-android/src/org/videolan/vlc/util/AndroidDevices.java | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
index 0b9531d..8713436 100644
--- a/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
+++ b/vlc-android/src/org/videolan/vlc/util/AndroidDevices.java
@@ -113,10 +113,9 @@ public class AndroidDevices {
         return showInternalStorage;
     }
 
-    public static ArrayList<String> getStorageDirectories() {
+    public static ArrayList<String> getExternalStorageDirectories() {
         BufferedReader bufReader = null;
-        ArrayList<String> list = new ArrayList<String>();
-        list.add(EXTERNAL_PUBLIC_DIRECTORY);
+        ArrayList<String> list = new ArrayList<>();
 
         List<String> typeWL = Arrays.asList("vfat", "exfat", "sdcardfs", "fuse", "ntfs", "fat32", "ext3", "ext4", "esdfs");
         List<String> typeBL = Arrays.asList("tmpfs");
@@ -133,7 +132,8 @@ public class AndroidDevices {
         String[] deviceWL = {
                 "/dev/block/vold",
                 "/dev/fuse",
-                "/mnt/media_rw"};
+                "/mnt/media_rw"
+        };
 
         try {
             bufReader = new BufferedReader(new FileReader("/proc/mounts"));
@@ -183,7 +183,8 @@ public class AndroidDevices {
 
     public static String[] getMediaDirectories() {
         ArrayList<String> list = new ArrayList<String>();
-        list.addAll(getStorageDirectories());
+        list.add(EXTERNAL_PUBLIC_DIRECTORY);
+        list.addAll(getExternalStorageDirectories());
         list.addAll(Arrays.asList(CustomDirectories.getCustomDirectories()));
         return list.toArray(new String[list.size()]);
     }



More information about the Android mailing list