From 75ebdd9c7c07116c23e64fca6dd2727e327ea432 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 10 Aug 2020 11:14:51 -0700 Subject: [PATCH] fs_mgr: use __ANDROID_API_Q__ instead of pre_gki_level The name "pre_gki_level" is causing some confusion because not all devices launching with Android R are subject to the GKI requirement. (See b/161563110#comment11.) E.g., devices that use a 4.14-based kernel are exempt from GKI. However, the encryption requirements still apply. Just use __ANDROID_API_Q__ directly instead. No change in behavior. Change-Id: I4242745ccc9f88e084a1adfab5796daa9bc59b6e --- fs_mgr/fs_mgr.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp index 9f22be511..1462cc91b 100644 --- a/fs_mgr/fs_mgr.cpp +++ b/fs_mgr/fs_mgr.cpp @@ -1113,10 +1113,9 @@ class CheckpointManager { // metadata-encrypted device with smaller blocks, we must not change this for // devices shipped with Q or earlier unless they explicitly selected dm-default-key // v2 - constexpr unsigned int pre_gki_level = __ANDROID_API_Q__; unsigned int options_format_version = android::base::GetUintProperty( "ro.crypto.dm_default_key.options_format.version", - (android::fscrypt::GetFirstApiLevel() <= pre_gki_level ? 1 : 2)); + (android::fscrypt::GetFirstApiLevel() <= __ANDROID_API_Q__ ? 1 : 2)); if (options_format_version > 1) { bowTarget->SetBlockSize(4096); }