Fully switch to mke2fs; set policies everywhere.
Older make_ext4fs doesn't support enabling quotas, so switch everyone
over to using mke2fs for adoptable storage.
Remove UUID check so that we start setting ext4-crypto policies on
adoptable storage devices; a future change will handle the actual
key management.
Bug: 30230655, 36757864
Test: cts-tradefed run commandAndExit cts-dev --abi armeabi-v7a -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Change-Id: I021f85b1be8431044c239521c37be96534682746
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
index c3e0cc3..13cff0d 100644
--- a/Ext4Crypt.cpp
+++ b/Ext4Crypt.cpp
@@ -599,8 +599,7 @@
if (!prepare_dir(misc_de_path, 01771, AID_SYSTEM, AID_MISC)) return false;
if (!prepare_dir(user_de_path, 0771, AID_SYSTEM, AID_SYSTEM)) return false;
- // For now, FBE is only supported on internal storage
- if (e4crypt_is_native() && volume_uuid == nullptr) {
+ if (e4crypt_is_native()) {
std::string de_raw_ref;
if (!lookup_key_ref(s_de_key_raw_refs, user_id, &de_raw_ref)) return false;
if (!ensure_policy(de_raw_ref, system_de_path)) return false;
@@ -621,8 +620,7 @@
if (!prepare_dir(media_ce_path, 0770, AID_MEDIA_RW, AID_MEDIA_RW)) return false;
if (!prepare_dir(user_ce_path, 0771, AID_SYSTEM, AID_SYSTEM)) return false;
- // For now, FBE is only supported on internal storage
- if (e4crypt_is_native() && volume_uuid == nullptr) {
+ if (e4crypt_is_native()) {
std::string ce_raw_ref;
if (!lookup_key_ref(s_ce_key_raw_refs, user_id, &ce_raw_ref)) return false;
if (!ensure_policy(ce_raw_ref, system_ce_path)) return false;