1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-22 06:41:06 +02:00

Check the mount state of all external storage directories

This commit is contained in:
José Rebelo 2022-08-06 22:27:55 +01:00
parent efdc4c434a
commit 6d947a9008
2 changed files with 4 additions and 5 deletions

View File

@ -264,11 +264,10 @@ public class FileUtils {
continue;
}
// 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 (!GBEnvironment.env().isLocalTest()) { // don't do this with robolectric
if (i == 0 && !Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
GB.log("ignoring unmounted external storage dir: " + dir, GB.INFO, null);
final String storageState = Environment.getExternalStorageState(dir);
if (!Environment.MEDIA_MOUNTED.equals(storageState)) {
GB.log("ignoring '" + storageState + "' external storage dir: " + dir, GB.INFO, null);
continue;
}
}

View File

@ -480,7 +480,7 @@
<string name="watch9_pairing_tap_hint">When your watch vibrates, shake the device or press its button.</string>
<string name="title_activity_sleepmonitor">Sleep monitor</string>
<string name="pref_write_logfiles">Write log files</string>
<string name="pref_write_logfiles_not_available">File logging initialization failed, writing log files is not available</string>
<string name="pref_write_logfiles_not_available">File logging initialization failed, writing log files is currently not available. Restart the application to attempt to initialize the log files again.</string>
<string name="initializing">Initializing</string>
<string name="busy_task_fetch_activity_data">Fetching activity data</string>
<string name="sleep_activity_date_range">From %1$s to %2$s</string>