Remove duplicate Update_System_Details() function calls
Only run Update_System_Details on boot after decryption is
complete, if device is unencrypted, or if decryption prompt
is cancelled.
This significantly decreases the delay in reaching the
decryption prompt on devices with large used storage
capacity
Use refreshsizes action to update system details when
Cancel button is pressed at decryption prompt
Change-Id: I9e436b1c57664a5269f42dc1cda4f6097f7e3062
diff --git a/twrp.cpp b/twrp.cpp
index b8aca9a..13f374b 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -77,6 +77,7 @@
if (DataManager::GetIntValue(TW_IS_ENCRYPTED) != 0) {
if (SkipDecryption) {
LOGINFO("Skipping decryption\n");
+ PartitionManager.Update_System_Details();
} else if (DataManager::GetIntValue(TW_CRYPTO_PWTYPE) != 0) {
LOGINFO("Is encrypted, do decrypt page first\n");
if (DataManager::GetIntValue(TW_IS_FBE))
@@ -90,6 +91,7 @@
}
}
} else if (datamedia) {
+ PartitionManager.Update_System_Details();
TWFunc::check_selinux_support();
if (tw_get_default_metadata(DataManager::GetSettingsStoragePath().c_str()) != 0) {
LOGINFO("Failed to get default contexts and file mode for storage files.\n");
@@ -125,7 +127,6 @@
LOGERR("Failing out of recovery due to problem with fstab.\n");
return;
}
- PartitionManager.Output_Partition_Logging();
// We are doing this here to allow super partition to be set up prior to overriding properties
#if defined(TW_INCLUDE_LIBRESETPROP) && defined(TW_OVERRIDE_SYSTEM_PROPS)
@@ -177,6 +178,7 @@
#endif
Decrypt_Page(skip_decryption, datamedia);
+ PartitionManager.Output_Partition_Logging();
// Fixup the RTC clock on devices which require it
if (crash_counter == 0)