summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2012-10-13 18:14:05 +0200
committerDees_Troy <dees_troy@teamw.in>2012-10-13 18:14:05 +0200
commitaa9cc401d65383184bc0e38ff3cc82690a5846e1 (patch)
tree4daa1a373971d634ff9ec0f1c219817ccb5001dd
parentTrack whether a partition is mounted during refresh sizes (diff)
downloadandroid_bootable_recovery-aa9cc401d65383184bc0e38ff3cc82690a5846e1.tar
android_bootable_recovery-aa9cc401d65383184bc0e38ff3cc82690a5846e1.tar.gz
android_bootable_recovery-aa9cc401d65383184bc0e38ff3cc82690a5846e1.tar.bz2
android_bootable_recovery-aa9cc401d65383184bc0e38ff3cc82690a5846e1.tar.lz
android_bootable_recovery-aa9cc401d65383184bc0e38ff3cc82690a5846e1.tar.xz
android_bootable_recovery-aa9cc401d65383184bc0e38ff3cc82690a5846e1.tar.zst
android_bootable_recovery-aa9cc401d65383184bc0e38ff3cc82690a5846e1.zip
-rw-r--r--partitionmanager.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 2e90ecc49..fdc3fba44 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1463,6 +1463,43 @@ void TWPartitionManager::Update_System_Details(void) {
DataManager::SetValue(TW_BACKUP_SP3_SIZE, backup_display_size);
}
#endif
+ } else {
+ // Handle unmountable partitions in case we reset defaults
+ if ((*iter)->Mount_Point == "/boot") {
+ int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
+ DataManager::SetValue(TW_BACKUP_BOOT_SIZE, backup_display_size);
+ if ((*iter)->Backup_Size == 0) {
+ DataManager::SetValue(TW_HAS_BOOT_PARTITION, 0);
+ DataManager::SetValue(TW_BACKUP_BOOT_VAR, 0);
+ } else
+ DataManager::SetValue(TW_HAS_BOOT_PARTITION, 1);
+ } else if ((*iter)->Mount_Point == "/recovery") {
+ int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
+ DataManager::SetValue(TW_BACKUP_RECOVERY_SIZE, backup_display_size);
+ if ((*iter)->Backup_Size == 0) {
+ DataManager::SetValue(TW_HAS_RECOVERY_PARTITION, 0);
+ DataManager::SetValue(TW_BACKUP_RECOVERY_VAR, 0);
+ } else
+ DataManager::SetValue(TW_HAS_RECOVERY_PARTITION, 1);
+ }
+#ifdef SP1_NAME
+ if ((*iter)->Backup_Name == EXPAND(SP1_NAME)) {
+ int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
+ DataManager::SetValue(TW_BACKUP_SP1_SIZE, backup_display_size);
+ }
+#endif
+#ifdef SP2_NAME
+ if ((*iter)->Backup_Name == EXPAND(SP2_NAME)) {
+ int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
+ DataManager::SetValue(TW_BACKUP_SP2_SIZE, backup_display_size);
+ }
+#endif
+#ifdef SP3_NAME
+ if ((*iter)->Backup_Name == EXPAND(SP3_NAME)) {
+ int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
+ DataManager::SetValue(TW_BACKUP_SP3_SIZE, backup_display_size);
+ }
+#endif
}
}
DataManager::SetValue(TW_BACKUP_DATA_SIZE, data_size);