Update KeyMint VTS tests to use pre-defined API level symbols
Test: VtsKeyMintAidlTargetTest
Change-Id: I11ccd0c4959a2b3504009fdd95f4a313a5d6d5f6
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index 41d47ee..d1f9651 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
@@ -214,7 +214,7 @@
* which is mandatory for KeyMint version 2 or first_api_level 33 or greater.
*/
bool KeyMintAidlTestBase::isDeviceIdAttestationRequired() {
- return AidlVersion() >= 2 || property_get_int32("ro.vendor.api_level", 0) >= 33;
+ return AidlVersion() >= 2 || property_get_int32("ro.vendor.api_level", 0) >= __ANDROID_API_T__;
}
/**
@@ -222,7 +222,7 @@
* which is supported for KeyMint version 3 or first_api_level greater than 33.
*/
bool KeyMintAidlTestBase::isSecondImeiIdAttestationRequired() {
- return AidlVersion() >= 3 && property_get_int32("ro.vendor.api_level", 0) > 33;
+ return AidlVersion() >= 3 && property_get_int32("ro.vendor.api_level", 0) > __ANDROID_API_T__;
}
bool KeyMintAidlTestBase::Curve25519Supported() {
@@ -845,7 +845,7 @@
int vendor_api_level = property_get_int32("ro.vendor.api_level", 0);
if (SecLevel() == SecurityLevel::STRONGBOX) {
// This is known to be broken on older vendor implementations.
- if (vendor_api_level < 33) {
+ if (vendor_api_level < __ANDROID_API_T__) {
compare_output = false;
} else {
additional_information = " (b/194134359) ";
@@ -2043,7 +2043,7 @@
}
void device_id_attestation_vsr_check(const ErrorCode& result) {
- if (get_vsr_api_level() >= 34) {
+ if (get_vsr_api_level() > __ANDROID_API_T__) {
ASSERT_FALSE(result == ErrorCode::INVALID_TAG)
<< "It is a specification violation for INVALID_TAG to be returned due to ID "
<< "mismatch in a Device ID Attestation call. INVALID_TAG is only intended to "