From 18935386bee653e3f7a9db24cec8c0c07f3059c2 Mon Sep 17 00:00:00 2001 From: Kyle Zhang Date: Thu, 14 Nov 2024 23:42:36 +0000 Subject: [PATCH] Skip VtsAidlHalDrmTargetTest if bootloader is unlocked Bug: 374023066 Test: atest VtsAidlHalDrmTargetTest Change-Id: I82125e6cdd1c3c5a712f52177c6493c9204eed48 --- drm/aidl/vts/drm_hal_common.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drm/aidl/vts/drm_hal_common.cpp b/drm/aidl/vts/drm_hal_common.cpp index f0445a503f..3636250e11 100644 --- a/drm/aidl/vts/drm_hal_common.cpp +++ b/drm/aidl/vts/drm_hal_common.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #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())));