Set /data/recovery for Settings
* Test: TWRP boots, settings saves, Change TWRP Folder works
Change-Id: Iaae45064815a4adc55e1116f2c51fba869b284b5
Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
(cherry picked from commit f923110ae01d45f5afb3eccf734d82b9c0b4795e)
diff --git a/gui/action.cpp b/gui/action.cpp
index 61a3bed..d643daa 100755
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -1138,7 +1138,7 @@
if (has_datamedia) {
ret_val = PartitionManager.Wipe_Media_From_Data();
} else {
- ret_val = PartitionManager.Wipe_By_Path(DataManager::GetSettingsStoragePath());
+ ret_val = PartitionManager.Wipe_By_Path(DataManager::GetCurrentStoragePath());
}
} else if (arg == "EXTERNAL") {
string External_Path;
@@ -1188,7 +1188,7 @@
gui_msg(Msg(msg::kError, "unable_to_wipe=Unable to wipe {1}.")(wipe_path));
ret_val = false;
break;
- } else if (wipe_path == DataManager::GetSettingsStoragePath()) {
+ } else if (wipe_path == DataManager::GetCurrentStoragePath()) {
arg = wipe_path;
}
} else {
@@ -2321,7 +2321,7 @@
int GUIAction::applycustomtwrpfolder(string arg __unused)
{
operation_start("ChangingTWRPFolder");
- string storageFolder = DataManager::GetSettingsStoragePath();
+ string storageFolder = DataManager::GetCurrentStoragePath();
string newFolder = storageFolder + '/' + arg;
string newBackupFolder = newFolder + "/BACKUPS/" + DataManager::GetStrValue("device_id");
string prevFolder = storageFolder + DataManager::GetStrValue(TW_RECOVERY_FOLDER_VAR);
@@ -2345,7 +2345,6 @@
if (ret) {
DataManager::SetValue(TW_RECOVERY_FOLDER_VAR, '/' + arg);
DataManager::SetValue(TW_BACKUPS_FOLDER_VAR, newBackupFolder);
- DataManager::mBackingFile = newFolder + '/' + TW_SETTINGS_FILE;
}
operation_end((int)!ret);
return 0;