From eeed3c55d82fc19e34fd78a188b4a5367923901b Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Wed, 16 Apr 2014 11:49:02 -0500 Subject: Fix handling of storage with data/media vs data/media/0 Sometimes loading the values from the settings file may set the storage path to /data/media when the proper path is /data/media/0 This commit will grab the storage path from the partition manager to ensure that we are using the proper path. Change-Id: Ibfd63125a2b9705319eb55b09c7e65391757bbc2 --- data.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'data.cpp') diff --git a/data.cpp b/data.cpp index 4bf8637a6..7be0b03e8 100644 --- a/data.cpp +++ b/data.cpp @@ -279,9 +279,10 @@ int DataManager::LoadValues(const string filename) error: fclose(in); string current = GetCurrentStoragePath(); - string settings = GetSettingsStoragePath(); - if (current != settings && !PartitionManager.Mount_By_Path(current, false)) { - SetValue("tw_storage_path", settings); + TWPartition* Part = PartitionManager.Find_Partition_By_Path(current); + if (current != Part->Storage_Path && Part->Mount(false)) { + LOGINFO("LoadValues setting storage path to '%s'\n", Part->Storage_Path.c_str()); + SetValue("tw_storage_path", Part->Storage_Path); } else { SetBackupFolder(); } -- cgit v1.2.3