Fix ext storage and zip paths

Fix a bug with handling external storage during boot.
Check zip root path when switching storage and ensure that the
path is in the new storage path to prevent user confusion.
This commit is contained in:
Dees_Troy
2012-09-19 16:18:21 -04:00
parent 9a4b569e9d
commit e2920fa237
3 changed files with 34 additions and 1 deletions
+5 -1
View File
@@ -840,11 +840,15 @@ void DataManager::ReadSettingsFile(void)
GetValue(TW_HAS_EXTERNAL, has_ext);
if (has_dual != 0 && use_ext == 1) {
// Attempt to sdcard using external storage
if (PartitionManager.Mount_Current_Storage(false)) {
if (!PartitionManager.Mount_Current_Storage(false)) {
LOGE("Failed to mount external storage, using internal storage.\n");
// Remount failed, default back to internal storage
SetValue(TW_USE_EXTERNAL_STORAGE, 0);
PartitionManager.Mount_Current_Storage(true);
string int_zip_path;
GetValue(TW_ZIP_INTERNAL_VAR, int_zip_path);
SetValue(TW_USE_EXTERNAL_STORAGE, 0);
SetValue(TW_ZIP_LOCATION_VAR, int_zip_path);
}
} else {
PartitionManager.Mount_Current_Storage(true);