Update getDiceChainKind for VSR >15

Bug: 346861728
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I8698663c29c8d91e7b39ca02e588b87377356363
This commit is contained in:
Karuna Wadhera
2024-08-22 17:41:53 +00:00
parent a7fffef352
commit eabdb6edf0

View File

@@ -974,15 +974,16 @@ ErrMsgOr<bytevec> parseAndValidateAuthenticatedRequestSignedPayload(
ErrMsgOr<hwtrust::DiceChain::Kind> getDiceChainKind() {
int vendor_api_level = ::android::base::GetIntProperty("ro.vendor.api_level", -1);
switch (vendor_api_level) {
case __ANDROID_API_T__:
return hwtrust::DiceChain::Kind::kVsr13;
case __ANDROID_API_U__:
return hwtrust::DiceChain::Kind::kVsr14;
case 202404: /* TODO(b/315056516) Use a version macro for vendor API 24Q2 */
return hwtrust::DiceChain::Kind::kVsr15;
default:
return "Unsupported vendor API level: " + std::to_string(vendor_api_level);
if (vendor_api_level == __ANDROID_API_T__) {
return hwtrust::DiceChain::Kind::kVsr13;
} else if (vendor_api_level == __ANDROID_API_U__) {
return hwtrust::DiceChain::Kind::kVsr14;
} else if (vendor_api_level == 202404) {
return hwtrust::DiceChain::Kind::kVsr15;
} else if (vendor_api_level > 202404) {
return hwtrust::DiceChain::Kind::kVsr16;
} else {
return "Unsupported vendor API level: " + std::to_string(vendor_api_level);
}
}