From 893b1ae313810231b1b940de79593d701f43b8c6 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 15 Jun 2022 18:52:39 +0000 Subject: [PATCH] Rename fscrypt_is_native() to IsFbeEnabled() Now that emulated FBE is no longer supported, there is no longer any distinction between native FBE and emulated FBE. There is just FBE. Referring to FBE as "fscrypt" is also poor practice, as fscrypt (the Linux kernel support for filesystem-level encryption) is just one part of FBE, the Android feature. Therefore, rename fscrypt_is_native() to IsFbeEnabled(). Bug: 232458753 Change-Id: Ib4dcdf799833b91d326b4b6f7120b0a3d4f4fc31 --- init/builtins.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/builtins.cpp b/init/builtins.cpp index 9e1d93c6b..38f6f3939 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -426,7 +426,7 @@ static Result make_dir_with_options(const MkdirOptions& options) { return ErrnoError() << "fchmodat() failed on " << options.target; } } - if (fscrypt_is_native()) { + if (IsFbeEnabled()) { if (!FscryptSetDirectoryPolicy(ref_basename, options.fscrypt_action, options.target)) { return reboot_into_recovery( {"--prompt_and_wipe_data", "--reason=set_policy_failed:"s + options.target}); @@ -1175,7 +1175,7 @@ static Result ExecVdcRebootOnFailure(const std::string& vdc_arg) { auto reboot = [reboot_reason, should_reboot_into_recovery](const std::string& message) { // TODO (b/122850122): support this in gsi if (should_reboot_into_recovery) { - if (fscrypt_is_native() && !android::gsi::IsGsiRunning()) { + if (IsFbeEnabled() && !android::gsi::IsGsiRunning()) { LOG(ERROR) << message << ": Rebooting into recovery, reason: " << reboot_reason; if (auto result = reboot_into_recovery( {"--prompt_and_wipe_data", "--reason="s + reboot_reason});