Yifan Hong | d5b5b2e | 2016-10-06 13:50:49 -0700 | [diff] [blame^] | 1 | #ifndef HIDL_GENERATED_android_hardware_tests_foo_V1_0_FooCallback_H_ |
| 2 | #define HIDL_GENERATED_android_hardware_tests_foo_V1_0_FooCallback_H_ |
| 3 | |
| 4 | #include <android/hardware/tests/foo/1.0/IFooCallback.h> |
| 5 | #include <hidl/Status.h> |
| 6 | #include <hidl/MQDescriptor.h> |
| 7 | |
| 8 | #include <utils/Condition.h> |
| 9 | #include <utils/Timers.h> |
| 10 | namespace android { |
| 11 | namespace hardware { |
| 12 | namespace tests { |
| 13 | namespace foo { |
| 14 | namespace V1_0 { |
| 15 | namespace implementation { |
| 16 | |
| 17 | using ::android::hardware::tests::foo::V1_0::IFooCallback; |
| 18 | using ::android::hardware::Return; |
| 19 | using ::android::hardware::Void; |
| 20 | using ::android::hardware::hidl_vec; |
| 21 | using ::android::hardware::hidl_string; |
| 22 | using ::android::sp; |
| 23 | |
| 24 | struct FooCallback : public IFooCallback { |
| 25 | FooCallback() : mLock{}, mCond{} {} |
| 26 | // Methods from ::android::hardware::tests::foo::V1_0::IFooCallback follow. |
| 27 | Return<void> heyItsYou(const sp<IFooCallback>& cb) override; |
| 28 | Return<bool> heyItsYouIsntIt(const sp<IFooCallback>& cb) override; |
| 29 | Return<void> heyItsTheMeaningOfLife(uint8_t tmol) override; |
| 30 | Return<void> reportResults(int64_t ns, reportResults_cb _hidl_cb) override; |
| 31 | Return<void> youBlockedMeFor(const hidl_array<int64_t, 3 /* 3 */>& callerBlockedInfo) override; |
| 32 | |
| 33 | static constexpr nsecs_t DELAY_S = 1; |
| 34 | static constexpr nsecs_t DELAY_NS = seconds_to_nanoseconds(DELAY_S); |
| 35 | static constexpr nsecs_t TOLERANCE_NS = milliseconds_to_nanoseconds(10); |
| 36 | static constexpr nsecs_t ONEWAY_TOLERANCE_NS = milliseconds_to_nanoseconds(1); |
| 37 | |
| 38 | hidl_array<InvokeInfo, 3> invokeInfo; |
| 39 | Mutex mLock; |
| 40 | Condition mCond; |
| 41 | }; |
| 42 | |
| 43 | extern "C" IFooCallback* HIDL_FETCH_IFooCallback(const char* name); |
| 44 | |
| 45 | } // namespace implementation |
| 46 | } // namespace V1_0 |
| 47 | } // namespace foo |
| 48 | } // namespace tests |
| 49 | } // namespace hardware |
| 50 | } // namespace android |
| 51 | |
| 52 | #endif // HIDL_GENERATED_android_hardware_tests_foo_V1_0_FooCallback_H_ |