Move over to the C++ Fstab class
Test: build and boot
Change-Id: Id3850c9c133f6644073a2439368501253a2a94a9
diff --git a/FsCrypt.cpp b/FsCrypt.cpp
index 97f2619..e810d58 100644
--- a/FsCrypt.cpp
+++ b/FsCrypt.cpp
@@ -61,6 +61,7 @@
using android::base::StringPrintf;
using android::base::WriteStringToFile;
+using android::fs_mgr::GetEntryForMountPoint;
using android::vold::kEmptyAuthentication;
using android::vold::KeyBuffer;
@@ -276,12 +277,12 @@
}
static void get_data_file_encryption_modes(PolicyKeyRef* key_ref) {
- struct fstab_rec* rec = fs_mgr_get_entry_for_mount_point(fstab_default, DATA_MNT_POINT);
- char const* contents_mode;
- char const* filenames_mode;
- fs_mgr_get_file_encryption_modes(rec, &contents_mode, &filenames_mode);
- key_ref->contents_mode = contents_mode;
- key_ref->filenames_mode = filenames_mode;
+ auto entry = GetEntryForMountPoint(&fstab_default, DATA_MNT_POINT);
+ if (entry == nullptr) {
+ return;
+ }
+ key_ref->contents_mode = entry->file_contents_mode;
+ key_ref->filenames_mode = entry->file_names_mode;
}
static bool ensure_policy(const PolicyKeyRef& key_ref, const std::string& path) {