From dcf2b674c4c2eb1631ebc76e3606c1c7691321a8 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Tue, 13 Sep 2016 14:41:53 -0500 Subject: Clean up PartitionSettings The PartitionSettings struct contains some data elements that are duplicates of data elements in the TWPartition class that is contained within the PartitionsSettings.Part element. We will eliminate this duplication to help reduce the chances for programming bugs. Specifically, this fixes problems where the current file system does not match the backed up file system. Change-Id: I02f236e72093362050556a2e53a09d1dbb9a269d --- openrecoveryscript.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'openrecoveryscript.cpp') diff --git a/openrecoveryscript.cpp b/openrecoveryscript.cpp index 0d2268cd1..f9c610a7c 100644 --- a/openrecoveryscript.cpp +++ b/openrecoveryscript.cpp @@ -840,11 +840,10 @@ int OpenRecoveryScript::Restore_ADB_Backup(void) { pos = Restore_Name.find_last_of("/"); Backup_FileName = Restore_Name.substr(pos + 1, Restore_Name.size()); part_settings.Part = PartitionManager.Find_Partition_By_Path(path); - part_settings.Restore_Name = path; + part_settings.Backup_Folder = path; part_settings.partition_count = partition_count; part_settings.adbbackup = true; part_settings.adb_compression = twimghdr.compressed; - part_settings.Backup_FileName = Backup_FileName; part_settings.PM_Method = PM_RESTORE; ProgressTracking progress(part_settings.total_restore_size); part_settings.progress = &progress; @@ -871,7 +870,6 @@ int OpenRecoveryScript::Restore_ADB_Backup(void) { pos = Restore_Name.find_last_of("/"); Backup_FileName = Restore_Name.substr(pos + 1, Restore_Name.size()); pos = Restore_Name.find_last_of("/"); - part_settings.Restore_Name = Restore_Name.substr(0, pos); part_settings.Part = PartitionManager.Find_Partition_By_Path(path); if (path.compare("/system") == 0) { @@ -893,7 +891,6 @@ int OpenRecoveryScript::Restore_ADB_Backup(void) { part_settings.partition_count = partition_count; part_settings.adbbackup = true; part_settings.adb_compression = twimghdr.compressed; - part_settings.Backup_FileName = Backup_FileName; part_settings.total_restore_size += part_settings.Part->Get_Restore_Size(&part_settings); part_settings.PM_Method = PM_RESTORE; ProgressTracking progress(part_settings.total_restore_size); -- cgit v1.2.3