mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 20:24:19 +00:00
Add test for null native_handle_t*.
Test: hidl_test Bug: 30814137 Change-Id: Ic52a4c588e2fde3859a0ae8c098e5cb60a87efe8
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package android.hardware.tests.bar@1.0;
|
||||
|
||||
import android.hardware.tests.foo@1.0::IFoo;
|
||||
import android.hardware.tests.foo@1.0::Abc;
|
||||
import android.hardware.tests.foo@1.0::Unrelated;
|
||||
|
||||
interface IBar extends android.hardware.tests.foo@1.0::IFoo {
|
||||
@@ -29,4 +30,5 @@ interface IBar extends android.hardware.tests.foo@1.0::IFoo {
|
||||
};
|
||||
|
||||
thisIsNew();
|
||||
expectNullHandle(handle h, Abc xyz) generates (bool hIsNull, bool xyzHasNull);
|
||||
};
|
||||
|
||||
@@ -153,6 +153,12 @@ Return<void> Bar::thisIsNew() {
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> Bar::expectNullHandle(const native_handle_t* h, const Abc& xyz, expectNullHandle_cb _hidl_cb) {
|
||||
ALOGI("SERVER(Bar) h = %p, xyz.z = %p", h, xyz.z);
|
||||
_hidl_cb(h == nullptr, xyz.z == nullptr);
|
||||
return Void();
|
||||
}
|
||||
|
||||
IBar* HIDL_FETCH_IBar(const char* /* name */) {
|
||||
return new Bar();
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ struct Bar : public IBar {
|
||||
|
||||
// Methods from ::android::hardware::tests::bar::V1_0::IBar follow.
|
||||
Return<void> thisIsNew() override;
|
||||
Return<void> expectNullHandle(const native_handle_t* h, const Abc& xyz, expectNullHandle_cb _hidl_cb) override;
|
||||
|
||||
private:
|
||||
sp<IFoo> mFoo;
|
||||
|
||||
Reference in New Issue
Block a user