Skip to content

Commit

Permalink
Merge "ADB Backup: Ignore creating backup folder for phones not decry…
Browse files Browse the repository at this point in the history
…pted. This allows you to continue without error. Also we should not set restore path for images in adb backup. Change-Id: Ia75a70377b8e1364fefc82ad41ccf74fa3b7a3c3" into android-9.0
  • Loading branch information
bigbiff authored and Gerrit Code Review committed Apr 2, 2019
2 parents 4b4148e + cdd97c7 commit 794e364
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 12 additions & 4 deletions partitionmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,10 +907,18 @@ int TWPartitionManager::Run_Backup(bool adbbackup) {
part_settings.file_bytes_remaining = part_settings.file_bytes;

gui_msg("backup_started=[BACKUP STARTED]");
gui_msg(Msg("backup_folder= * Backup Folder: {1}")(part_settings.Backup_Folder));
if (!TWFunc::Recursive_Mkdir(part_settings.Backup_Folder)) {
gui_err("fail_backup_folder=Failed to make backup folder.");
return false;

int is_decrypted = 0;
int is_encrypted = 0;

DataManager::GetValue(TW_IS_DECRYPTED, is_decrypted);
DataManager::GetValue(TW_IS_ENCRYPTED, is_encrypted);
if (!adbbackup || (!is_encrypted || (is_encrypted && is_decrypted))) {
gui_msg(Msg("backup_folder= * Backup Folder: {1}")(part_settings.Backup_Folder));
if (!TWFunc::Recursive_Mkdir(part_settings.Backup_Folder)) {
gui_err("fail_backup_folder=Failed to make backup folder.");
return false;
}
}

DataManager::SetProgress(0.0);
Expand Down
1 change: 0 additions & 1 deletion twrpAdbBuFifo.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ bool twrpAdbBuFifo::Restore_ADB_Backup(void) {
Backup_FileName = Restore_Name.substr(pos + 1, Restore_Name.size());
part_settings.Part = PartitionManager.Find_Partition_By_Path(path);
part_settings.Backup_Folder = path;
PartitionManager.Set_Restore_Files(path);
part_settings.partition_count = partition_count;
part_settings.adbbackup = true;
part_settings.adb_compression = twimghdr.compressed;
Expand Down

0 comments on commit 794e364

Please sign in to comment.