wrappedkey: only run check on FBE devices
Change-Id: I3713fc4619279d8ee2de924df2bc4fbde944d834
diff --git a/partition.cpp b/partition.cpp
index a34d854..17614ff 100755
--- a/partition.cpp
+++ b/partition.cpp
@@ -693,7 +693,9 @@
Primary_Block_Device.c_str(), Mount_Point.c_str());
}
} else {
- if (!Decrypt_FBE_DE()) {
+ int is_device_fbe;
+ DataManager::GetValue(TW_IS_FBE, is_device_fbe);
+ if (!Decrypt_FBE_DE() && is_device_fbe == 1) {
char wrappedvalue[PROPERTY_VALUE_MAX];
property_get("fbe.data.wrappedkey", wrappedvalue, "");
std::string wrappedkeyvalue(wrappedvalue);
@@ -723,7 +725,7 @@
bool TWPartition::Decrypt_FBE_DE() {
if (TWFunc::Path_Exists("/data/unencrypted/key/version")) {
DataManager::SetValue(TW_IS_FBE, 1);
- property_set("ro.crypto.state", "encrypted");
+ property_set("ro.crypto.state", "encrypted");
property_set("ro.crypto.type", "file");
LOGINFO("File Based Encryption is present\n");
#ifdef TW_INCLUDE_FBE