tw_crypto_pwtype: move default setting to data.cpp

Change-Id: Id3dda3bc2c32ad286b1ec67595f482f84b5077d7
(cherry picked from commit e331b8a1b7e55dd13d83009320856fc3763dcf61)
diff --git a/data.cpp b/data.cpp
index f19a2ed..7661d69 100755
--- a/data.cpp
+++ b/data.cpp
@@ -779,6 +779,7 @@
 	mData.SetValue(TW_IS_ENCRYPTED, "0");
 	mData.SetValue(TW_IS_DECRYPTED, "0");
 	mData.SetValue(TW_CRYPTO_PASSWORD, "0");
+	mData.SetValue(TW_CRYPTO_PWTYPE, "0"); // Set initial value so that recovery will not be confused when using unencrypted data or failed to decrypt data
 	mData.SetValue("tw_terminal_state", "0");
 	mData.SetValue("tw_background_thread_running", "0");
 	mData.SetValue(TW_RESTORE_FILE_DATE, "0");
diff --git a/partition.cpp b/partition.cpp
index 71af849..3b85a8c 100755
--- a/partition.cpp
+++ b/partition.cpp
@@ -736,7 +736,6 @@
 bool TWPartition::Decrypt_FBE_DE() {
 	if (TWFunc::Path_Exists("/data/unencrypted/key/version")) {
 		DataManager::SetValue(TW_IS_FBE, 1);
-		DataManager::SetValue(TW_CRYPTO_PWTYPE, "0"); // Set initial value so that recovery will not be confused when using unencrypted data or failed to decrypt data
 		PartitionManager.Set_Crypto_State();
 		PartitionManager.Set_Crypto_Type("file");
 		LOGINFO("File Based Encryption is present\n");