From 2c2959a08d730526843c863b3cc5d6dc7a8b58f2 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 4 May 2017 14:24:48 +0200 Subject: [PATCH] check if writable --- .../providers/SystemDefaultStoragePointProvider.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/owncloud/android/datastorage/providers/SystemDefaultStoragePointProvider.java b/src/main/java/com/owncloud/android/datastorage/providers/SystemDefaultStoragePointProvider.java index 739a699e32..4a06ed7c96 100644 --- a/src/main/java/com/owncloud/android/datastorage/providers/SystemDefaultStoragePointProvider.java +++ b/src/main/java/com/owncloud/android/datastorage/providers/SystemDefaultStoragePointProvider.java @@ -43,8 +43,7 @@ public class SystemDefaultStoragePointProvider extends AbstractStoragePointProvi public Vector getAvailableStoragePoint() { Vector result = new Vector<>(); - final String defaultStringDesc = - MainApp.getAppContext().getString(R.string.storage_description_default); + final String defaultStringDesc = MainApp.getAppContext().getString(R.string.storage_description_default); File path; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { path = MainApp.getAppContext().getExternalMediaDirs()[0]; @@ -52,7 +51,7 @@ public class SystemDefaultStoragePointProvider extends AbstractStoragePointProvi path = getExternalStorageDirectory(); } - if (path != null) { + if (path != null && path.canWrite()) { result.add(new StoragePoint(defaultStringDesc, path.getAbsolutePath())); }