ADB Backup: Ignore creating backup folder for phones
not decrypted. This allows you to continue without error.
Also we should not set restore path for images in adb
backup.
Change-Id: Ia75a70377b8e1364fefc82ad41ccf74fa3b7a3c3
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 6b5ee1c..26a48e5 100755
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -907,10 +907,18 @@
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);