Yifan Hong | d5b5b2e | 2016-10-06 13:50:49 -0700 | [diff] [blame] | 1 | |
| 2 | #define LOG_TAG "hidl_test" |
| 3 | |
| 4 | #include "Bar.h" |
| 5 | #include <android-base/logging.h> |
| 6 | #include <inttypes.h> |
| 7 | |
| 8 | namespace android { |
| 9 | namespace hardware { |
| 10 | namespace tests { |
| 11 | namespace bar { |
| 12 | namespace V1_0 { |
| 13 | namespace implementation { |
| 14 | |
| 15 | Bar::Bar() { |
| 16 | mFoo = IFoo::getService("", true); |
| 17 | } |
| 18 | |
| 19 | // Methods from ::android::hardware::tests::foo::V1_0::IFoo follow. |
| 20 | Return<void> Bar::doThis(float param) { |
| 21 | return mFoo->doThis(param); |
| 22 | } |
| 23 | |
Yifan Hong | d5b5b2e | 2016-10-06 13:50:49 -0700 | [diff] [blame] | 24 | Return<int32_t> Bar::doThatAndReturnSomething( |
| 25 | int64_t param) { |
| 26 | return mFoo->doThatAndReturnSomething(param); |
| 27 | } |
| 28 | |
| 29 | Return<double> Bar::doQuiteABit( |
| 30 | int32_t a, |
| 31 | int64_t b, |
| 32 | float c, |
| 33 | double d) { |
| 34 | return mFoo->doQuiteABit(a, b, c, d); |
| 35 | } |
| 36 | |
| 37 | Return<void> Bar::doSomethingElse( |
| 38 | const hidl_array<int32_t, 15> ¶m, doSomethingElse_cb _cb) { |
| 39 | return mFoo->doSomethingElse(param, _cb); |
| 40 | } |
| 41 | |
| 42 | Return<void> Bar::doStuffAndReturnAString( |
| 43 | doStuffAndReturnAString_cb _cb) { |
| 44 | return mFoo->doStuffAndReturnAString(_cb); |
| 45 | } |
| 46 | |
| 47 | Return<void> Bar::mapThisVector( |
| 48 | const hidl_vec<int32_t> ¶m, mapThisVector_cb _cb) { |
| 49 | return mFoo->mapThisVector(param, _cb); |
| 50 | } |
| 51 | |
| 52 | Return<void> Bar::callMe( |
| 53 | const sp<IFooCallback> &cb) { |
| 54 | return mFoo->callMe(cb); |
| 55 | } |
| 56 | |
| 57 | Return<Bar::SomeEnum> Bar::useAnEnum(SomeEnum param) { |
| 58 | return mFoo->useAnEnum(param); |
| 59 | } |
| 60 | |
| 61 | Return<void> Bar::haveAGooberVec(const hidl_vec<Goober>& param) { |
| 62 | return mFoo->haveAGooberVec(param); |
| 63 | } |
| 64 | |
| 65 | Return<void> Bar::haveAGoober(const Goober &g) { |
| 66 | return mFoo->haveAGoober(g); |
| 67 | } |
| 68 | |
| 69 | Return<void> Bar::haveAGooberArray(const hidl_array<Goober, 20> &lots) { |
| 70 | return mFoo->haveAGooberArray(lots); |
| 71 | } |
| 72 | |
| 73 | Return<void> Bar::haveATypeFromAnotherFile(const Abc &def) { |
| 74 | return mFoo->haveATypeFromAnotherFile(def); |
| 75 | } |
| 76 | |
| 77 | Return<void> Bar::haveSomeStrings( |
| 78 | const hidl_array<hidl_string, 3> &array, |
| 79 | haveSomeStrings_cb _cb) { |
| 80 | return mFoo->haveSomeStrings(array, _cb); |
| 81 | } |
| 82 | |
| 83 | Return<void> Bar::haveAStringVec( |
| 84 | const hidl_vec<hidl_string> &vector, |
| 85 | haveAStringVec_cb _cb) { |
| 86 | return mFoo->haveAStringVec(vector, _cb); |
| 87 | } |
| 88 | |
| 89 | Return<void> Bar::transposeMe( |
| 90 | const hidl_array<float, 3, 5> &in, transposeMe_cb _cb) { |
| 91 | return mFoo->transposeMe(in, _cb); |
| 92 | } |
| 93 | |
| 94 | Return<void> Bar::callingDrWho( |
| 95 | const MultiDimensional &in, callingDrWho_cb _hidl_cb) { |
| 96 | return mFoo->callingDrWho(in, _hidl_cb); |
| 97 | } |
| 98 | |
| 99 | Return<void> Bar::transpose(const StringMatrix5x3 &in, transpose_cb _hidl_cb) { |
| 100 | return mFoo->transpose(in, _hidl_cb); |
| 101 | } |
| 102 | |
| 103 | Return<void> Bar::transpose2( |
| 104 | const hidl_array<hidl_string, 5, 3> &in, transpose2_cb _hidl_cb) { |
| 105 | return mFoo->transpose2(in, _hidl_cb); |
| 106 | } |
| 107 | |
| 108 | Return<void> Bar::sendVec( |
| 109 | const hidl_vec<uint8_t> &data, sendVec_cb _hidl_cb) { |
| 110 | return mFoo->sendVec(data, _hidl_cb); |
| 111 | } |
| 112 | |
| 113 | Return<void> Bar::sendVecVec(sendVecVec_cb _hidl_cb) { |
| 114 | return mFoo->sendVecVec(_hidl_cb); |
| 115 | } |
| 116 | |
Andreas Huber | 847b145 | 2016-10-19 14:10:55 -0700 | [diff] [blame] | 117 | Return<void> Bar::haveAVectorOfInterfaces( |
| 118 | const hidl_vec<sp<ISimple> > &in, |
| 119 | haveAVectorOfInterfaces_cb _hidl_cb) { |
| 120 | _hidl_cb(in); |
| 121 | |
| 122 | return Void(); |
| 123 | } |
| 124 | |
| 125 | Return<void> Bar::haveAVectorOfGenericInterfaces( |
| 126 | const hidl_vec<sp<android::hardware::IBinder> > &in, |
| 127 | haveAVectorOfGenericInterfaces_cb _hidl_cb) { |
| 128 | _hidl_cb(in); |
| 129 | |
| 130 | return Void(); |
| 131 | } |
| 132 | |
Yifan Hong | ebfa633 | 2016-10-14 10:41:41 -0700 | [diff] [blame] | 133 | Return<void> Bar::createMyHandle(createMyHandle_cb _hidl_cb) { |
| 134 | return mFoo->createMyHandle(_hidl_cb); |
| 135 | } |
| 136 | |
| 137 | Return<void> Bar::createHandles(uint32_t size, createHandles_cb _hidl_cb) { |
| 138 | return mFoo->createHandles(size, _hidl_cb); |
| 139 | } |
| 140 | |
| 141 | Return<void> Bar::closeHandles() { |
| 142 | return mFoo->closeHandles(); |
| 143 | } |
| 144 | |
Martijn Coenen | b7307d5 | 2016-10-27 11:51:46 +0200 | [diff] [blame] | 145 | Return<void> Bar::echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) { |
| 146 | return mFoo->echoNullInterface(cb, _hidl_cb); |
| 147 | } |
| 148 | |
Yifan Hong | d5b5b2e | 2016-10-06 13:50:49 -0700 | [diff] [blame] | 149 | // Methods from ::android::hardware::tests::bar::V1_0::IBar follow. |
| 150 | Return<void> Bar::thisIsNew() { |
| 151 | ALOGI("SERVER(Bar) thisIsNew"); |
| 152 | |
| 153 | return Void(); |
| 154 | } |
| 155 | |
Yifan Hong | 688bb1e | 2016-10-27 13:18:43 -0700 | [diff] [blame] | 156 | Return<void> Bar::expectNullHandle(const native_handle_t* h, const Abc& xyz, expectNullHandle_cb _hidl_cb) { |
| 157 | ALOGI("SERVER(Bar) h = %p, xyz.z = %p", h, xyz.z); |
| 158 | _hidl_cb(h == nullptr, xyz.z == nullptr); |
| 159 | return Void(); |
| 160 | } |
| 161 | |
Yifan Hong | d5b5b2e | 2016-10-06 13:50:49 -0700 | [diff] [blame] | 162 | IBar* HIDL_FETCH_IBar(const char* /* name */) { |
| 163 | return new Bar(); |
| 164 | } |
| 165 | |
| 166 | } // namespace implementation |
| 167 | } // namespace V1_0 |
| 168 | } // namespace bar |
| 169 | } // namespace tests |
| 170 | } // namespace hardware |
| 171 | } // namespace android |