summaryrefslogtreecommitdiff
path: root/tests/msgq/1.0/default/mq_test_service.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/msgq/1.0/default/mq_test_service.cpp')
-rw-r--r--tests/msgq/1.0/default/mq_test_service.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/msgq/1.0/default/mq_test_service.cpp b/tests/msgq/1.0/default/mq_test_service.cpp
index b921bfd34e..72ffe41b74 100644
--- a/tests/msgq/1.0/default/mq_test_service.cpp
+++ b/tests/msgq/1.0/default/mq_test_service.cpp
@@ -16,8 +16,14 @@
#define LOG_TAG "FMQ_UnitTests"
+#include <TestAidlMsgQ.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
#include <android/hardware/tests/msgq/1.0/ITestMsgQ.h>
+using aidl::android::fmq::test::TestAidlMsgQ;
+
#include <hidl/LegacySupport.h>
using android::hardware::tests::msgq::V1_0::ITestMsgQ;
@@ -25,5 +31,17 @@ using android::hardware::defaultPassthroughServiceImplementation;
int main() {
android::hardware::details::setTrebleTestingOverride(true);
- return defaultPassthroughServiceImplementation<ITestMsgQ>();
+ // Register AIDL service
+ ABinderProcess_startThreadPool();
+ std::shared_ptr<TestAidlMsgQ> store = ndk::SharedRefBase::make<TestAidlMsgQ>();
+
+ const std::string instance = std::string() + TestAidlMsgQ::descriptor + "/default";
+ LOG(INFO) << "instance: " << instance;
+ CHECK(AServiceManager_addService(store->asBinder().get(), instance.c_str()) == STATUS_OK);
+
+ // Register HIDL service
+ CHECK(defaultPassthroughServiceImplementation<ITestMsgQ>() == android::OK);
+ ABinderProcess_joinThreadPool();
+
+ return EXIT_FAILURE; // should not reach
}