Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <string> |
| 18 | |
Elliott Hughes | 0a62067 | 2015-12-04 13:53:18 -0800 | [diff] [blame] | 19 | #include <android-base/stringprintf.h> |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 20 | #include <gtest/gtest.h> |
| 21 | |
Casey Dahlin | 2cc9316 | 2015-10-02 16:14:17 -0700 | [diff] [blame] | 22 | #include "aidl.h" |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 23 | #include "aidl_language.h" |
| 24 | #include "ast_cpp.h" |
| 25 | #include "code_writer.h" |
Christopher Wiley | ad33927 | 2015-10-05 19:11:58 -0700 | [diff] [blame] | 26 | #include "generate_cpp.h" |
Christopher Wiley | 9d6e0b2 | 2015-11-13 12:18:16 -0800 | [diff] [blame] | 27 | #include "os.h" |
Christopher Wiley | 4a2884b | 2015-10-07 11:27:45 -0700 | [diff] [blame] | 28 | #include "tests/fake_io_delegate.h" |
Casey Dahlin | 80ada3d | 2015-10-20 20:33:56 -0700 | [diff] [blame] | 29 | #include "tests/test_util.h" |
Christopher Wiley | e3550c6 | 2015-09-29 13:26:10 -0700 | [diff] [blame] | 30 | #include "type_cpp.h" |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 31 | |
Casey Dahlin | b8d9e88 | 2015-11-24 10:57:23 -0800 | [diff] [blame] | 32 | using ::android::aidl::test::FakeIoDelegate; |
| 33 | using ::android::base::StringPrintf; |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 34 | using std::string; |
| 35 | using std::unique_ptr; |
| 36 | |
| 37 | namespace android { |
| 38 | namespace aidl { |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 39 | namespace cpp { |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 40 | namespace { |
| 41 | |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 42 | const string kComplexTypeInterfaceAIDL = |
| 43 | R"(package android.os; |
Casey Dahlin | 389781f | 2015-10-22 13:13:21 -0700 | [diff] [blame] | 44 | import foo.IFooType; |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 45 | interface IComplexTypeInterface { |
Casey Dahlin | d40e2fe | 2015-11-24 14:06:52 -0800 | [diff] [blame] | 46 | const int MY_CONSTANT = 3; |
Casey Dahlin | cb5317d | 2015-12-03 15:43:33 -0800 | [diff] [blame] | 47 | int[] Send(in @nullable int[] goes_in, inout double[] goes_in_and_out, out boolean[] goes_out); |
Casey Dahlin | 0dd08af | 2015-10-20 18:45:50 -0700 | [diff] [blame] | 48 | oneway void Piff(int times); |
Casey Dahlin | 389781f | 2015-10-22 13:13:21 -0700 | [diff] [blame] | 49 | IFooType TakesABinder(IFooType f); |
Casey Dahlin | ef88bce | 2016-04-15 11:55:30 -0700 | [diff] [blame] | 50 | @nullable IFooType NullableBinder(); |
Christopher Wiley | 56c9bf3 | 2015-10-30 10:41:12 -0700 | [diff] [blame] | 51 | List<String> StringListMethod(in java.util.List<String> input, out List<String> output); |
Casey Dahlin | 7ecd69f | 2015-11-03 13:52:38 -0800 | [diff] [blame] | 52 | List<IBinder> BinderListMethod(in java.util.List<IBinder> input, out List<IBinder> output); |
Casey Dahlin | a4ba4b6 | 2015-11-02 15:43:30 -0800 | [diff] [blame] | 53 | FileDescriptor TakesAFileDescriptor(in FileDescriptor f); |
| 54 | FileDescriptor[] TakesAFileDescriptorArray(in FileDescriptor[] f); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 55 | })"; |
| 56 | |
| 57 | const char kExpectedComplexTypeClientHeaderOutput[] = |
| 58 | R"(#ifndef AIDL_GENERATED_ANDROID_OS_BP_COMPLEX_TYPE_INTERFACE_H_ |
| 59 | #define AIDL_GENERATED_ANDROID_OS_BP_COMPLEX_TYPE_INTERFACE_H_ |
| 60 | |
| 61 | #include <binder/IBinder.h> |
| 62 | #include <binder/IInterface.h> |
| 63 | #include <utils/Errors.h> |
| 64 | #include <android/os/IComplexTypeInterface.h> |
| 65 | |
| 66 | namespace android { |
| 67 | |
| 68 | namespace os { |
| 69 | |
Casey Dahlin | b8d9e88 | 2015-11-24 10:57:23 -0800 | [diff] [blame] | 70 | class BpComplexTypeInterface : public ::android::BpInterface<IComplexTypeInterface> { |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 71 | public: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 72 | explicit BpComplexTypeInterface(const ::android::sp<::android::IBinder>& _aidl_impl); |
| 73 | virtual ~BpComplexTypeInterface() = default; |
| 74 | ::android::binder::Status Send(const ::std::unique_ptr<::std::vector<int32_t>>& goes_in, ::std::vector<double>* goes_in_and_out, ::std::vector<bool>* goes_out, ::std::vector<int32_t>* _aidl_return) override; |
| 75 | ::android::binder::Status Piff(int32_t times) override; |
| 76 | ::android::binder::Status TakesABinder(const ::android::sp<::foo::IFooType>& f, ::android::sp<::foo::IFooType>* _aidl_return) override; |
| 77 | ::android::binder::Status NullableBinder(::android::sp<::foo::IFooType>* _aidl_return) override; |
| 78 | ::android::binder::Status StringListMethod(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* output, ::std::vector<::android::String16>* _aidl_return) override; |
| 79 | ::android::binder::Status BinderListMethod(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* output, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) override; |
| 80 | ::android::binder::Status TakesAFileDescriptor(const ::android::base::unique_fd& f, ::android::base::unique_fd* _aidl_return) override; |
| 81 | ::android::binder::Status TakesAFileDescriptorArray(const ::std::vector<::android::base::unique_fd>& f, ::std::vector<::android::base::unique_fd>* _aidl_return) override; |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 82 | }; // class BpComplexTypeInterface |
| 83 | |
| 84 | } // namespace os |
| 85 | |
| 86 | } // namespace android |
| 87 | |
Christopher Wiley | 11a9d79 | 2016-02-24 17:20:33 -0800 | [diff] [blame] | 88 | #endif // AIDL_GENERATED_ANDROID_OS_BP_COMPLEX_TYPE_INTERFACE_H_ |
| 89 | )"; |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 90 | |
| 91 | const char kExpectedComplexTypeClientSourceOutput[] = |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 92 | R"(#include <android/os/BpComplexTypeInterface.h> |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 93 | #include <binder/Parcel.h> |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 94 | #include <android-base/macros.h> |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 95 | |
| 96 | namespace android { |
| 97 | |
| 98 | namespace os { |
| 99 | |
Casey Dahlin | b8d9e88 | 2015-11-24 10:57:23 -0800 | [diff] [blame] | 100 | BpComplexTypeInterface::BpComplexTypeInterface(const ::android::sp<::android::IBinder>& _aidl_impl) |
| 101 | : BpInterface<IComplexTypeInterface>(_aidl_impl){ |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 102 | } |
| 103 | |
Casey Dahlin | 57dbe24 | 2015-12-04 11:44:02 -0800 | [diff] [blame] | 104 | ::android::binder::Status BpComplexTypeInterface::Send(const ::std::unique_ptr<::std::vector<int32_t>>& goes_in, ::std::vector<double>* goes_in_and_out, ::std::vector<bool>* goes_out, ::std::vector<int32_t>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 105 | ::android::Parcel _aidl_data; |
| 106 | ::android::Parcel _aidl_reply; |
| 107 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 108 | ::android::binder::Status _aidl_status; |
| 109 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 110 | if (((_aidl_ret_status) != (::android::OK))) { |
| 111 | goto _aidl_error; |
| 112 | } |
| 113 | _aidl_ret_status = _aidl_data.writeInt32Vector(goes_in); |
| 114 | if (((_aidl_ret_status) != (::android::OK))) { |
| 115 | goto _aidl_error; |
| 116 | } |
| 117 | _aidl_ret_status = _aidl_data.writeDoubleVector(*goes_in_and_out); |
| 118 | if (((_aidl_ret_status) != (::android::OK))) { |
| 119 | goto _aidl_error; |
| 120 | } |
| 121 | _aidl_ret_status = _aidl_data.writeVectorSize(*goes_out); |
| 122 | if (((_aidl_ret_status) != (::android::OK))) { |
| 123 | goto _aidl_error; |
| 124 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 125 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 0 /* Send */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 126 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 127 | return IComplexTypeInterface::getDefaultImpl()->Send(goes_in, goes_in_and_out, goes_out, _aidl_return); |
| 128 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 129 | if (((_aidl_ret_status) != (::android::OK))) { |
| 130 | goto _aidl_error; |
| 131 | } |
| 132 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 133 | if (((_aidl_ret_status) != (::android::OK))) { |
| 134 | goto _aidl_error; |
| 135 | } |
| 136 | if (!_aidl_status.isOk()) { |
| 137 | return _aidl_status; |
| 138 | } |
| 139 | _aidl_ret_status = _aidl_reply.readInt32Vector(_aidl_return); |
| 140 | if (((_aidl_ret_status) != (::android::OK))) { |
| 141 | goto _aidl_error; |
| 142 | } |
| 143 | _aidl_ret_status = _aidl_reply.readDoubleVector(goes_in_and_out); |
| 144 | if (((_aidl_ret_status) != (::android::OK))) { |
| 145 | goto _aidl_error; |
| 146 | } |
| 147 | _aidl_ret_status = _aidl_reply.readBoolVector(goes_out); |
| 148 | if (((_aidl_ret_status) != (::android::OK))) { |
| 149 | goto _aidl_error; |
| 150 | } |
| 151 | _aidl_error: |
| 152 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 153 | return _aidl_status; |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 154 | } |
| 155 | |
Casey Dahlin | b8d9e88 | 2015-11-24 10:57:23 -0800 | [diff] [blame] | 156 | ::android::binder::Status BpComplexTypeInterface::Piff(int32_t times) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 157 | ::android::Parcel _aidl_data; |
| 158 | ::android::Parcel _aidl_reply; |
| 159 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 160 | ::android::binder::Status _aidl_status; |
| 161 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 162 | if (((_aidl_ret_status) != (::android::OK))) { |
| 163 | goto _aidl_error; |
| 164 | } |
| 165 | _aidl_ret_status = _aidl_data.writeInt32(times); |
| 166 | if (((_aidl_ret_status) != (::android::OK))) { |
| 167 | goto _aidl_error; |
| 168 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 169 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 1 /* Piff */, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 170 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 171 | return IComplexTypeInterface::getDefaultImpl()->Piff(times); |
| 172 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 173 | if (((_aidl_ret_status) != (::android::OK))) { |
| 174 | goto _aidl_error; |
| 175 | } |
| 176 | _aidl_error: |
| 177 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 178 | return _aidl_status; |
Casey Dahlin | 0dd08af | 2015-10-20 18:45:50 -0700 | [diff] [blame] | 179 | } |
| 180 | |
Casey Dahlin | b8d9e88 | 2015-11-24 10:57:23 -0800 | [diff] [blame] | 181 | ::android::binder::Status BpComplexTypeInterface::TakesABinder(const ::android::sp<::foo::IFooType>& f, ::android::sp<::foo::IFooType>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 182 | ::android::Parcel _aidl_data; |
| 183 | ::android::Parcel _aidl_reply; |
| 184 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 185 | ::android::binder::Status _aidl_status; |
| 186 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 187 | if (((_aidl_ret_status) != (::android::OK))) { |
| 188 | goto _aidl_error; |
| 189 | } |
| 190 | _aidl_ret_status = _aidl_data.writeStrongBinder(::foo::IFooType::asBinder(f)); |
| 191 | if (((_aidl_ret_status) != (::android::OK))) { |
| 192 | goto _aidl_error; |
| 193 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 194 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 2 /* TakesABinder */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 195 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 196 | return IComplexTypeInterface::getDefaultImpl()->TakesABinder(f, _aidl_return); |
| 197 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 198 | if (((_aidl_ret_status) != (::android::OK))) { |
| 199 | goto _aidl_error; |
| 200 | } |
| 201 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 202 | if (((_aidl_ret_status) != (::android::OK))) { |
| 203 | goto _aidl_error; |
| 204 | } |
| 205 | if (!_aidl_status.isOk()) { |
| 206 | return _aidl_status; |
| 207 | } |
| 208 | _aidl_ret_status = _aidl_reply.readStrongBinder(_aidl_return); |
| 209 | if (((_aidl_ret_status) != (::android::OK))) { |
| 210 | goto _aidl_error; |
| 211 | } |
| 212 | _aidl_error: |
| 213 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 214 | return _aidl_status; |
Casey Dahlin | 389781f | 2015-10-22 13:13:21 -0700 | [diff] [blame] | 215 | } |
| 216 | |
Casey Dahlin | ef88bce | 2016-04-15 11:55:30 -0700 | [diff] [blame] | 217 | ::android::binder::Status BpComplexTypeInterface::NullableBinder(::android::sp<::foo::IFooType>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 218 | ::android::Parcel _aidl_data; |
| 219 | ::android::Parcel _aidl_reply; |
| 220 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 221 | ::android::binder::Status _aidl_status; |
| 222 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 223 | if (((_aidl_ret_status) != (::android::OK))) { |
| 224 | goto _aidl_error; |
| 225 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 226 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 3 /* NullableBinder */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 227 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 228 | return IComplexTypeInterface::getDefaultImpl()->NullableBinder(_aidl_return); |
| 229 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 230 | if (((_aidl_ret_status) != (::android::OK))) { |
| 231 | goto _aidl_error; |
| 232 | } |
| 233 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 234 | if (((_aidl_ret_status) != (::android::OK))) { |
| 235 | goto _aidl_error; |
| 236 | } |
| 237 | if (!_aidl_status.isOk()) { |
| 238 | return _aidl_status; |
| 239 | } |
| 240 | _aidl_ret_status = _aidl_reply.readNullableStrongBinder(_aidl_return); |
| 241 | if (((_aidl_ret_status) != (::android::OK))) { |
| 242 | goto _aidl_error; |
| 243 | } |
| 244 | _aidl_error: |
| 245 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 246 | return _aidl_status; |
Casey Dahlin | ef88bce | 2016-04-15 11:55:30 -0700 | [diff] [blame] | 247 | } |
| 248 | |
Casey Dahlin | b8d9e88 | 2015-11-24 10:57:23 -0800 | [diff] [blame] | 249 | ::android::binder::Status BpComplexTypeInterface::StringListMethod(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* output, ::std::vector<::android::String16>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 250 | ::android::Parcel _aidl_data; |
| 251 | ::android::Parcel _aidl_reply; |
| 252 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 253 | ::android::binder::Status _aidl_status; |
| 254 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 255 | if (((_aidl_ret_status) != (::android::OK))) { |
| 256 | goto _aidl_error; |
| 257 | } |
| 258 | _aidl_ret_status = _aidl_data.writeString16Vector(input); |
| 259 | if (((_aidl_ret_status) != (::android::OK))) { |
| 260 | goto _aidl_error; |
| 261 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 262 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 4 /* StringListMethod */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 263 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 264 | return IComplexTypeInterface::getDefaultImpl()->StringListMethod(input, output, _aidl_return); |
| 265 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 266 | if (((_aidl_ret_status) != (::android::OK))) { |
| 267 | goto _aidl_error; |
| 268 | } |
| 269 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 270 | if (((_aidl_ret_status) != (::android::OK))) { |
| 271 | goto _aidl_error; |
| 272 | } |
| 273 | if (!_aidl_status.isOk()) { |
| 274 | return _aidl_status; |
| 275 | } |
| 276 | _aidl_ret_status = _aidl_reply.readString16Vector(_aidl_return); |
| 277 | if (((_aidl_ret_status) != (::android::OK))) { |
| 278 | goto _aidl_error; |
| 279 | } |
| 280 | _aidl_ret_status = _aidl_reply.readString16Vector(output); |
| 281 | if (((_aidl_ret_status) != (::android::OK))) { |
| 282 | goto _aidl_error; |
| 283 | } |
| 284 | _aidl_error: |
| 285 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 286 | return _aidl_status; |
Christopher Wiley | 56c9bf3 | 2015-10-30 10:41:12 -0700 | [diff] [blame] | 287 | } |
| 288 | |
Casey Dahlin | b8d9e88 | 2015-11-24 10:57:23 -0800 | [diff] [blame] | 289 | ::android::binder::Status BpComplexTypeInterface::BinderListMethod(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* output, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 290 | ::android::Parcel _aidl_data; |
| 291 | ::android::Parcel _aidl_reply; |
| 292 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 293 | ::android::binder::Status _aidl_status; |
| 294 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 295 | if (((_aidl_ret_status) != (::android::OK))) { |
| 296 | goto _aidl_error; |
| 297 | } |
| 298 | _aidl_ret_status = _aidl_data.writeStrongBinderVector(input); |
| 299 | if (((_aidl_ret_status) != (::android::OK))) { |
| 300 | goto _aidl_error; |
| 301 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 302 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 5 /* BinderListMethod */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 303 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 304 | return IComplexTypeInterface::getDefaultImpl()->BinderListMethod(input, output, _aidl_return); |
| 305 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 306 | if (((_aidl_ret_status) != (::android::OK))) { |
| 307 | goto _aidl_error; |
| 308 | } |
| 309 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 310 | if (((_aidl_ret_status) != (::android::OK))) { |
| 311 | goto _aidl_error; |
| 312 | } |
| 313 | if (!_aidl_status.isOk()) { |
| 314 | return _aidl_status; |
| 315 | } |
| 316 | _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return); |
| 317 | if (((_aidl_ret_status) != (::android::OK))) { |
| 318 | goto _aidl_error; |
| 319 | } |
| 320 | _aidl_ret_status = _aidl_reply.readStrongBinderVector(output); |
| 321 | if (((_aidl_ret_status) != (::android::OK))) { |
| 322 | goto _aidl_error; |
| 323 | } |
| 324 | _aidl_error: |
| 325 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 326 | return _aidl_status; |
Casey Dahlin | 7ecd69f | 2015-11-03 13:52:38 -0800 | [diff] [blame] | 327 | } |
| 328 | |
Christopher Wiley | 7cb9c25 | 2016-04-11 11:07:33 -0700 | [diff] [blame] | 329 | ::android::binder::Status BpComplexTypeInterface::TakesAFileDescriptor(const ::android::base::unique_fd& f, ::android::base::unique_fd* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 330 | ::android::Parcel _aidl_data; |
| 331 | ::android::Parcel _aidl_reply; |
| 332 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 333 | ::android::binder::Status _aidl_status; |
| 334 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 335 | if (((_aidl_ret_status) != (::android::OK))) { |
| 336 | goto _aidl_error; |
| 337 | } |
| 338 | _aidl_ret_status = _aidl_data.writeUniqueFileDescriptor(f); |
| 339 | if (((_aidl_ret_status) != (::android::OK))) { |
| 340 | goto _aidl_error; |
| 341 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 342 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 6 /* TakesAFileDescriptor */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 343 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 344 | return IComplexTypeInterface::getDefaultImpl()->TakesAFileDescriptor(f, _aidl_return); |
| 345 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 346 | if (((_aidl_ret_status) != (::android::OK))) { |
| 347 | goto _aidl_error; |
| 348 | } |
| 349 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 350 | if (((_aidl_ret_status) != (::android::OK))) { |
| 351 | goto _aidl_error; |
| 352 | } |
| 353 | if (!_aidl_status.isOk()) { |
| 354 | return _aidl_status; |
| 355 | } |
| 356 | _aidl_ret_status = _aidl_reply.readUniqueFileDescriptor(_aidl_return); |
| 357 | if (((_aidl_ret_status) != (::android::OK))) { |
| 358 | goto _aidl_error; |
| 359 | } |
| 360 | _aidl_error: |
| 361 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 362 | return _aidl_status; |
Casey Dahlin | a4ba4b6 | 2015-11-02 15:43:30 -0800 | [diff] [blame] | 363 | } |
| 364 | |
Christopher Wiley | 7cb9c25 | 2016-04-11 11:07:33 -0700 | [diff] [blame] | 365 | ::android::binder::Status BpComplexTypeInterface::TakesAFileDescriptorArray(const ::std::vector<::android::base::unique_fd>& f, ::std::vector<::android::base::unique_fd>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 366 | ::android::Parcel _aidl_data; |
| 367 | ::android::Parcel _aidl_reply; |
| 368 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 369 | ::android::binder::Status _aidl_status; |
| 370 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 371 | if (((_aidl_ret_status) != (::android::OK))) { |
| 372 | goto _aidl_error; |
| 373 | } |
| 374 | _aidl_ret_status = _aidl_data.writeUniqueFileDescriptorVector(f); |
| 375 | if (((_aidl_ret_status) != (::android::OK))) { |
| 376 | goto _aidl_error; |
| 377 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 378 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 7 /* TakesAFileDescriptorArray */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 379 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 380 | return IComplexTypeInterface::getDefaultImpl()->TakesAFileDescriptorArray(f, _aidl_return); |
| 381 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 382 | if (((_aidl_ret_status) != (::android::OK))) { |
| 383 | goto _aidl_error; |
| 384 | } |
| 385 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 386 | if (((_aidl_ret_status) != (::android::OK))) { |
| 387 | goto _aidl_error; |
| 388 | } |
| 389 | if (!_aidl_status.isOk()) { |
| 390 | return _aidl_status; |
| 391 | } |
| 392 | _aidl_ret_status = _aidl_reply.readUniqueFileDescriptorVector(_aidl_return); |
| 393 | if (((_aidl_ret_status) != (::android::OK))) { |
| 394 | goto _aidl_error; |
| 395 | } |
| 396 | _aidl_error: |
| 397 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 398 | return _aidl_status; |
Casey Dahlin | a4ba4b6 | 2015-11-02 15:43:30 -0800 | [diff] [blame] | 399 | } |
| 400 | |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 401 | } // namespace os |
| 402 | |
| 403 | } // namespace android |
| 404 | )"; |
| 405 | |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 406 | const char kExpectedComplexTypeClientWithTraceSourceOutput[] = |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 407 | R"(#include <android/os/BpComplexTypeInterface.h> |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 408 | #include <binder/Parcel.h> |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 409 | #include <android-base/macros.h> |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 410 | |
| 411 | namespace android { |
| 412 | |
| 413 | namespace os { |
| 414 | |
| 415 | BpComplexTypeInterface::BpComplexTypeInterface(const ::android::sp<::android::IBinder>& _aidl_impl) |
| 416 | : BpInterface<IComplexTypeInterface>(_aidl_impl){ |
| 417 | } |
| 418 | |
| 419 | ::android::binder::Status BpComplexTypeInterface::Send(const ::std::unique_ptr<::std::vector<int32_t>>& goes_in, ::std::vector<double>* goes_in_and_out, ::std::vector<bool>* goes_out, ::std::vector<int32_t>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 420 | ::android::Parcel _aidl_data; |
| 421 | ::android::Parcel _aidl_reply; |
| 422 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 423 | ::android::binder::Status _aidl_status; |
| 424 | ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "IComplexTypeInterface::Send::cppClient"); |
| 425 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 426 | if (((_aidl_ret_status) != (::android::OK))) { |
| 427 | goto _aidl_error; |
| 428 | } |
| 429 | _aidl_ret_status = _aidl_data.writeInt32Vector(goes_in); |
| 430 | if (((_aidl_ret_status) != (::android::OK))) { |
| 431 | goto _aidl_error; |
| 432 | } |
| 433 | _aidl_ret_status = _aidl_data.writeDoubleVector(*goes_in_and_out); |
| 434 | if (((_aidl_ret_status) != (::android::OK))) { |
| 435 | goto _aidl_error; |
| 436 | } |
| 437 | _aidl_ret_status = _aidl_data.writeVectorSize(*goes_out); |
| 438 | if (((_aidl_ret_status) != (::android::OK))) { |
| 439 | goto _aidl_error; |
| 440 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 441 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 0 /* Send */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 442 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 443 | return IComplexTypeInterface::getDefaultImpl()->Send(goes_in, goes_in_and_out, goes_out, _aidl_return); |
| 444 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 445 | if (((_aidl_ret_status) != (::android::OK))) { |
| 446 | goto _aidl_error; |
| 447 | } |
| 448 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 449 | if (((_aidl_ret_status) != (::android::OK))) { |
| 450 | goto _aidl_error; |
| 451 | } |
| 452 | if (!_aidl_status.isOk()) { |
| 453 | return _aidl_status; |
| 454 | } |
| 455 | _aidl_ret_status = _aidl_reply.readInt32Vector(_aidl_return); |
| 456 | if (((_aidl_ret_status) != (::android::OK))) { |
| 457 | goto _aidl_error; |
| 458 | } |
| 459 | _aidl_ret_status = _aidl_reply.readDoubleVector(goes_in_and_out); |
| 460 | if (((_aidl_ret_status) != (::android::OK))) { |
| 461 | goto _aidl_error; |
| 462 | } |
| 463 | _aidl_ret_status = _aidl_reply.readBoolVector(goes_out); |
| 464 | if (((_aidl_ret_status) != (::android::OK))) { |
| 465 | goto _aidl_error; |
| 466 | } |
| 467 | _aidl_error: |
| 468 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 469 | return _aidl_status; |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 470 | } |
| 471 | |
| 472 | ::android::binder::Status BpComplexTypeInterface::Piff(int32_t times) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 473 | ::android::Parcel _aidl_data; |
| 474 | ::android::Parcel _aidl_reply; |
| 475 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 476 | ::android::binder::Status _aidl_status; |
| 477 | ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "IComplexTypeInterface::Piff::cppClient"); |
| 478 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 479 | if (((_aidl_ret_status) != (::android::OK))) { |
| 480 | goto _aidl_error; |
| 481 | } |
| 482 | _aidl_ret_status = _aidl_data.writeInt32(times); |
| 483 | if (((_aidl_ret_status) != (::android::OK))) { |
| 484 | goto _aidl_error; |
| 485 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 486 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 1 /* Piff */, _aidl_data, &_aidl_reply, ::android::IBinder::FLAG_ONEWAY); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 487 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 488 | return IComplexTypeInterface::getDefaultImpl()->Piff(times); |
| 489 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 490 | if (((_aidl_ret_status) != (::android::OK))) { |
| 491 | goto _aidl_error; |
| 492 | } |
| 493 | _aidl_error: |
| 494 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 495 | return _aidl_status; |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 496 | } |
| 497 | |
| 498 | ::android::binder::Status BpComplexTypeInterface::TakesABinder(const ::android::sp<::foo::IFooType>& f, ::android::sp<::foo::IFooType>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 499 | ::android::Parcel _aidl_data; |
| 500 | ::android::Parcel _aidl_reply; |
| 501 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 502 | ::android::binder::Status _aidl_status; |
| 503 | ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "IComplexTypeInterface::TakesABinder::cppClient"); |
| 504 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 505 | if (((_aidl_ret_status) != (::android::OK))) { |
| 506 | goto _aidl_error; |
| 507 | } |
| 508 | _aidl_ret_status = _aidl_data.writeStrongBinder(::foo::IFooType::asBinder(f)); |
| 509 | if (((_aidl_ret_status) != (::android::OK))) { |
| 510 | goto _aidl_error; |
| 511 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 512 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 2 /* TakesABinder */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 513 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 514 | return IComplexTypeInterface::getDefaultImpl()->TakesABinder(f, _aidl_return); |
| 515 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 516 | if (((_aidl_ret_status) != (::android::OK))) { |
| 517 | goto _aidl_error; |
| 518 | } |
| 519 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 520 | if (((_aidl_ret_status) != (::android::OK))) { |
| 521 | goto _aidl_error; |
| 522 | } |
| 523 | if (!_aidl_status.isOk()) { |
| 524 | return _aidl_status; |
| 525 | } |
| 526 | _aidl_ret_status = _aidl_reply.readStrongBinder(_aidl_return); |
| 527 | if (((_aidl_ret_status) != (::android::OK))) { |
| 528 | goto _aidl_error; |
| 529 | } |
| 530 | _aidl_error: |
| 531 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 532 | return _aidl_status; |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 533 | } |
| 534 | |
| 535 | ::android::binder::Status BpComplexTypeInterface::NullableBinder(::android::sp<::foo::IFooType>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 536 | ::android::Parcel _aidl_data; |
| 537 | ::android::Parcel _aidl_reply; |
| 538 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 539 | ::android::binder::Status _aidl_status; |
| 540 | ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "IComplexTypeInterface::NullableBinder::cppClient"); |
| 541 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 542 | if (((_aidl_ret_status) != (::android::OK))) { |
| 543 | goto _aidl_error; |
| 544 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 545 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 3 /* NullableBinder */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 546 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 547 | return IComplexTypeInterface::getDefaultImpl()->NullableBinder(_aidl_return); |
| 548 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 549 | if (((_aidl_ret_status) != (::android::OK))) { |
| 550 | goto _aidl_error; |
| 551 | } |
| 552 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 553 | if (((_aidl_ret_status) != (::android::OK))) { |
| 554 | goto _aidl_error; |
| 555 | } |
| 556 | if (!_aidl_status.isOk()) { |
| 557 | return _aidl_status; |
| 558 | } |
| 559 | _aidl_ret_status = _aidl_reply.readNullableStrongBinder(_aidl_return); |
| 560 | if (((_aidl_ret_status) != (::android::OK))) { |
| 561 | goto _aidl_error; |
| 562 | } |
| 563 | _aidl_error: |
| 564 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 565 | return _aidl_status; |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 566 | } |
| 567 | |
| 568 | ::android::binder::Status BpComplexTypeInterface::StringListMethod(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* output, ::std::vector<::android::String16>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 569 | ::android::Parcel _aidl_data; |
| 570 | ::android::Parcel _aidl_reply; |
| 571 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 572 | ::android::binder::Status _aidl_status; |
| 573 | ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "IComplexTypeInterface::StringListMethod::cppClient"); |
| 574 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 575 | if (((_aidl_ret_status) != (::android::OK))) { |
| 576 | goto _aidl_error; |
| 577 | } |
| 578 | _aidl_ret_status = _aidl_data.writeString16Vector(input); |
| 579 | if (((_aidl_ret_status) != (::android::OK))) { |
| 580 | goto _aidl_error; |
| 581 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 582 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 4 /* StringListMethod */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 583 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 584 | return IComplexTypeInterface::getDefaultImpl()->StringListMethod(input, output, _aidl_return); |
| 585 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 586 | if (((_aidl_ret_status) != (::android::OK))) { |
| 587 | goto _aidl_error; |
| 588 | } |
| 589 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 590 | if (((_aidl_ret_status) != (::android::OK))) { |
| 591 | goto _aidl_error; |
| 592 | } |
| 593 | if (!_aidl_status.isOk()) { |
| 594 | return _aidl_status; |
| 595 | } |
| 596 | _aidl_ret_status = _aidl_reply.readString16Vector(_aidl_return); |
| 597 | if (((_aidl_ret_status) != (::android::OK))) { |
| 598 | goto _aidl_error; |
| 599 | } |
| 600 | _aidl_ret_status = _aidl_reply.readString16Vector(output); |
| 601 | if (((_aidl_ret_status) != (::android::OK))) { |
| 602 | goto _aidl_error; |
| 603 | } |
| 604 | _aidl_error: |
| 605 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 606 | return _aidl_status; |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 607 | } |
| 608 | |
| 609 | ::android::binder::Status BpComplexTypeInterface::BinderListMethod(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* output, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 610 | ::android::Parcel _aidl_data; |
| 611 | ::android::Parcel _aidl_reply; |
| 612 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 613 | ::android::binder::Status _aidl_status; |
| 614 | ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "IComplexTypeInterface::BinderListMethod::cppClient"); |
| 615 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 616 | if (((_aidl_ret_status) != (::android::OK))) { |
| 617 | goto _aidl_error; |
| 618 | } |
| 619 | _aidl_ret_status = _aidl_data.writeStrongBinderVector(input); |
| 620 | if (((_aidl_ret_status) != (::android::OK))) { |
| 621 | goto _aidl_error; |
| 622 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 623 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 5 /* BinderListMethod */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 624 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 625 | return IComplexTypeInterface::getDefaultImpl()->BinderListMethod(input, output, _aidl_return); |
| 626 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 627 | if (((_aidl_ret_status) != (::android::OK))) { |
| 628 | goto _aidl_error; |
| 629 | } |
| 630 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 631 | if (((_aidl_ret_status) != (::android::OK))) { |
| 632 | goto _aidl_error; |
| 633 | } |
| 634 | if (!_aidl_status.isOk()) { |
| 635 | return _aidl_status; |
| 636 | } |
| 637 | _aidl_ret_status = _aidl_reply.readStrongBinderVector(_aidl_return); |
| 638 | if (((_aidl_ret_status) != (::android::OK))) { |
| 639 | goto _aidl_error; |
| 640 | } |
| 641 | _aidl_ret_status = _aidl_reply.readStrongBinderVector(output); |
| 642 | if (((_aidl_ret_status) != (::android::OK))) { |
| 643 | goto _aidl_error; |
| 644 | } |
| 645 | _aidl_error: |
| 646 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 647 | return _aidl_status; |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 648 | } |
| 649 | |
| 650 | ::android::binder::Status BpComplexTypeInterface::TakesAFileDescriptor(const ::android::base::unique_fd& f, ::android::base::unique_fd* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 651 | ::android::Parcel _aidl_data; |
| 652 | ::android::Parcel _aidl_reply; |
| 653 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 654 | ::android::binder::Status _aidl_status; |
| 655 | ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "IComplexTypeInterface::TakesAFileDescriptor::cppClient"); |
| 656 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 657 | if (((_aidl_ret_status) != (::android::OK))) { |
| 658 | goto _aidl_error; |
| 659 | } |
| 660 | _aidl_ret_status = _aidl_data.writeUniqueFileDescriptor(f); |
| 661 | if (((_aidl_ret_status) != (::android::OK))) { |
| 662 | goto _aidl_error; |
| 663 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 664 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 6 /* TakesAFileDescriptor */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 665 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 666 | return IComplexTypeInterface::getDefaultImpl()->TakesAFileDescriptor(f, _aidl_return); |
| 667 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 668 | if (((_aidl_ret_status) != (::android::OK))) { |
| 669 | goto _aidl_error; |
| 670 | } |
| 671 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 672 | if (((_aidl_ret_status) != (::android::OK))) { |
| 673 | goto _aidl_error; |
| 674 | } |
| 675 | if (!_aidl_status.isOk()) { |
| 676 | return _aidl_status; |
| 677 | } |
| 678 | _aidl_ret_status = _aidl_reply.readUniqueFileDescriptor(_aidl_return); |
| 679 | if (((_aidl_ret_status) != (::android::OK))) { |
| 680 | goto _aidl_error; |
| 681 | } |
| 682 | _aidl_error: |
| 683 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 684 | return _aidl_status; |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 685 | } |
| 686 | |
| 687 | ::android::binder::Status BpComplexTypeInterface::TakesAFileDescriptorArray(const ::std::vector<::android::base::unique_fd>& f, ::std::vector<::android::base::unique_fd>* _aidl_return) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 688 | ::android::Parcel _aidl_data; |
| 689 | ::android::Parcel _aidl_reply; |
| 690 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 691 | ::android::binder::Status _aidl_status; |
| 692 | ScopedTrace _aidl_trace(ATRACE_TAG_AIDL, "IComplexTypeInterface::TakesAFileDescriptorArray::cppClient"); |
| 693 | _aidl_ret_status = _aidl_data.writeInterfaceToken(getInterfaceDescriptor()); |
| 694 | if (((_aidl_ret_status) != (::android::OK))) { |
| 695 | goto _aidl_error; |
| 696 | } |
| 697 | _aidl_ret_status = _aidl_data.writeUniqueFileDescriptorVector(f); |
| 698 | if (((_aidl_ret_status) != (::android::OK))) { |
| 699 | goto _aidl_error; |
| 700 | } |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 701 | _aidl_ret_status = remote()->transact(::android::IBinder::FIRST_CALL_TRANSACTION + 7 /* TakesAFileDescriptorArray */, _aidl_data, &_aidl_reply); |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 702 | if (UNLIKELY(_aidl_ret_status == ::android::UNKNOWN_TRANSACTION && IComplexTypeInterface::getDefaultImpl())) { |
| 703 | return IComplexTypeInterface::getDefaultImpl()->TakesAFileDescriptorArray(f, _aidl_return); |
| 704 | } |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 705 | if (((_aidl_ret_status) != (::android::OK))) { |
| 706 | goto _aidl_error; |
| 707 | } |
| 708 | _aidl_ret_status = _aidl_status.readFromParcel(_aidl_reply); |
| 709 | if (((_aidl_ret_status) != (::android::OK))) { |
| 710 | goto _aidl_error; |
| 711 | } |
| 712 | if (!_aidl_status.isOk()) { |
| 713 | return _aidl_status; |
| 714 | } |
| 715 | _aidl_ret_status = _aidl_reply.readUniqueFileDescriptorVector(_aidl_return); |
| 716 | if (((_aidl_ret_status) != (::android::OK))) { |
| 717 | goto _aidl_error; |
| 718 | } |
| 719 | _aidl_error: |
| 720 | _aidl_status.setFromStatusT(_aidl_ret_status); |
| 721 | return _aidl_status; |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 722 | } |
| 723 | |
| 724 | } // namespace os |
| 725 | |
| 726 | } // namespace android |
| 727 | )"; |
| 728 | |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 729 | const char kExpectedComplexTypeServerHeaderOutput[] = |
| 730 | R"(#ifndef AIDL_GENERATED_ANDROID_OS_BN_COMPLEX_TYPE_INTERFACE_H_ |
| 731 | #define AIDL_GENERATED_ANDROID_OS_BN_COMPLEX_TYPE_INTERFACE_H_ |
| 732 | |
| 733 | #include <binder/IInterface.h> |
| 734 | #include <android/os/IComplexTypeInterface.h> |
| 735 | |
| 736 | namespace android { |
| 737 | |
| 738 | namespace os { |
| 739 | |
Casey Dahlin | b8d9e88 | 2015-11-24 10:57:23 -0800 | [diff] [blame] | 740 | class BnComplexTypeInterface : public ::android::BnInterface<IComplexTypeInterface> { |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 741 | public: |
Jiyong Park | 8533bd0 | 2018-10-29 21:31:18 +0900 | [diff] [blame] | 742 | ::android::status_t onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) override; |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 743 | }; // class BnComplexTypeInterface |
| 744 | |
| 745 | } // namespace os |
| 746 | |
| 747 | } // namespace android |
| 748 | |
Christopher Wiley | 11a9d79 | 2016-02-24 17:20:33 -0800 | [diff] [blame] | 749 | #endif // AIDL_GENERATED_ANDROID_OS_BN_COMPLEX_TYPE_INTERFACE_H_ |
| 750 | )"; |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 751 | |
| 752 | const char kExpectedComplexTypeServerSourceOutput[] = |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 753 | R"(#include <android/os/BnComplexTypeInterface.h> |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 754 | #include <binder/Parcel.h> |
| 755 | |
| 756 | namespace android { |
| 757 | |
| 758 | namespace os { |
| 759 | |
Casey Dahlin | b8d9e88 | 2015-11-24 10:57:23 -0800 | [diff] [blame] | 760 | ::android::status_t BnComplexTypeInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 761 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 762 | switch (_aidl_code) { |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 763 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 0 /* Send */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 764 | { |
| 765 | ::std::unique_ptr<::std::vector<int32_t>> in_goes_in; |
| 766 | ::std::vector<double> in_goes_in_and_out; |
| 767 | ::std::vector<bool> out_goes_out; |
| 768 | ::std::vector<int32_t> _aidl_return; |
| 769 | if (!(_aidl_data.checkInterface(this))) { |
| 770 | _aidl_ret_status = ::android::BAD_TYPE; |
| 771 | break; |
| 772 | } |
| 773 | _aidl_ret_status = _aidl_data.readInt32Vector(&in_goes_in); |
| 774 | if (((_aidl_ret_status) != (::android::OK))) { |
| 775 | break; |
| 776 | } |
| 777 | _aidl_ret_status = _aidl_data.readDoubleVector(&in_goes_in_and_out); |
| 778 | if (((_aidl_ret_status) != (::android::OK))) { |
| 779 | break; |
| 780 | } |
| 781 | _aidl_ret_status = _aidl_data.resizeOutVector(&out_goes_out); |
| 782 | if (((_aidl_ret_status) != (::android::OK))) { |
| 783 | break; |
| 784 | } |
| 785 | ::android::binder::Status _aidl_status(Send(in_goes_in, &in_goes_in_and_out, &out_goes_out, &_aidl_return)); |
| 786 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 787 | if (((_aidl_ret_status) != (::android::OK))) { |
| 788 | break; |
| 789 | } |
| 790 | if (!_aidl_status.isOk()) { |
| 791 | break; |
| 792 | } |
| 793 | _aidl_ret_status = _aidl_reply->writeInt32Vector(_aidl_return); |
| 794 | if (((_aidl_ret_status) != (::android::OK))) { |
| 795 | break; |
| 796 | } |
| 797 | _aidl_ret_status = _aidl_reply->writeDoubleVector(in_goes_in_and_out); |
| 798 | if (((_aidl_ret_status) != (::android::OK))) { |
| 799 | break; |
| 800 | } |
| 801 | _aidl_ret_status = _aidl_reply->writeBoolVector(out_goes_out); |
| 802 | if (((_aidl_ret_status) != (::android::OK))) { |
| 803 | break; |
| 804 | } |
| 805 | } |
| 806 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 807 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 1 /* Piff */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 808 | { |
| 809 | int32_t in_times; |
| 810 | if (!(_aidl_data.checkInterface(this))) { |
| 811 | _aidl_ret_status = ::android::BAD_TYPE; |
| 812 | break; |
| 813 | } |
| 814 | _aidl_ret_status = _aidl_data.readInt32(&in_times); |
| 815 | if (((_aidl_ret_status) != (::android::OK))) { |
| 816 | break; |
| 817 | } |
| 818 | ::android::binder::Status _aidl_status(Piff(in_times)); |
| 819 | } |
| 820 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 821 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 2 /* TakesABinder */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 822 | { |
| 823 | ::android::sp<::foo::IFooType> in_f; |
| 824 | ::android::sp<::foo::IFooType> _aidl_return; |
| 825 | if (!(_aidl_data.checkInterface(this))) { |
| 826 | _aidl_ret_status = ::android::BAD_TYPE; |
| 827 | break; |
| 828 | } |
| 829 | _aidl_ret_status = _aidl_data.readStrongBinder(&in_f); |
| 830 | if (((_aidl_ret_status) != (::android::OK))) { |
| 831 | break; |
| 832 | } |
| 833 | ::android::binder::Status _aidl_status(TakesABinder(in_f, &_aidl_return)); |
| 834 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 835 | if (((_aidl_ret_status) != (::android::OK))) { |
| 836 | break; |
| 837 | } |
| 838 | if (!_aidl_status.isOk()) { |
| 839 | break; |
| 840 | } |
| 841 | _aidl_ret_status = _aidl_reply->writeStrongBinder(::foo::IFooType::asBinder(_aidl_return)); |
| 842 | if (((_aidl_ret_status) != (::android::OK))) { |
| 843 | break; |
| 844 | } |
| 845 | } |
| 846 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 847 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 3 /* NullableBinder */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 848 | { |
| 849 | ::android::sp<::foo::IFooType> _aidl_return; |
| 850 | if (!(_aidl_data.checkInterface(this))) { |
| 851 | _aidl_ret_status = ::android::BAD_TYPE; |
| 852 | break; |
| 853 | } |
| 854 | ::android::binder::Status _aidl_status(NullableBinder(&_aidl_return)); |
| 855 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 856 | if (((_aidl_ret_status) != (::android::OK))) { |
| 857 | break; |
| 858 | } |
| 859 | if (!_aidl_status.isOk()) { |
| 860 | break; |
| 861 | } |
| 862 | _aidl_ret_status = _aidl_reply->writeStrongBinder(::foo::IFooType::asBinder(_aidl_return)); |
| 863 | if (((_aidl_ret_status) != (::android::OK))) { |
| 864 | break; |
| 865 | } |
| 866 | } |
| 867 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 868 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 4 /* StringListMethod */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 869 | { |
| 870 | ::std::vector<::android::String16> in_input; |
| 871 | ::std::vector<::android::String16> out_output; |
| 872 | ::std::vector<::android::String16> _aidl_return; |
| 873 | if (!(_aidl_data.checkInterface(this))) { |
| 874 | _aidl_ret_status = ::android::BAD_TYPE; |
| 875 | break; |
| 876 | } |
| 877 | _aidl_ret_status = _aidl_data.readString16Vector(&in_input); |
| 878 | if (((_aidl_ret_status) != (::android::OK))) { |
| 879 | break; |
| 880 | } |
| 881 | ::android::binder::Status _aidl_status(StringListMethod(in_input, &out_output, &_aidl_return)); |
| 882 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 883 | if (((_aidl_ret_status) != (::android::OK))) { |
| 884 | break; |
| 885 | } |
| 886 | if (!_aidl_status.isOk()) { |
| 887 | break; |
| 888 | } |
| 889 | _aidl_ret_status = _aidl_reply->writeString16Vector(_aidl_return); |
| 890 | if (((_aidl_ret_status) != (::android::OK))) { |
| 891 | break; |
| 892 | } |
| 893 | _aidl_ret_status = _aidl_reply->writeString16Vector(out_output); |
| 894 | if (((_aidl_ret_status) != (::android::OK))) { |
| 895 | break; |
| 896 | } |
| 897 | } |
| 898 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 899 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 5 /* BinderListMethod */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 900 | { |
| 901 | ::std::vector<::android::sp<::android::IBinder>> in_input; |
| 902 | ::std::vector<::android::sp<::android::IBinder>> out_output; |
| 903 | ::std::vector<::android::sp<::android::IBinder>> _aidl_return; |
| 904 | if (!(_aidl_data.checkInterface(this))) { |
| 905 | _aidl_ret_status = ::android::BAD_TYPE; |
| 906 | break; |
| 907 | } |
| 908 | _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input); |
| 909 | if (((_aidl_ret_status) != (::android::OK))) { |
| 910 | break; |
| 911 | } |
| 912 | ::android::binder::Status _aidl_status(BinderListMethod(in_input, &out_output, &_aidl_return)); |
| 913 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 914 | if (((_aidl_ret_status) != (::android::OK))) { |
| 915 | break; |
| 916 | } |
| 917 | if (!_aidl_status.isOk()) { |
| 918 | break; |
| 919 | } |
| 920 | _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return); |
| 921 | if (((_aidl_ret_status) != (::android::OK))) { |
| 922 | break; |
| 923 | } |
| 924 | _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_output); |
| 925 | if (((_aidl_ret_status) != (::android::OK))) { |
| 926 | break; |
| 927 | } |
| 928 | } |
| 929 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 930 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 6 /* TakesAFileDescriptor */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 931 | { |
| 932 | ::android::base::unique_fd in_f; |
| 933 | ::android::base::unique_fd _aidl_return; |
| 934 | if (!(_aidl_data.checkInterface(this))) { |
| 935 | _aidl_ret_status = ::android::BAD_TYPE; |
| 936 | break; |
| 937 | } |
| 938 | _aidl_ret_status = _aidl_data.readUniqueFileDescriptor(&in_f); |
| 939 | if (((_aidl_ret_status) != (::android::OK))) { |
| 940 | break; |
| 941 | } |
| 942 | ::android::binder::Status _aidl_status(TakesAFileDescriptor(in_f, &_aidl_return)); |
| 943 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 944 | if (((_aidl_ret_status) != (::android::OK))) { |
| 945 | break; |
| 946 | } |
| 947 | if (!_aidl_status.isOk()) { |
| 948 | break; |
| 949 | } |
| 950 | _aidl_ret_status = _aidl_reply->writeUniqueFileDescriptor(_aidl_return); |
| 951 | if (((_aidl_ret_status) != (::android::OK))) { |
| 952 | break; |
| 953 | } |
| 954 | } |
| 955 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 956 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 7 /* TakesAFileDescriptorArray */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 957 | { |
| 958 | ::std::vector<::android::base::unique_fd> in_f; |
| 959 | ::std::vector<::android::base::unique_fd> _aidl_return; |
| 960 | if (!(_aidl_data.checkInterface(this))) { |
| 961 | _aidl_ret_status = ::android::BAD_TYPE; |
| 962 | break; |
| 963 | } |
| 964 | _aidl_ret_status = _aidl_data.readUniqueFileDescriptorVector(&in_f); |
| 965 | if (((_aidl_ret_status) != (::android::OK))) { |
| 966 | break; |
| 967 | } |
| 968 | ::android::binder::Status _aidl_status(TakesAFileDescriptorArray(in_f, &_aidl_return)); |
| 969 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 970 | if (((_aidl_ret_status) != (::android::OK))) { |
| 971 | break; |
| 972 | } |
| 973 | if (!_aidl_status.isOk()) { |
| 974 | break; |
| 975 | } |
| 976 | _aidl_ret_status = _aidl_reply->writeUniqueFileDescriptorVector(_aidl_return); |
| 977 | if (((_aidl_ret_status) != (::android::OK))) { |
| 978 | break; |
| 979 | } |
| 980 | } |
| 981 | break; |
| 982 | default: |
| 983 | { |
| 984 | _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags); |
| 985 | } |
| 986 | break; |
| 987 | } |
| 988 | if (_aidl_ret_status == ::android::UNEXPECTED_NULL) { |
| 989 | _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeToParcel(_aidl_reply); |
| 990 | } |
| 991 | return _aidl_ret_status; |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 992 | } |
| 993 | |
| 994 | } // namespace os |
| 995 | |
| 996 | } // namespace android |
| 997 | )"; |
| 998 | |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 999 | const char kExpectedComplexTypeServerWithTraceSourceOutput[] = |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 1000 | R"(#include <android/os/BnComplexTypeInterface.h> |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 1001 | #include <binder/Parcel.h> |
| 1002 | |
| 1003 | namespace android { |
| 1004 | |
| 1005 | namespace os { |
| 1006 | |
| 1007 | ::android::status_t BnComplexTypeInterface::onTransact(uint32_t _aidl_code, const ::android::Parcel& _aidl_data, ::android::Parcel* _aidl_reply, uint32_t _aidl_flags) { |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 1008 | ::android::status_t _aidl_ret_status = ::android::OK; |
| 1009 | switch (_aidl_code) { |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 1010 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 0 /* Send */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 1011 | { |
| 1012 | ::std::unique_ptr<::std::vector<int32_t>> in_goes_in; |
| 1013 | ::std::vector<double> in_goes_in_and_out; |
| 1014 | ::std::vector<bool> out_goes_out; |
| 1015 | ::std::vector<int32_t> _aidl_return; |
| 1016 | if (!(_aidl_data.checkInterface(this))) { |
| 1017 | _aidl_ret_status = ::android::BAD_TYPE; |
| 1018 | break; |
| 1019 | } |
| 1020 | _aidl_ret_status = _aidl_data.readInt32Vector(&in_goes_in); |
| 1021 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1022 | break; |
| 1023 | } |
| 1024 | _aidl_ret_status = _aidl_data.readDoubleVector(&in_goes_in_and_out); |
| 1025 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1026 | break; |
| 1027 | } |
| 1028 | _aidl_ret_status = _aidl_data.resizeOutVector(&out_goes_out); |
| 1029 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1030 | break; |
| 1031 | } |
| 1032 | atrace_begin(ATRACE_TAG_AIDL, "IComplexTypeInterface::Send::cppServer"); |
| 1033 | ::android::binder::Status _aidl_status(Send(in_goes_in, &in_goes_in_and_out, &out_goes_out, &_aidl_return)); |
| 1034 | atrace_end(ATRACE_TAG_AIDL); |
| 1035 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 1036 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1037 | break; |
| 1038 | } |
| 1039 | if (!_aidl_status.isOk()) { |
| 1040 | break; |
| 1041 | } |
| 1042 | _aidl_ret_status = _aidl_reply->writeInt32Vector(_aidl_return); |
| 1043 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1044 | break; |
| 1045 | } |
| 1046 | _aidl_ret_status = _aidl_reply->writeDoubleVector(in_goes_in_and_out); |
| 1047 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1048 | break; |
| 1049 | } |
| 1050 | _aidl_ret_status = _aidl_reply->writeBoolVector(out_goes_out); |
| 1051 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1052 | break; |
| 1053 | } |
| 1054 | } |
| 1055 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 1056 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 1 /* Piff */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 1057 | { |
| 1058 | int32_t in_times; |
| 1059 | if (!(_aidl_data.checkInterface(this))) { |
| 1060 | _aidl_ret_status = ::android::BAD_TYPE; |
| 1061 | break; |
| 1062 | } |
| 1063 | _aidl_ret_status = _aidl_data.readInt32(&in_times); |
| 1064 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1065 | break; |
| 1066 | } |
| 1067 | atrace_begin(ATRACE_TAG_AIDL, "IComplexTypeInterface::Piff::cppServer"); |
| 1068 | ::android::binder::Status _aidl_status(Piff(in_times)); |
| 1069 | atrace_end(ATRACE_TAG_AIDL); |
| 1070 | } |
| 1071 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 1072 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 2 /* TakesABinder */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 1073 | { |
| 1074 | ::android::sp<::foo::IFooType> in_f; |
| 1075 | ::android::sp<::foo::IFooType> _aidl_return; |
| 1076 | if (!(_aidl_data.checkInterface(this))) { |
| 1077 | _aidl_ret_status = ::android::BAD_TYPE; |
| 1078 | break; |
| 1079 | } |
| 1080 | _aidl_ret_status = _aidl_data.readStrongBinder(&in_f); |
| 1081 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1082 | break; |
| 1083 | } |
| 1084 | atrace_begin(ATRACE_TAG_AIDL, "IComplexTypeInterface::TakesABinder::cppServer"); |
| 1085 | ::android::binder::Status _aidl_status(TakesABinder(in_f, &_aidl_return)); |
| 1086 | atrace_end(ATRACE_TAG_AIDL); |
| 1087 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 1088 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1089 | break; |
| 1090 | } |
| 1091 | if (!_aidl_status.isOk()) { |
| 1092 | break; |
| 1093 | } |
| 1094 | _aidl_ret_status = _aidl_reply->writeStrongBinder(::foo::IFooType::asBinder(_aidl_return)); |
| 1095 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1096 | break; |
| 1097 | } |
| 1098 | } |
| 1099 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 1100 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 3 /* NullableBinder */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 1101 | { |
| 1102 | ::android::sp<::foo::IFooType> _aidl_return; |
| 1103 | if (!(_aidl_data.checkInterface(this))) { |
| 1104 | _aidl_ret_status = ::android::BAD_TYPE; |
| 1105 | break; |
| 1106 | } |
| 1107 | atrace_begin(ATRACE_TAG_AIDL, "IComplexTypeInterface::NullableBinder::cppServer"); |
| 1108 | ::android::binder::Status _aidl_status(NullableBinder(&_aidl_return)); |
| 1109 | atrace_end(ATRACE_TAG_AIDL); |
| 1110 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 1111 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1112 | break; |
| 1113 | } |
| 1114 | if (!_aidl_status.isOk()) { |
| 1115 | break; |
| 1116 | } |
| 1117 | _aidl_ret_status = _aidl_reply->writeStrongBinder(::foo::IFooType::asBinder(_aidl_return)); |
| 1118 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1119 | break; |
| 1120 | } |
| 1121 | } |
| 1122 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 1123 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 4 /* StringListMethod */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 1124 | { |
| 1125 | ::std::vector<::android::String16> in_input; |
| 1126 | ::std::vector<::android::String16> out_output; |
| 1127 | ::std::vector<::android::String16> _aidl_return; |
| 1128 | if (!(_aidl_data.checkInterface(this))) { |
| 1129 | _aidl_ret_status = ::android::BAD_TYPE; |
| 1130 | break; |
| 1131 | } |
| 1132 | _aidl_ret_status = _aidl_data.readString16Vector(&in_input); |
| 1133 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1134 | break; |
| 1135 | } |
| 1136 | atrace_begin(ATRACE_TAG_AIDL, "IComplexTypeInterface::StringListMethod::cppServer"); |
| 1137 | ::android::binder::Status _aidl_status(StringListMethod(in_input, &out_output, &_aidl_return)); |
| 1138 | atrace_end(ATRACE_TAG_AIDL); |
| 1139 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 1140 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1141 | break; |
| 1142 | } |
| 1143 | if (!_aidl_status.isOk()) { |
| 1144 | break; |
| 1145 | } |
| 1146 | _aidl_ret_status = _aidl_reply->writeString16Vector(_aidl_return); |
| 1147 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1148 | break; |
| 1149 | } |
| 1150 | _aidl_ret_status = _aidl_reply->writeString16Vector(out_output); |
| 1151 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1152 | break; |
| 1153 | } |
| 1154 | } |
| 1155 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 1156 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 5 /* BinderListMethod */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 1157 | { |
| 1158 | ::std::vector<::android::sp<::android::IBinder>> in_input; |
| 1159 | ::std::vector<::android::sp<::android::IBinder>> out_output; |
| 1160 | ::std::vector<::android::sp<::android::IBinder>> _aidl_return; |
| 1161 | if (!(_aidl_data.checkInterface(this))) { |
| 1162 | _aidl_ret_status = ::android::BAD_TYPE; |
| 1163 | break; |
| 1164 | } |
| 1165 | _aidl_ret_status = _aidl_data.readStrongBinderVector(&in_input); |
| 1166 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1167 | break; |
| 1168 | } |
| 1169 | atrace_begin(ATRACE_TAG_AIDL, "IComplexTypeInterface::BinderListMethod::cppServer"); |
| 1170 | ::android::binder::Status _aidl_status(BinderListMethod(in_input, &out_output, &_aidl_return)); |
| 1171 | atrace_end(ATRACE_TAG_AIDL); |
| 1172 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 1173 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1174 | break; |
| 1175 | } |
| 1176 | if (!_aidl_status.isOk()) { |
| 1177 | break; |
| 1178 | } |
| 1179 | _aidl_ret_status = _aidl_reply->writeStrongBinderVector(_aidl_return); |
| 1180 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1181 | break; |
| 1182 | } |
| 1183 | _aidl_ret_status = _aidl_reply->writeStrongBinderVector(out_output); |
| 1184 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1185 | break; |
| 1186 | } |
| 1187 | } |
| 1188 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 1189 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 6 /* TakesAFileDescriptor */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 1190 | { |
| 1191 | ::android::base::unique_fd in_f; |
| 1192 | ::android::base::unique_fd _aidl_return; |
| 1193 | if (!(_aidl_data.checkInterface(this))) { |
| 1194 | _aidl_ret_status = ::android::BAD_TYPE; |
| 1195 | break; |
| 1196 | } |
| 1197 | _aidl_ret_status = _aidl_data.readUniqueFileDescriptor(&in_f); |
| 1198 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1199 | break; |
| 1200 | } |
| 1201 | atrace_begin(ATRACE_TAG_AIDL, "IComplexTypeInterface::TakesAFileDescriptor::cppServer"); |
| 1202 | ::android::binder::Status _aidl_status(TakesAFileDescriptor(in_f, &_aidl_return)); |
| 1203 | atrace_end(ATRACE_TAG_AIDL); |
| 1204 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 1205 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1206 | break; |
| 1207 | } |
| 1208 | if (!_aidl_status.isOk()) { |
| 1209 | break; |
| 1210 | } |
| 1211 | _aidl_ret_status = _aidl_reply->writeUniqueFileDescriptor(_aidl_return); |
| 1212 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1213 | break; |
| 1214 | } |
| 1215 | } |
| 1216 | break; |
Jeongik Cha | b5d962f | 2018-11-17 09:12:28 +0900 | [diff] [blame] | 1217 | case ::android::IBinder::FIRST_CALL_TRANSACTION + 7 /* TakesAFileDescriptorArray */: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 1218 | { |
| 1219 | ::std::vector<::android::base::unique_fd> in_f; |
| 1220 | ::std::vector<::android::base::unique_fd> _aidl_return; |
| 1221 | if (!(_aidl_data.checkInterface(this))) { |
| 1222 | _aidl_ret_status = ::android::BAD_TYPE; |
| 1223 | break; |
| 1224 | } |
| 1225 | _aidl_ret_status = _aidl_data.readUniqueFileDescriptorVector(&in_f); |
| 1226 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1227 | break; |
| 1228 | } |
| 1229 | atrace_begin(ATRACE_TAG_AIDL, "IComplexTypeInterface::TakesAFileDescriptorArray::cppServer"); |
| 1230 | ::android::binder::Status _aidl_status(TakesAFileDescriptorArray(in_f, &_aidl_return)); |
| 1231 | atrace_end(ATRACE_TAG_AIDL); |
| 1232 | _aidl_ret_status = _aidl_status.writeToParcel(_aidl_reply); |
| 1233 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1234 | break; |
| 1235 | } |
| 1236 | if (!_aidl_status.isOk()) { |
| 1237 | break; |
| 1238 | } |
| 1239 | _aidl_ret_status = _aidl_reply->writeUniqueFileDescriptorVector(_aidl_return); |
| 1240 | if (((_aidl_ret_status) != (::android::OK))) { |
| 1241 | break; |
| 1242 | } |
| 1243 | } |
| 1244 | break; |
| 1245 | default: |
| 1246 | { |
| 1247 | _aidl_ret_status = ::android::BBinder::onTransact(_aidl_code, _aidl_data, _aidl_reply, _aidl_flags); |
| 1248 | } |
| 1249 | break; |
| 1250 | } |
| 1251 | if (_aidl_ret_status == ::android::UNEXPECTED_NULL) { |
| 1252 | _aidl_ret_status = ::android::binder::Status::fromExceptionCode(::android::binder::Status::EX_NULL_POINTER).writeToParcel(_aidl_reply); |
| 1253 | } |
| 1254 | return _aidl_ret_status; |
Martijn Coenen | f1b5078 | 2018-02-21 21:06:23 +0100 | [diff] [blame] | 1255 | } |
| 1256 | |
| 1257 | } // namespace os |
| 1258 | |
| 1259 | } // namespace android |
| 1260 | )"; |
| 1261 | |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1262 | const char kExpectedComplexTypeInterfaceHeaderOutput[] = |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 1263 | R"(#ifndef AIDL_GENERATED_ANDROID_OS_I_COMPLEX_TYPE_INTERFACE_H_ |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1264 | #define AIDL_GENERATED_ANDROID_OS_I_COMPLEX_TYPE_INTERFACE_H_ |
| 1265 | |
Christopher Wiley | 7cb9c25 | 2016-04-11 11:07:33 -0700 | [diff] [blame] | 1266 | #include <android-base/unique_fd.h> |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1267 | #include <binder/IBinder.h> |
| 1268 | #include <binder/IInterface.h> |
Christopher Wiley | 433c8bb | 2015-11-12 14:20:46 -0800 | [diff] [blame] | 1269 | #include <binder/Status.h> |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1270 | #include <cstdint> |
Casey Dahlin | 389781f | 2015-10-22 13:13:21 -0700 | [diff] [blame] | 1271 | #include <foo/IFooType.h> |
Christopher Wiley | 041c8d7 | 2016-08-18 13:52:51 -0700 | [diff] [blame] | 1272 | #include <memory> |
Christopher Wiley | 56c9bf3 | 2015-10-30 10:41:12 -0700 | [diff] [blame] | 1273 | #include <utils/String16.h> |
Casey Dahlin | 389781f | 2015-10-22 13:13:21 -0700 | [diff] [blame] | 1274 | #include <utils/StrongPointer.h> |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1275 | #include <vector> |
| 1276 | |
| 1277 | namespace android { |
| 1278 | |
| 1279 | namespace os { |
| 1280 | |
Casey Dahlin | b8d9e88 | 2015-11-24 10:57:23 -0800 | [diff] [blame] | 1281 | class IComplexTypeInterface : public ::android::IInterface { |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1282 | public: |
Jiyong Park | a755dc7 | 2018-06-29 13:52:24 +0900 | [diff] [blame] | 1283 | DECLARE_META_INTERFACE(ComplexTypeInterface) |
| 1284 | enum : int32_t { |
| 1285 | MY_CONSTANT = 3, |
| 1286 | }; |
| 1287 | virtual ::android::binder::Status Send(const ::std::unique_ptr<::std::vector<int32_t>>& goes_in, ::std::vector<double>* goes_in_and_out, ::std::vector<bool>* goes_out, ::std::vector<int32_t>* _aidl_return) = 0; |
| 1288 | virtual ::android::binder::Status Piff(int32_t times) = 0; |
| 1289 | virtual ::android::binder::Status TakesABinder(const ::android::sp<::foo::IFooType>& f, ::android::sp<::foo::IFooType>* _aidl_return) = 0; |
| 1290 | virtual ::android::binder::Status NullableBinder(::android::sp<::foo::IFooType>* _aidl_return) = 0; |
| 1291 | virtual ::android::binder::Status StringListMethod(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* output, ::std::vector<::android::String16>* _aidl_return) = 0; |
| 1292 | virtual ::android::binder::Status BinderListMethod(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* output, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) = 0; |
| 1293 | virtual ::android::binder::Status TakesAFileDescriptor(const ::android::base::unique_fd& f, ::android::base::unique_fd* _aidl_return) = 0; |
| 1294 | virtual ::android::binder::Status TakesAFileDescriptorArray(const ::std::vector<::android::base::unique_fd>& f, ::std::vector<::android::base::unique_fd>* _aidl_return) = 0; |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1295 | }; // class IComplexTypeInterface |
| 1296 | |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 1297 | class IComplexTypeInterfaceDefault : public IComplexTypeInterface { |
| 1298 | public: |
| 1299 | ::android::IBinder* onAsBinder() override; |
| 1300 | ::android::binder::Status Send(const ::std::unique_ptr<::std::vector<int32_t>>& goes_in, ::std::vector<double>* goes_in_and_out, ::std::vector<bool>* goes_out, ::std::vector<int32_t>* _aidl_return) override; |
| 1301 | ::android::binder::Status Piff(int32_t times) override; |
| 1302 | ::android::binder::Status TakesABinder(const ::android::sp<::foo::IFooType>& f, ::android::sp<::foo::IFooType>* _aidl_return) override; |
| 1303 | ::android::binder::Status NullableBinder(::android::sp<::foo::IFooType>* _aidl_return) override; |
| 1304 | ::android::binder::Status StringListMethod(const ::std::vector<::android::String16>& input, ::std::vector<::android::String16>* output, ::std::vector<::android::String16>* _aidl_return) override; |
| 1305 | ::android::binder::Status BinderListMethod(const ::std::vector<::android::sp<::android::IBinder>>& input, ::std::vector<::android::sp<::android::IBinder>>* output, ::std::vector<::android::sp<::android::IBinder>>* _aidl_return) override; |
| 1306 | ::android::binder::Status TakesAFileDescriptor(const ::android::base::unique_fd& f, ::android::base::unique_fd* _aidl_return) override; |
| 1307 | ::android::binder::Status TakesAFileDescriptorArray(const ::std::vector<::android::base::unique_fd>& f, ::std::vector<::android::base::unique_fd>* _aidl_return) override; |
| 1308 | |
| 1309 | }; |
| 1310 | |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1311 | } // namespace os |
| 1312 | |
| 1313 | } // namespace android |
| 1314 | |
Christopher Wiley | 11a9d79 | 2016-02-24 17:20:33 -0800 | [diff] [blame] | 1315 | #endif // AIDL_GENERATED_ANDROID_OS_I_COMPLEX_TYPE_INTERFACE_H_ |
| 1316 | )"; |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1317 | |
| 1318 | const char kExpectedComplexTypeInterfaceSourceOutput[] = |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 1319 | R"(#include <android/os/IComplexTypeInterface.h> |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1320 | #include <android/os/BpComplexTypeInterface.h> |
| 1321 | |
| 1322 | namespace android { |
| 1323 | |
| 1324 | namespace os { |
| 1325 | |
Christopher Wiley | 11a9d79 | 2016-02-24 17:20:33 -0800 | [diff] [blame] | 1326 | IMPLEMENT_META_INTERFACE(ComplexTypeInterface, "android.os.IComplexTypeInterface") |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1327 | |
Jiyong Park | 75e1a74 | 2018-07-04 12:31:23 +0900 | [diff] [blame] | 1328 | ::android::IBinder* IComplexTypeInterfaceDefault::onAsBinder() { |
| 1329 | return nullptr; |
| 1330 | } |
| 1331 | |
| 1332 | ::android::binder::Status IComplexTypeInterfaceDefault::Send(const ::std::unique_ptr<::std::vector<int32_t>>&, ::std::vector<double>*, ::std::vector<bool>*, ::std::vector<int32_t>* ) { |
| 1333 | return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION); |
| 1334 | } |
| 1335 | |
| 1336 | ::android::binder::Status IComplexTypeInterfaceDefault::Piff(int32_t) { |
| 1337 | return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION); |
| 1338 | } |
| 1339 | |
| 1340 | ::android::binder::Status IComplexTypeInterfaceDefault::TakesABinder(const ::android::sp<::foo::IFooType>&, ::android::sp<::foo::IFooType>* ) { |
| 1341 | return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION); |
| 1342 | } |
| 1343 | |
| 1344 | ::android::binder::Status IComplexTypeInterfaceDefault::NullableBinder(::android::sp<::foo::IFooType>* ) { |
| 1345 | return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION); |
| 1346 | } |
| 1347 | |
| 1348 | ::android::binder::Status IComplexTypeInterfaceDefault::StringListMethod(const ::std::vector<::android::String16>&, ::std::vector<::android::String16>*, ::std::vector<::android::String16>* ) { |
| 1349 | return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION); |
| 1350 | } |
| 1351 | |
| 1352 | ::android::binder::Status IComplexTypeInterfaceDefault::BinderListMethod(const ::std::vector<::android::sp<::android::IBinder>>&, ::std::vector<::android::sp<::android::IBinder>>*, ::std::vector<::android::sp<::android::IBinder>>* ) { |
| 1353 | return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION); |
| 1354 | } |
| 1355 | |
| 1356 | ::android::binder::Status IComplexTypeInterfaceDefault::TakesAFileDescriptor(const ::android::base::unique_fd&, ::android::base::unique_fd* ) { |
| 1357 | return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION); |
| 1358 | } |
| 1359 | |
| 1360 | ::android::binder::Status IComplexTypeInterfaceDefault::TakesAFileDescriptorArray(const ::std::vector<::android::base::unique_fd>&, ::std::vector<::android::base::unique_fd>* ) { |
| 1361 | return ::android::binder::Status::fromStatusT(::android::UNKNOWN_TRANSACTION); |
| 1362 | } |
| 1363 | |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1364 | } // namespace os |
| 1365 | |
| 1366 | } // namespace android |
| 1367 | )"; |
| 1368 | |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 1369 | } // namespace |
| 1370 | |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1371 | class ASTTest : public ::testing::Test { |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 1372 | protected: |
Jiyong Park | 6f77e0c | 2018-07-28 16:55:44 +0900 | [diff] [blame] | 1373 | ASTTest(const string& cmdline, const string& file_contents) |
| 1374 | : options_(Options::From(cmdline)), file_contents_(file_contents) { |
Christopher Wiley | 5679952 | 2015-10-31 10:17:04 -0700 | [diff] [blame] | 1375 | types_.Init(); |
| 1376 | } |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1377 | |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1378 | AidlInterface* ParseSingleInterface() { |
Jiyong Park | 6f77e0c | 2018-07-28 16:55:44 +0900 | [diff] [blame] | 1379 | io_delegate_.SetFileContents(options_.InputFiles().at(0), file_contents_); |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 1380 | |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1381 | vector<AidlDefinedType*> defined_types; |
| 1382 | vector<string> imported_files; |
Jiyong Park | 8c38053 | 2018-08-30 14:55:26 +0900 | [diff] [blame] | 1383 | ImportResolver import_resolver{io_delegate_, options_.InputFiles().at(0), {"."}, {}}; |
Jiyong Park | 6f77e0c | 2018-07-28 16:55:44 +0900 | [diff] [blame] | 1384 | AidlError err = ::android::aidl::internals::load_and_validate_aidl( |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1385 | options_.InputFiles().front(), options_, io_delegate_, &types_, &defined_types, |
| 1386 | &imported_files); |
Christopher Wiley | 4a2884b | 2015-10-07 11:27:45 -0700 | [diff] [blame] | 1387 | |
Steven Moreland | 5557f1c | 2018-07-02 13:50:23 -0700 | [diff] [blame] | 1388 | if (err != AidlError::OK) { |
Casey Dahlin | 2cc9316 | 2015-10-02 16:14:17 -0700 | [diff] [blame] | 1389 | return nullptr; |
Steven Moreland | 5557f1c | 2018-07-02 13:50:23 -0700 | [diff] [blame] | 1390 | } |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 1391 | |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1392 | EXPECT_EQ(1ul, defined_types.size()); |
| 1393 | EXPECT_NE(nullptr, defined_types.front()->AsInterface()); |
Steven Moreland | 5557f1c | 2018-07-02 13:50:23 -0700 | [diff] [blame] | 1394 | |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1395 | return defined_types.front()->AsInterface(); |
Christopher Wiley | 90be4e3 | 2015-10-20 14:55:25 -0700 | [diff] [blame] | 1396 | } |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 1397 | |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 1398 | void Compare(Document* doc, const char* expected) { |
| 1399 | string output; |
Jiyong Park | b78e15b | 2018-07-04 20:31:03 +0900 | [diff] [blame] | 1400 | doc->Write(CodeWriter::ForString(&output).get()); |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 1401 | |
Casey Dahlin | 80ada3d | 2015-10-20 20:33:56 -0700 | [diff] [blame] | 1402 | if (expected == output) { |
| 1403 | return; // Success |
| 1404 | } |
| 1405 | |
| 1406 | test::PrintDiff(expected, output); |
| 1407 | FAIL() << "Document contents did not match expected contents"; |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 1408 | } |
Casey Dahlin | 389781f | 2015-10-22 13:13:21 -0700 | [diff] [blame] | 1409 | |
Jiyong Park | 6f77e0c | 2018-07-28 16:55:44 +0900 | [diff] [blame] | 1410 | const Options options_; |
Casey Dahlin | 389781f | 2015-10-22 13:13:21 -0700 | [diff] [blame] | 1411 | const string file_contents_; |
| 1412 | FakeIoDelegate io_delegate_; |
| 1413 | TypeNamespace types_; |
Christopher Wiley | 0c732db | 2015-09-29 14:36:44 -0700 | [diff] [blame] | 1414 | }; |
| 1415 | |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1416 | class ComplexTypeInterfaceASTTest : public ASTTest { |
Casey Dahlin | 389781f | 2015-10-22 13:13:21 -0700 | [diff] [blame] | 1417 | public: |
| 1418 | ComplexTypeInterfaceASTTest() |
Jiyong Park | fbbfa93 | 2018-07-30 21:44:10 +0900 | [diff] [blame] | 1419 | : ASTTest("aidl --lang=cpp -I . -o out android/os/IComplexTypeInterface.aidl", |
Casey Dahlin | 389781f | 2015-10-22 13:13:21 -0700 | [diff] [blame] | 1420 | kComplexTypeInterfaceAIDL) { |
| 1421 | io_delegate_.SetFileContents("foo/IFooType.aidl", |
| 1422 | "package foo; interface IFooType {}"); |
| 1423 | } |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1424 | }; |
| 1425 | |
| 1426 | TEST_F(ComplexTypeInterfaceASTTest, GeneratesClientHeader) { |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1427 | AidlInterface* interface = ParseSingleInterface(); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1428 | ASSERT_NE(interface, nullptr); |
Jiyong Park | fbbfa93 | 2018-07-30 21:44:10 +0900 | [diff] [blame] | 1429 | unique_ptr<Document> doc = internals::BuildClientHeader(types_, *interface, options_); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1430 | Compare(doc.get(), kExpectedComplexTypeClientHeaderOutput); |
| 1431 | } |
| 1432 | |
| 1433 | TEST_F(ComplexTypeInterfaceASTTest, GeneratesClientSource) { |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1434 | AidlInterface* interface = ParseSingleInterface(); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1435 | ASSERT_NE(interface, nullptr); |
Jiyong Park | fbbfa93 | 2018-07-30 21:44:10 +0900 | [diff] [blame] | 1436 | unique_ptr<Document> doc = internals::BuildClientSource(types_, *interface, options_); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1437 | Compare(doc.get(), kExpectedComplexTypeClientSourceOutput); |
| 1438 | } |
| 1439 | |
| 1440 | TEST_F(ComplexTypeInterfaceASTTest, GeneratesServerHeader) { |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1441 | AidlInterface* interface = ParseSingleInterface(); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1442 | ASSERT_NE(interface, nullptr); |
Jiyong Park | fbbfa93 | 2018-07-30 21:44:10 +0900 | [diff] [blame] | 1443 | unique_ptr<Document> doc = internals::BuildServerHeader(types_, *interface, options_); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1444 | Compare(doc.get(), kExpectedComplexTypeServerHeaderOutput); |
| 1445 | } |
| 1446 | |
| 1447 | TEST_F(ComplexTypeInterfaceASTTest, GeneratesServerSource) { |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1448 | AidlInterface* interface = ParseSingleInterface(); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1449 | ASSERT_NE(interface, nullptr); |
Jiyong Park | fbbfa93 | 2018-07-30 21:44:10 +0900 | [diff] [blame] | 1450 | unique_ptr<Document> doc = internals::BuildServerSource(types_, *interface, options_); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1451 | Compare(doc.get(), kExpectedComplexTypeServerSourceOutput); |
| 1452 | } |
| 1453 | |
| 1454 | TEST_F(ComplexTypeInterfaceASTTest, GeneratesInterfaceHeader) { |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1455 | AidlInterface* interface = ParseSingleInterface(); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1456 | ASSERT_NE(interface, nullptr); |
Jiyong Park | fbbfa93 | 2018-07-30 21:44:10 +0900 | [diff] [blame] | 1457 | unique_ptr<Document> doc = internals::BuildInterfaceHeader(types_, *interface, options_); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1458 | Compare(doc.get(), kExpectedComplexTypeInterfaceHeaderOutput); |
| 1459 | } |
| 1460 | |
| 1461 | TEST_F(ComplexTypeInterfaceASTTest, GeneratesInterfaceSource) { |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1462 | AidlInterface* interface = ParseSingleInterface(); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1463 | ASSERT_NE(interface, nullptr); |
Jiyong Park | fbbfa93 | 2018-07-30 21:44:10 +0900 | [diff] [blame] | 1464 | unique_ptr<Document> doc = internals::BuildInterfaceSource(types_, *interface, options_); |
Casey Dahlin | b096661 | 2015-10-19 16:35:26 -0700 | [diff] [blame] | 1465 | Compare(doc.get(), kExpectedComplexTypeInterfaceSourceOutput); |
Christopher Wiley | 1dd458d | 2015-09-30 11:05:52 -0700 | [diff] [blame] | 1466 | } |
| 1467 | |
Jiyong Park | fbbfa93 | 2018-07-30 21:44:10 +0900 | [diff] [blame] | 1468 | class ComplexTypeInterfaceASTTestWithTrace : public ASTTest { |
| 1469 | public: |
| 1470 | ComplexTypeInterfaceASTTestWithTrace() |
| 1471 | : ASTTest("aidl --lang=cpp -t -I . -o out android/os/IComplexTypeInterface.aidl", |
| 1472 | kComplexTypeInterfaceAIDL) { |
| 1473 | io_delegate_.SetFileContents("foo/IFooType.aidl", "package foo; interface IFooType {}"); |
| 1474 | } |
| 1475 | }; |
| 1476 | |
| 1477 | TEST_F(ComplexTypeInterfaceASTTestWithTrace, GeneratesClientSource) { |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1478 | AidlInterface* interface = ParseSingleInterface(); |
Jiyong Park | fbbfa93 | 2018-07-30 21:44:10 +0900 | [diff] [blame] | 1479 | ASSERT_NE(interface, nullptr); |
| 1480 | unique_ptr<Document> doc = internals::BuildClientSource(types_, *interface, options_); |
| 1481 | Compare(doc.get(), kExpectedComplexTypeClientWithTraceSourceOutput); |
| 1482 | } |
| 1483 | |
| 1484 | TEST_F(ComplexTypeInterfaceASTTestWithTrace, GeneratesServerSource) { |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1485 | AidlInterface* interface = ParseSingleInterface(); |
Jiyong Park | fbbfa93 | 2018-07-30 21:44:10 +0900 | [diff] [blame] | 1486 | ASSERT_NE(interface, nullptr); |
| 1487 | unique_ptr<Document> doc = internals::BuildServerSource(types_, *interface, options_); |
| 1488 | Compare(doc.get(), kExpectedComplexTypeServerWithTraceSourceOutput); |
| 1489 | } |
| 1490 | |
Christopher Wiley | 9d6e0b2 | 2015-11-13 12:18:16 -0800 | [diff] [blame] | 1491 | namespace test_io_handling { |
| 1492 | |
| 1493 | const char kInputPath[] = "a/IFoo.aidl"; |
| 1494 | const char kOutputPath[] = "output.cpp"; |
| 1495 | const char kHeaderDir[] = "headers"; |
| 1496 | const char kInterfaceHeaderRelPath[] = "a/IFoo.h"; |
| 1497 | |
Jiyong Park | 6f77e0c | 2018-07-28 16:55:44 +0900 | [diff] [blame] | 1498 | const string kCmdline = string("aidl-cpp ") + kInputPath + " " + kHeaderDir + " " + kOutputPath; |
| 1499 | |
Christopher Wiley | 9d6e0b2 | 2015-11-13 12:18:16 -0800 | [diff] [blame] | 1500 | } // namespace test_io_handling |
| 1501 | |
| 1502 | class IoErrorHandlingTest : public ASTTest { |
| 1503 | public: |
Jiyong Park | 6f77e0c | 2018-07-28 16:55:44 +0900 | [diff] [blame] | 1504 | IoErrorHandlingTest() : ASTTest(test_io_handling::kCmdline, "package a; interface IFoo {}") {} |
Christopher Wiley | 9d6e0b2 | 2015-11-13 12:18:16 -0800 | [diff] [blame] | 1505 | }; |
| 1506 | |
| 1507 | TEST_F(IoErrorHandlingTest, GenerateCorrectlyAbsentErrors) { |
| 1508 | // Confirm that this is working correctly without I/O problems. |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1509 | AidlInterface* interface = ParseSingleInterface(); |
Christopher Wiley | 9d6e0b2 | 2015-11-13 12:18:16 -0800 | [diff] [blame] | 1510 | ASSERT_NE(interface, nullptr); |
Jiyong Park | 6f77e0c | 2018-07-28 16:55:44 +0900 | [diff] [blame] | 1511 | ASSERT_TRUE(GenerateCpp(options_.OutputFile(), options_, types_, *interface, io_delegate_)); |
Christopher Wiley | 9d6e0b2 | 2015-11-13 12:18:16 -0800 | [diff] [blame] | 1512 | } |
| 1513 | |
| 1514 | TEST_F(IoErrorHandlingTest, HandlesBadHeaderWrite) { |
| 1515 | using namespace test_io_handling; |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1516 | AidlInterface* interface = ParseSingleInterface(); |
Christopher Wiley | 9d6e0b2 | 2015-11-13 12:18:16 -0800 | [diff] [blame] | 1517 | ASSERT_NE(interface, nullptr); |
| 1518 | |
| 1519 | // Simulate issues closing the interface header. |
| 1520 | const string header_path = |
| 1521 | StringPrintf("%s%c%s", kHeaderDir, OS_PATH_SEPARATOR, |
| 1522 | kInterfaceHeaderRelPath); |
| 1523 | io_delegate_.AddBrokenFilePath(header_path); |
Jiyong Park | 6f77e0c | 2018-07-28 16:55:44 +0900 | [diff] [blame] | 1524 | ASSERT_FALSE(GenerateCpp(options_.OutputFile(), options_, types_, *interface, io_delegate_)); |
Christopher Wiley | 9d6e0b2 | 2015-11-13 12:18:16 -0800 | [diff] [blame] | 1525 | // We should never attempt to write the C++ file if we fail writing headers. |
| 1526 | ASSERT_FALSE(io_delegate_.GetWrittenContents(kOutputPath, nullptr)); |
| 1527 | // We should remove partial results. |
| 1528 | ASSERT_TRUE(io_delegate_.PathWasRemoved(header_path)); |
| 1529 | } |
| 1530 | |
| 1531 | TEST_F(IoErrorHandlingTest, HandlesBadCppWrite) { |
| 1532 | using test_io_handling::kOutputPath; |
Jiyong Park | b034bf0 | 2018-07-30 17:44:33 +0900 | [diff] [blame] | 1533 | AidlInterface* interface = ParseSingleInterface(); |
Christopher Wiley | 9d6e0b2 | 2015-11-13 12:18:16 -0800 | [diff] [blame] | 1534 | ASSERT_NE(interface, nullptr); |
| 1535 | |
| 1536 | // Simulate issues closing the cpp file. |
| 1537 | io_delegate_.AddBrokenFilePath(kOutputPath); |
Jiyong Park | 6f77e0c | 2018-07-28 16:55:44 +0900 | [diff] [blame] | 1538 | ASSERT_FALSE(GenerateCpp(options_.OutputFile(), options_, types_, *interface, io_delegate_)); |
Christopher Wiley | 9d6e0b2 | 2015-11-13 12:18:16 -0800 | [diff] [blame] | 1539 | // We should remove partial results. |
| 1540 | ASSERT_TRUE(io_delegate_.PathWasRemoved(kOutputPath)); |
| 1541 | } |
| 1542 | |
Christopher Wiley | f944e79 | 2015-09-29 10:00:46 -0700 | [diff] [blame] | 1543 | } // namespace cpp |
Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 1544 | } // namespace aidl |
| 1545 | } // namespace android |