Don't rely on File.canWrite() for directories, closes #406

master
cpfeiffer 2016-10-10 21:01:41 +02:00
parent f57fec25f8
commit 5c8525c5d0
1 changed files with 2 additions and 2 deletions

View File

@ -166,8 +166,8 @@ public class FileUtils {
// the first directory is also the primary external storage, i.e. the same as Environment.getExternalFilesDir()
// TODO: check the mount state of *all* dirs when switching to later API level
if (!dir.canWrite() || (i == 0 && !Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()))) {
GB.log("ignoring non-writable external storage dir: " + dir, GB.INFO, null);
if (i == 0 && !Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
GB.log("ignoring unmounted external storage dir: " + dir, GB.INFO, null);
continue;
}
result.add(dir); // add last