mirror of
https://github.com/nextcloud/android.git
synced 2024-12-21 00:12:05 +03:00
check if writable
This commit is contained in:
parent
8ccff56370
commit
2c2959a08d
1 changed files with 2 additions and 3 deletions
|
@ -43,8 +43,7 @@ public class SystemDefaultStoragePointProvider extends AbstractStoragePointProvi
|
|||
public Vector<StoragePoint> getAvailableStoragePoint() {
|
||||
Vector<StoragePoint> 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()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue