vold: Use separate flag for wrappedkey
Use a separate fstab flag for wrappedkey
support rather than file_contents_mode.
CRs-Fixed: 2316112
Change-Id: I4972514cdfc8e17abf1fca777cae39fb7a2e19a8
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
index 4432a21..4b3aeb3 100644
--- a/Ext4Crypt.cpp
+++ b/Ext4Crypt.cpp
@@ -199,25 +199,9 @@
return false;
}
-static bool is_wrapped_key_supported_common(const std::string& mount_point) {
- struct fstab_rec* rec = fs_mgr_get_entry_for_mount_point(fstab_default, mount_point);
- char const* contents_mode = NULL;
- char const* filenames_mode = NULL;
-
- fs_mgr_get_file_encryption_modes(rec, &contents_mode, &filenames_mode);
- if (!contents_mode || !filenames_mode) {
- LOG(ERROR) << "Couldn't read file or contents mode, returning false";
- return false;
- }
-
- if (strcmp(contents_mode, "ice_wrapped_key_supported") == 0)
- return true;
- else
- return false;
-}
-
bool is_wrapped_key_supported() {
- return is_wrapped_key_supported_common(DATA_MNT_POINT);
+ return fs_mgr_is_wrapped_key_supported(
+ fs_mgr_get_entry_for_mount_point(fstab_default, DATA_MNT_POINT));
}
bool is_wrapped_key_supported_external() {