crypto: only show FBE error if device is encrypted

Change-Id: I60da4ff71a15e5bc4e13135abf268bff1c88b8d1
diff --git a/partition.cpp b/partition.cpp
index f71f36f..e0c32b1 100755
--- a/partition.cpp
+++ b/partition.cpp
@@ -698,10 +698,14 @@
 		Set_FBE_Status();
 		int is_device_fbe;
 		DataManager::GetValue(TW_IS_FBE, is_device_fbe);
-		if (!Decrypt_FBE_DE() && is_device_fbe == 1) {
-			LOGERR("Unable to decrypt FBE device\n");
+		char crypto_state[255];
+		property_get("ro.crypto.state", crypto_state, "error");
+		if (!Decrypt_FBE_DE() && strcmp(crypto_state, "error") != 0) {
+			if (is_device_fbe == 1)
+				LOGERR("Unable to decrypt FBE device\n");
+		} else {
+			DataManager::SetValue(TW_IS_ENCRYPTED, 0);
 		}
-		DataManager::SetValue(TW_IS_ENCRYPTED, 0);
 	}
 	if (datamedia && (!Is_Encrypted || (Is_Encrypted && Is_Decrypted))) {
 		Setup_Data_Media();