IFoo: send struct with fmq.
Bug: 117239572
Test: hidl_test
Change-Id: I968916a9d62e1c8f7a237bd24e6b4267dd013366
diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal
index 9642e2a..f54994f 100644
--- a/tests/foo/1.0/IFoo.hal
+++ b/tests/foo/1.0/IFoo.hal
@@ -121,6 +121,10 @@
bitfield<BitField> bf;
};
+ struct WithFmq {
+ fmq_sync<uint8_t> descSync;
+ };
+
enum Discriminator : uint8_t {
BOOL,
INT,
@@ -204,4 +208,6 @@
createMyHandle() generates (MyHandle h);
createHandles(uint32_t size) generates (vec<handle> handles);
closeHandles();
+
+ repeatWithFmq(WithFmq withFmq) generates (WithFmq withFmq);
};
diff --git a/tests/foo/1.0/default/Foo.cpp b/tests/foo/1.0/default/Foo.cpp
index a31ab9f..461568b 100644
--- a/tests/foo/1.0/default/Foo.cpp
+++ b/tests/foo/1.0/default/Foo.cpp
@@ -379,6 +379,11 @@
return Void();
}
+Return<void> Foo::repeatWithFmq(const IFoo::WithFmq& withFmq, repeatWithFmq_cb _hidl_cb) {
+ _hidl_cb(withFmq);
+ return Void();
+}
+
IFoo* HIDL_FETCH_IFoo(const char* /* name */) {
return new Foo();
}
diff --git a/tests/foo/1.0/default/Foo.h b/tests/foo/1.0/default/Foo.h
index 7dd672b..d73179a 100644
--- a/tests/foo/1.0/default/Foo.h
+++ b/tests/foo/1.0/default/Foo.h
@@ -53,6 +53,8 @@
virtual Return<void> createMyHandle(createMyHandle_cb _hidl_cb) override;
virtual Return<void> createHandles(uint32_t size, createHandles_cb _hidl_cb) override;
virtual Return<void> closeHandles() override;
+ virtual Return<void> repeatWithFmq(const IFoo::WithFmq& withFmq,
+ repeatWithFmq_cb _hidl_cb) override;
Return<void> haveAVectorOfInterfaces(
const hidl_vec<sp<ISimple> > &in,
@@ -63,6 +65,7 @@
haveAVectorOfGenericInterfaces_cb _hidl_cb) override;
Return<void> echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) override;
+
private:
std::vector<::native_handle_t *> mHandles;
};