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() {
|
public Vector<StoragePoint> getAvailableStoragePoint() {
|
||||||
Vector<StoragePoint> result = new Vector<>();
|
Vector<StoragePoint> result = new Vector<>();
|
||||||
|
|
||||||
final String defaultStringDesc =
|
final String defaultStringDesc = MainApp.getAppContext().getString(R.string.storage_description_default);
|
||||||
MainApp.getAppContext().getString(R.string.storage_description_default);
|
|
||||||
File path;
|
File path;
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
|
||||||
path = MainApp.getAppContext().getExternalMediaDirs()[0];
|
path = MainApp.getAppContext().getExternalMediaDirs()[0];
|
||||||
|
@ -52,7 +51,7 @@ public class SystemDefaultStoragePointProvider extends AbstractStoragePointProvi
|
||||||
path = getExternalStorageDirectory();
|
path = getExternalStorageDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path != null) {
|
if (path != null && path.canWrite()) {
|
||||||
result.add(new StoragePoint(defaultStringDesc, path.getAbsolutePath()));
|
result.add(new StoragePoint(defaultStringDesc, path.getAbsolutePath()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue