mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:23:37 +00:00
Add method to IFoo for testing NULL interfaces.
Bug: 32410513 Test: mma, hidl_test Change-Id: I791c3a95e670a859e5e494ead987d2a93f5047a5
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user