[Android] Check internal storage is mounted on Android 2.3

Geoffrey Métais git at videolan.org
Fri Feb 10 15:21:43 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 10 15:21:21 2017 +0100| [22d15b9c01c2b07796bb300a89ca1428339c1ee8] | committer: Geoffrey Métais

Check internal storage is mounted on Android 2.3

> https://code.videolan.org/videolan/vlc-android/commit/22d15b9c01c2b07796bb300a89ca1428339c1ee8
---

 vlc-android/src/org/videolan/vlc/util/Permissions.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/util/Permissions.java b/vlc-android/src/org/videolan/vlc/util/Permissions.java
index abeeac4..e891cce 100644
--- a/vlc-android/src/org/videolan/vlc/util/Permissions.java
+++ b/vlc-android/src/org/videolan/vlc/util/Permissions.java
@@ -70,7 +70,9 @@ public class Permissions {
     }
 
     public static boolean canReadStorage() {
-        return !AndroidUtil.isMarshMallowOrLater() ||ContextCompat.checkSelfPermission(VLCApplication.getAppContext(),
+        if (!AndroidUtil.isICSOrLater())
+            return VLCApplication.getAppContext().getExternalFilesDir(null) != null;
+        return !AndroidUtil.isMarshMallowOrLater() || ContextCompat.checkSelfPermission(VLCApplication.getAppContext(),
                 Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
     }
 



More information about the Android mailing list