Revert "sdcard: only bind mount sdcard after successful preparation of data"

This reverts commit 60bb9f6369.
This commit is contained in:
Konsta
2022-02-19 12:01:05 +02:00
parent 60bb9f6369
commit a500eaef7f
2 changed files with 5 additions and 14 deletions

View File

@@ -658,6 +658,8 @@ void TWPartition::Setup_Data_Partition(bool Display_Error) {
UnMount(false);
#ifdef TW_INCLUDE_CRYPTO
if (datamedia)
Setup_Data_Media();
Can_Be_Encrypted = true;
char crypto_blkdev[255];
property_get("ro.crypto.fs_crypto_blkdev", crypto_blkdev, "error");
@@ -665,8 +667,6 @@ void TWPartition::Setup_Data_Partition(bool Display_Error) {
Set_FBE_Status();
Decrypted_Block_Device = crypto_blkdev;
LOGINFO("Data already decrypted, new block device: '%s'\n", crypto_blkdev);
if (datamedia)
Setup_Data_Media();
DataManager::SetValue(TW_IS_ENCRYPTED, 0);
} else if (!Mount(false)) {
if (Is_Present) {
@@ -683,8 +683,6 @@ void TWPartition::Setup_Data_Partition(bool Display_Error) {
DataManager::SetValue("tw_crypto_pwtype_0", cryptfs_get_password_type());
DataManager::SetValue(TW_CRYPTO_PASSWORD, "");
DataManager::SetValue("tw_crypto_display", "");
if (datamedia)
Setup_Data_Media();
} else {
gui_err("mount_data_footer=Could not mount /data and unable to find crypto footer.");
}
@@ -707,9 +705,6 @@ void TWPartition::Setup_Data_Partition(bool Display_Error) {
LOGERR("Unable to decrypt FBE device\n");
} else {
DataManager::SetValue(TW_IS_ENCRYPTED, 0);
if (datamedia)
Setup_Data_Media();
}
}
if (datamedia && (!Is_Encrypted || (Is_Encrypted && Is_Decrypted))) {