mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Don't rely on File.canWrite() for directories, closes #406
This commit is contained in:
parent
f57fec25f8
commit
5c8525c5d0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user