summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bar/1.0/default/Bar.cpp4
-rw-r--r--tests/bar/1.0/default/Bar.h2
-rw-r--r--tests/foo/1.0/IFoo.hal3
-rw-r--r--tests/foo/1.0/default/Foo.cpp6
-rw-r--r--tests/foo/1.0/default/Foo.h2
5 files changed, 17 insertions, 0 deletions
diff --git a/tests/bar/1.0/default/Bar.cpp b/tests/bar/1.0/default/Bar.cpp
index b960524b20..0257ee0b0e 100644
--- a/tests/bar/1.0/default/Bar.cpp
+++ b/tests/bar/1.0/default/Bar.cpp
@@ -142,6 +142,10 @@ Return<void> Bar::closeHandles() {
return mFoo->closeHandles();
}
+Return<void> Bar::echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) {
+ return mFoo->echoNullInterface(cb, _hidl_cb);
+}
+
// Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
Return<void> Bar::thisIsNew() {
ALOGI("SERVER(Bar) thisIsNew");
diff --git a/tests/bar/1.0/default/Bar.h b/tests/bar/1.0/default/Bar.h
index 6fea563048..ec55e8b1fd 100644
--- a/tests/bar/1.0/default/Bar.h
+++ b/tests/bar/1.0/default/Bar.h
@@ -60,6 +60,8 @@ struct Bar : public IBar {
const hidl_vec<sp<android::hardware::IBinder> > &in,
haveAVectorOfGenericInterfaces_cb _hidl_cb) override;
+ Return<void> echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) override;
+
// Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
Return<void> thisIsNew() override;
diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal
index c06fc05b8f..ea69e1ebe4 100644
--- a/tests/foo/1.0/IFoo.hal
+++ b/tests/foo/1.0/IFoo.hal
@@ -117,6 +117,9 @@ interface IFoo {
haveAVectorOfGenericInterfaces(vec<interface> in)
generates (vec<interface> out);
+
+ echoNullInterface(IFooCallback cb) generates (bool receivedNull, IFooCallback cb);
+
createMyHandle() generates (MyHandle h);
createHandles(uint32_t size) generates (vec<handle> handles);
closeHandles();
diff --git a/tests/foo/1.0/default/Foo.cpp b/tests/foo/1.0/default/Foo.cpp
index cf4f9755c6..f7cc7c0a43 100644
--- a/tests/foo/1.0/default/Foo.cpp
+++ b/tests/foo/1.0/default/Foo.cpp
@@ -328,6 +328,12 @@ Return<void> Foo::closeHandles() {
return Void();
}
+Return<void> Foo::echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) {
+ _hidl_cb(cb == nullptr, cb);
+
+ 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 e61291d563..703c2103b6 100644
--- a/tests/foo/1.0/default/Foo.h
+++ b/tests/foo/1.0/default/Foo.h
@@ -56,6 +56,8 @@ struct Foo : public IFoo {
Return<void> haveAVectorOfGenericInterfaces(
const hidl_vec<sp<android::hardware::IBinder> > &in,
haveAVectorOfGenericInterfaces_cb _hidl_cb) override;
+
+ Return<void> echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) override;
private:
std::vector<::native_handle_t *> mHandles;
};