summaryrefslogtreecommitdiffstats
path: root/partitionmanager.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-05-18 17:23:03 +0200
committerEthan Yonker <dees_troy@teamw.in>2015-05-27 16:22:49 +0200
commiteb32b1ff00878e7b01453450fcd04ecb9fcbba52 (patch)
treea25888903dd6c07d14afa46ccce41d1779b8e975 /partitionmanager.cpp
parentOnly include uncrypt if not in system/core (diff)
downloadandroid_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar
android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar.gz
android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar.bz2
android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar.lz
android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar.xz
android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.tar.zst
android_bootable_recovery-eb32b1ff00878e7b01453450fcd04ecb9fcbba52.zip
Diffstat (limited to '')
-rw-r--r--partitionmanager.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index ffc17c3a4..055f73697 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -880,9 +880,13 @@ int TWPartitionManager::Run_Restore(string Restore_Name) {
restore_path = Restore_List.substr(start_pos, end_pos - start_pos);
restore_part = Find_Partition_By_Path(restore_path);
if (restore_part != NULL) {
- partition_count++;
+ if (restore_part->Mount_Read_Only) {
+ LOGERR("Cannot restore %s -- mounted read only.\n", restore_part->Backup_Display_Name.c_str());
+ return false;
+ }
if (check_md5 > 0 && !restore_part->Check_MD5(Restore_Name))
return false;
+ partition_count++;
total_restore_size += restore_part->Get_Restore_Size(Restore_Name);
if (restore_part->Has_SubPartition) {
std::vector<TWPartition*>::iterator subpart;