summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-01-18 18:17:58 +0100
committerDees_Troy <dees_troy@teamw.in>2013-01-18 18:20:18 +0100
commitd4b22b0f4f7e1c74996d6a97575760f62d83e3a9 (patch)
treef9d50abf3ffe973c9be8142805f61c86873d145e
parentImprove ORS sideload to display GUI with cancel button (diff)
downloadandroid_bootable_recovery-d4b22b0f4f7e1c74996d6a97575760f62d83e3a9.tar
android_bootable_recovery-d4b22b0f4f7e1c74996d6a97575760f62d83e3a9.tar.gz
android_bootable_recovery-d4b22b0f4f7e1c74996d6a97575760f62d83e3a9.tar.bz2
android_bootable_recovery-d4b22b0f4f7e1c74996d6a97575760f62d83e3a9.tar.lz
android_bootable_recovery-d4b22b0f4f7e1c74996d6a97575760f62d83e3a9.tar.xz
android_bootable_recovery-d4b22b0f4f7e1c74996d6a97575760f62d83e3a9.tar.zst
android_bootable_recovery-d4b22b0f4f7e1c74996d6a97575760f62d83e3a9.zip
-rw-r--r--partitionmanager.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 8235a291f..c39a7d10d 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -640,13 +640,6 @@ int TWPartitionManager::Run_Backup(void) {
Full_Backup_Path = Backup_Folder + "/" + Backup_Name + "/";
LOGI("Full_Backup_Path is: '%s'\n", Full_Backup_Path.c_str());
- ui_print("\n[BACKUP STARTED]\n");
- ui_print(" * Backup Folder: %s\n", Full_Backup_Path.c_str());
- if (!TWFunc::Recursive_Mkdir(Full_Backup_Path)) {
- LOGE("Failed to make backup folder.\n");
- return false;
- }
-
LOGI("Calculating backup details...\n");
DataManager::GetValue(TW_BACKUP_SYSTEM_VAR, check);
if (check) {
@@ -817,7 +810,7 @@ int TWPartitionManager::Run_Backup(void) {
LOGE("Unable to locate storage device.\n");
return false;
}
- if (free_space + (32 * 1024 * 1024) < total_bytes) {
+ if (free_space - (32 * 1024 * 1024) < total_bytes) {
// We require an extra 32MB just in case
LOGE("Not enough free space on storage.\n");
return false;
@@ -825,6 +818,13 @@ int TWPartitionManager::Run_Backup(void) {
img_bytes_remaining = img_bytes;
file_bytes_remaining = file_bytes;
+ ui_print("\n[BACKUP STARTED]\n");
+ ui_print(" * Backup Folder: %s\n", Full_Backup_Path.c_str());
+ if (!TWFunc::Recursive_Mkdir(Full_Backup_Path)) {
+ LOGE("Failed to make backup folder.\n");
+ return false;
+ }
+
ui->SetProgress(0.0);
if (!Backup_Partition(backup_sys, Full_Backup_Path, do_md5, &img_bytes_remaining, &file_bytes_remaining, &img_time, &file_time, &img_bytes, &file_bytes))