Skip VtsAidlHalDrmTargetTest if bootloader is unlocked

Bug: 374023066
Test: atest VtsAidlHalDrmTargetTest
Change-Id: I82125e6cdd1c3c5a712f52177c6493c9204eed48
This commit is contained in:
Kyle Zhang
2024-11-14 23:42:36 +00:00
parent 7074af9d87
commit 18935386be

View File

@@ -27,6 +27,7 @@
#include <android/binder_process.h>
#include <android/sharedmem.h>
#include <cutils/native_handle.h>
#include <cutils/properties.h>
#include "drm_hal_clearkey_module.h"
#include "drm_hal_common.h"
@@ -193,6 +194,13 @@ void DrmHalTest::SetUp() {
GTEST_SKIP() << "No vendor module installed";
}
char bootloader_state[PROPERTY_VALUE_MAX] = {};
if (property_get("ro.boot.vbmeta.device_state", bootloader_state, "") != 0) {
if (!strcmp(bootloader_state, "unlocked")) {
GTEST_SKIP() << "Skip test because bootloader is unlocked";
}
}
if (drmInstance.find("IDrmFactory") != std::string::npos) {
drmFactory = IDrmFactory::fromBinder(
::ndk::SpAIBinder(AServiceManager_waitForService(drmInstance.c_str())));