From 85b7f66b7762f17769629c2fd5843ce8447626ec Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Thu, 28 Mar 2024 20:06:48 +0000 Subject: [PATCH] Fix fmq_test when HIDL is not supported If HIDL is not supported on the device, don't expect to be able to register the HIDL service. Test: atest fmq_test Bug: 218588089 Change-Id: I1764b26f06ef8f280f719d8ab44db2ebfe562944 --- tests/msgq/1.0/default/mq_test_service.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/msgq/1.0/default/mq_test_service.cpp b/tests/msgq/1.0/default/mq_test_service.cpp index 72ffe41b74..66ad12f236 100644 --- a/tests/msgq/1.0/default/mq_test_service.cpp +++ b/tests/msgq/1.0/default/mq_test_service.cpp @@ -21,13 +21,15 @@ #include #include #include +#include using aidl::android::fmq::test::TestAidlMsgQ; #include -using android::hardware::tests::msgq::V1_0::ITestMsgQ; using android::hardware::defaultPassthroughServiceImplementation; +using android::hardware::isHidlSupported; +using android::hardware::tests::msgq::V1_0::ITestMsgQ; int main() { android::hardware::details::setTrebleTestingOverride(true); @@ -39,8 +41,10 @@ int main() { LOG(INFO) << "instance: " << instance; CHECK(AServiceManager_addService(store->asBinder().get(), instance.c_str()) == STATUS_OK); - // Register HIDL service - CHECK(defaultPassthroughServiceImplementation() == android::OK); + if (isHidlSupported()) { + // Register HIDL service + CHECK(defaultPassthroughServiceImplementation() == android::OK); + } ABinderProcess_joinThreadPool(); return EXIT_FAILURE; // should not reach