diff options
author | Devin Moore <devinmoore@google.com> | 2020-07-08 09:31:08 -0700 |
---|---|---|
committer | Devin Moore <devinmoore@google.com> | 2020-08-14 09:21:22 -0700 |
commit | 1b34d67b7a3572b884398fafebacc23baac8853d (patch) | |
tree | 4c807dcf7ceeb2e7d3d80a0b1d3bf80d5e90599c /tests/msgq/1.0/default/mq_test_service.cpp | |
parent | fcd14d18244248c89f98113a875bcdb56d572de7 (diff) |
Adding AidlMQDescriptor and GrantorDescriptor
Adding these two types to android.hardware.common for future use with
Fast Message Queue in libfmq.
Also adding to the mq_test_service to test them.
Test: system/tools/hidl/tests/run_all_device_tests.sh
Bug: 142326204
Change-Id: I424c4849c822436f58e40f206b09ffdf9baf260b
Diffstat (limited to 'tests/msgq/1.0/default/mq_test_service.cpp')
-rw-r--r-- | tests/msgq/1.0/default/mq_test_service.cpp | 20 |
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 } |