From f850e6e5648a8dad7678730d5f5c1710f410f827 Mon Sep 17 00:00:00 2001 From: Nikita Ioffe Date: Mon, 9 Dec 2019 21:19:11 +0000 Subject: [PATCH] Allow fscrypt_mount_metadata_encrypted to be called more than once In case of userspace reboot, this function will be called again to remount userdata into checkpoint mode. Test: adb shell setprop sys.init.userdata_remount.force_umount_f2fs 1 Test: adb shell /system/bin/vdc checkpoint startCheckpoint 1 Test: adb reboot userspace Test: adb shell dumpsys activity Bug: 135984674 Bug: 143970043 Change-Id: I300b1960a6c4e95b13c43d806c4f3a9e4a612ac4 --- MetadataCrypt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MetadataCrypt.cpp b/MetadataCrypt.cpp index abcf6db..3c2e0d5 100644 --- a/MetadataCrypt.cpp +++ b/MetadataCrypt.cpp @@ -189,7 +189,7 @@ bool fscrypt_mount_metadata_encrypted(const std::string& blk_device, const std:: bool needs_encrypt) { LOG(DEBUG) << "fscrypt_mount_metadata_encrypted: " << mount_point << " " << needs_encrypt; auto encrypted_state = android::base::GetProperty("ro.crypto.state", ""); - if (encrypted_state != "") { + if (encrypted_state != "" && encrypted_state != "encrypted") { LOG(DEBUG) << "fscrypt_enable_crypto got unexpected starting state: " << encrypted_state; return false; }