Andreas Huber | 1aec397 | 2016-08-26 09:26:32 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 17 | #include "Interface.h" |
| 18 | |
Zhuoyao Zhang | ba7e6e9 | 2016-08-10 12:19:02 -0700 | [diff] [blame] | 19 | #include "Annotation.h" |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 20 | #include "DeathRecipientType.h" |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 21 | #include "Method.h" |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 22 | #include "ScalarType.h" |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 23 | #include "StringType.h" |
| 24 | #include "VectorType.h" |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 25 | |
Steven Moreland | 14ee674 | 2016-10-18 12:58:28 -0700 | [diff] [blame] | 26 | #include <android-base/logging.h> |
Iliyan Malchev | a72e0d2 | 2016-09-09 11:03:08 -0700 | [diff] [blame] | 27 | #include <hidl-util/Formatter.h> |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 28 | #include <hidl-util/StringHelper.h> |
Zhuoyao Zhang | 864c771 | 2016-08-16 15:35:28 -0700 | [diff] [blame] | 29 | #include <iostream> |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 30 | #include <sstream> |
Zhuoyao Zhang | 864c771 | 2016-08-16 15:35:28 -0700 | [diff] [blame] | 31 | |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 32 | namespace android { |
| 33 | |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 34 | /* It is very important that these values NEVER change. These values |
| 35 | * must remain unchanged over the lifetime of android. This is |
| 36 | * because the framework on a device will be updated independently of |
| 37 | * the hals on a device. If the hals are compiled with one set of |
| 38 | * transaction values, and the framework with another, then the |
| 39 | * interface between them will be destroyed, and the device will not |
| 40 | * work. |
| 41 | */ |
| 42 | enum { |
| 43 | // These values are defined in hardware::IBinder. |
| 44 | /////////////////// User defined transactions |
| 45 | FIRST_CALL_TRANSACTION = 0x00000001, |
| 46 | LAST_CALL_TRANSACTION = 0x00efffff, |
| 47 | /////////////////// HIDL reserved |
| 48 | FIRST_HIDL_TRANSACTION = 0x00f00000, |
| 49 | HIDL_DESCRIPTOR_CHAIN_TRANSACTION = FIRST_HIDL_TRANSACTION, |
Martijn Coenen | af712c0 | 2016-11-16 15:26:27 +0100 | [diff] [blame] | 50 | HIDL_SYSPROPS_CHANGED_TRANSACTION, |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 51 | HIDL_LINK_TO_DEATH_TRANSACTION, |
| 52 | HIDL_UNLINK_TO_DEATH_TRANSACTION, |
Zhuoyao Zhang | dd85c5c | 2017-01-03 17:30:24 -0800 | [diff] [blame] | 53 | HIDL_SET_HAL_INSTRUMENTATION_TRANSACTION, |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 54 | LAST_HIDL_TRANSACTION = 0x00ffffff, |
| 55 | }; |
| 56 | |
Yifan Hong | a4b53d0 | 2016-10-31 17:29:10 -0700 | [diff] [blame] | 57 | Interface::Interface(const char *localName, const Location &location, Interface *super) |
| 58 | : Scope(localName, location), |
Andreas Huber | 9ed827c | 2016-08-22 12:31:13 -0700 | [diff] [blame] | 59 | mSuperType(super), |
Andreas Huber | ea081b3 | 2016-08-17 15:57:47 -0700 | [diff] [blame] | 60 | mIsJavaCompatibleInProgress(false) { |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 61 | mReservedMethods.push_back(createDescriptorChainMethod()); |
Martijn Coenen | af712c0 | 2016-11-16 15:26:27 +0100 | [diff] [blame] | 62 | mReservedMethods.push_back(createSyspropsChangedMethod()); |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 63 | mReservedMethods.push_back(createLinkToDeathMethod()); |
| 64 | mReservedMethods.push_back(createUnlinkToDeathMethod()); |
Zhuoyao Zhang | dd85c5c | 2017-01-03 17:30:24 -0800 | [diff] [blame] | 65 | mReservedMethods.push_back(createSetHALInstrumentationMethod()); |
Martijn Coenen | af712c0 | 2016-11-16 15:26:27 +0100 | [diff] [blame] | 66 | } |
| 67 | |
Steven Moreland | 30bb6a8 | 2016-11-30 09:18:34 -0800 | [diff] [blame] | 68 | std::string Interface::typeName() const { |
| 69 | return "interface " + localName(); |
| 70 | } |
| 71 | |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 72 | Method *Interface::createLinkToDeathMethod() const { |
| 73 | auto *results = new std::vector<TypedVar *> { |
| 74 | new TypedVar("success", new ScalarType(ScalarType::KIND_BOOL)) }; |
| 75 | auto *args = new std::vector<TypedVar *> { |
| 76 | new TypedVar("recipient", new DeathRecipientType()), |
| 77 | new TypedVar("cookie", new ScalarType(ScalarType::KIND_UINT64)) }; |
| 78 | |
| 79 | return new Method("linkToDeath", |
| 80 | args, |
| 81 | results, |
| 82 | false /*oneway */, |
| 83 | new std::vector<Annotation *>(), |
| 84 | HIDL_LINK_TO_DEATH_TRANSACTION, |
| 85 | { |
| 86 | {IMPL_HEADER, |
| 87 | [](auto &out) { |
| 88 | out << "(void)cookie;\n" |
| 89 | << "return (recipient != nullptr);\n"; |
| 90 | } |
| 91 | }, |
| 92 | {IMPL_PROXY, |
| 93 | [](auto &out) { |
Martijn Coenen | fa55d6e | 2016-12-20 06:08:31 +0100 | [diff] [blame] | 94 | out << "::android::hardware::ProcessState::self()->startThreadPool();\n"; |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 95 | out << "::android::hardware::hidl_binder_death_recipient *binder_recipient" |
| 96 | << " = new ::android::hardware::hidl_binder_death_recipient(recipient, cookie, this);\n" |
| 97 | << "std::unique_lock<std::mutex> lock(_hidl_mMutex);\n" |
| 98 | << "_hidl_mDeathRecipients.push_back(binder_recipient);\n" |
| 99 | << "return (remote()->linkToDeath(binder_recipient)" |
| 100 | << " == ::android::OK);\n"; |
| 101 | } |
| 102 | }, |
Martijn Coenen | 8d12b50 | 2016-12-27 14:30:27 +0100 | [diff] [blame] | 103 | {IMPL_STUB, nullptr} |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 104 | }, /*cppImpl*/ |
| 105 | { |
| 106 | {IMPL_HEADER, |
| 107 | [this](auto &out) { |
| 108 | out << "return true;"; |
| 109 | } |
| 110 | }, |
| 111 | {IMPL_PROXY, |
| 112 | [this](auto &out) { |
Martijn Coenen | 8d12b50 | 2016-12-27 14:30:27 +0100 | [diff] [blame] | 113 | out << "return mRemote.linkToDeath(recipient, cookie);\n"; |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 114 | } |
| 115 | }, |
Martijn Coenen | 8d12b50 | 2016-12-27 14:30:27 +0100 | [diff] [blame] | 116 | {IMPL_STUB, nullptr} |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 117 | } /*javaImpl*/ |
| 118 | ); |
| 119 | } |
| 120 | |
| 121 | Method *Interface::createUnlinkToDeathMethod() const { |
| 122 | auto *results = new std::vector<TypedVar *> { |
| 123 | new TypedVar("success", new ScalarType(ScalarType::KIND_BOOL)) }; |
| 124 | auto *args = new std::vector<TypedVar *> { |
| 125 | new TypedVar("recipient", new DeathRecipientType()) }; |
| 126 | |
| 127 | return new Method("unlinkToDeath", |
| 128 | args, |
| 129 | results, |
| 130 | false /*oneway */, |
| 131 | new std::vector<Annotation *>(), |
| 132 | HIDL_UNLINK_TO_DEATH_TRANSACTION, |
| 133 | { |
| 134 | {IMPL_HEADER, |
| 135 | [](auto &out) { |
| 136 | out << "return (recipient != nullptr);\n"; |
| 137 | } |
| 138 | }, |
| 139 | {IMPL_PROXY, |
| 140 | [](auto &out) { |
| 141 | out << "std::unique_lock<std::mutex> lock(_hidl_mMutex);\n" |
| 142 | << "for (auto it = _hidl_mDeathRecipients.begin();" |
| 143 | << "it != _hidl_mDeathRecipients.end();" |
| 144 | << "++it) {\n"; |
| 145 | out.indent([&] { |
| 146 | out.sIf("(*it)->getRecipient() == recipient", [&] { |
| 147 | out << "::android::status_t status = remote()->unlinkToDeath(*it);\n" |
| 148 | << "_hidl_mDeathRecipients.erase(it);\n" |
| 149 | << "return status == ::android::OK;\n"; |
| 150 | }); |
| 151 | }); |
| 152 | out << "}\n"; |
| 153 | out << "return false;\n"; |
| 154 | } |
| 155 | }, |
Martijn Coenen | 8d12b50 | 2016-12-27 14:30:27 +0100 | [diff] [blame] | 156 | {IMPL_STUB, nullptr /* don't generate code */} |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 157 | }, /*cppImpl*/ |
| 158 | { |
| 159 | {IMPL_HEADER, |
| 160 | [this](auto &out) { |
Martijn Coenen | 8d12b50 | 2016-12-27 14:30:27 +0100 | [diff] [blame] | 161 | out << "return true;\n"; |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 162 | } |
| 163 | }, |
| 164 | {IMPL_PROXY, |
| 165 | [this](auto &out) { |
Martijn Coenen | 8d12b50 | 2016-12-27 14:30:27 +0100 | [diff] [blame] | 166 | out << "return mRemote.unlinkToDeath(recipient);\n"; |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 167 | } |
| 168 | }, |
Martijn Coenen | 8d12b50 | 2016-12-27 14:30:27 +0100 | [diff] [blame] | 169 | {IMPL_STUB, nullptr /* don't generate code */} |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 170 | } /*javaImpl*/ |
| 171 | ); |
| 172 | } |
Martijn Coenen | af712c0 | 2016-11-16 15:26:27 +0100 | [diff] [blame] | 173 | Method *Interface::createSyspropsChangedMethod() const { |
| 174 | return new Method("notifySyspropsChanged", |
| 175 | new std::vector<TypedVar *>() /*args */, |
| 176 | new std::vector<TypedVar *>() /*results */, |
| 177 | true /*oneway */, |
| 178 | new std::vector<Annotation *>(), |
| 179 | HIDL_SYSPROPS_CHANGED_TRANSACTION, |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 180 | { { IMPL_HEADER, [this](auto &out) { |
Martijn Coenen | af712c0 | 2016-11-16 15:26:27 +0100 | [diff] [blame] | 181 | out << "::android::report_sysprop_change();\n"; |
| 182 | out << "return ::android::hardware::Void();"; |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 183 | } } }, /*cppImpl */ |
| 184 | { { IMPL_HEADER, [](auto &out) { /* javaImpl */ |
Martijn Coenen | af712c0 | 2016-11-16 15:26:27 +0100 | [diff] [blame] | 185 | out << "android.os.SystemProperties.reportSyspropChanged();"; |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 186 | } } } /*javaImpl */ |
Martijn Coenen | af712c0 | 2016-11-16 15:26:27 +0100 | [diff] [blame] | 187 | ); |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 188 | } |
| 189 | |
Zhuoyao Zhang | dd85c5c | 2017-01-03 17:30:24 -0800 | [diff] [blame] | 190 | Method *Interface::createSetHALInstrumentationMethod() const { |
| 191 | return new Method("setHALInstrumentation", |
| 192 | new std::vector<TypedVar *>() /*args */, |
| 193 | new std::vector<TypedVar *>() /*results */, |
| 194 | true /*oneway */, |
| 195 | new std::vector<Annotation *>(), |
| 196 | HIDL_SET_HAL_INSTRUMENTATION_TRANSACTION, |
| 197 | { |
| 198 | {IMPL_HEADER, |
| 199 | [this](auto &out) { |
| 200 | // do nothing for base class. |
| 201 | out << "return ::android::hardware::Void();\n"; |
| 202 | } |
| 203 | }, |
Zhuoyao Zhang | dd85c5c | 2017-01-03 17:30:24 -0800 | [diff] [blame] | 204 | {IMPL_STUB, |
| 205 | [](auto &out) { |
| 206 | out << "configureInstrumentation();\n"; |
| 207 | } |
| 208 | }, |
| 209 | {IMPL_PASSTHROUGH, |
| 210 | [](auto &out) { |
| 211 | out << "configureInstrumentation();\n"; |
| 212 | out << "return ::android::hardware::Void();\n"; |
| 213 | } |
| 214 | }, |
| 215 | }, /*cppImpl */ |
| 216 | { { IMPL_HEADER, [](auto & /*out*/) { /* javaImpl */ |
| 217 | // Not support for Java Impl for now. |
| 218 | } } } /*javaImpl */ |
| 219 | ); |
| 220 | } |
| 221 | |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 222 | Method *Interface::createDescriptorChainMethod() const { |
| 223 | VectorType *vecType = new VectorType(); |
| 224 | vecType->setElementType(new StringType()); |
| 225 | std::vector<TypedVar *> *results = new std::vector<TypedVar *>(); |
| 226 | results->push_back(new TypedVar("indicator", vecType)); |
| 227 | |
| 228 | return new Method("interfaceChain", |
| 229 | new std::vector<TypedVar *>() /* args */, |
| 230 | results, |
| 231 | false /* oneway */, |
| 232 | new std::vector<Annotation *>(), |
| 233 | HIDL_DESCRIPTOR_CHAIN_TRANSACTION, |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 234 | { { IMPL_HEADER, [this](auto &out) { |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 235 | std::vector<const Interface *> chain = typeChain(); |
Yifan Hong | 0393512 | 2016-12-19 11:10:40 -0800 | [diff] [blame] | 236 | out << "_hidl_cb("; |
| 237 | out.block([&] { |
| 238 | for (const Interface *iface : chain) { |
| 239 | out << iface->fullName() << "::descriptor,\n"; |
| 240 | } |
| 241 | }); |
| 242 | out << ");\n"; |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 243 | out << "return ::android::hardware::Void();"; |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 244 | } } }, /* cppImpl */ |
| 245 | { { IMPL_HEADER, [this](auto &out) { |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 246 | std::vector<const Interface *> chain = typeChain(); |
Yifan Hong | 1af7353 | 2016-11-09 14:32:58 -0800 | [diff] [blame] | 247 | out << "return new java.util.ArrayList<String>(java.util.Arrays.asList(\n"; |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 248 | out.indent(); out.indent(); |
| 249 | for (size_t i = 0; i < chain.size(); ++i) { |
| 250 | if (i != 0) |
| 251 | out << ",\n"; |
Steven Moreland | d39133b | 2016-11-11 12:30:08 -0800 | [diff] [blame] | 252 | out << chain[i]->fullJavaName() << ".kInterfaceName"; |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 253 | } |
| 254 | out << "));"; |
| 255 | out.unindent(); out.unindent(); |
Martijn Coenen | 115d428 | 2016-12-19 05:14:04 +0100 | [diff] [blame] | 256 | } } } /* javaImpl */ |
| 257 | ); |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 258 | } |
| 259 | |
| 260 | |
Steven Moreland | 14ee674 | 2016-10-18 12:58:28 -0700 | [diff] [blame] | 261 | bool Interface::addMethod(Method *method) { |
Yifan Hong | c893404 | 2016-11-17 17:10:52 -0800 | [diff] [blame] | 262 | if (isIBase()) { |
| 263 | // ignore addMethod requests for IBase; they are all HIDL reserved methods. |
| 264 | return true; |
| 265 | } |
| 266 | |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 267 | CHECK(!method->isHidlReserved()); |
Steven Moreland | 14ee674 | 2016-10-18 12:58:28 -0700 | [diff] [blame] | 268 | if (lookupMethod(method->name()) != nullptr) { |
| 269 | LOG(ERROR) << "Redefinition of method " << method->name(); |
| 270 | return false; |
| 271 | } |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 272 | size_t serial = FIRST_CALL_TRANSACTION; |
Steven Moreland | 14ee674 | 2016-10-18 12:58:28 -0700 | [diff] [blame] | 273 | |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 274 | serial += userDefinedMethods().size(); |
Steven Moreland | ef1a9fe | 2016-10-06 17:19:09 -0700 | [diff] [blame] | 275 | |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 276 | const Interface *ancestor = mSuperType; |
Steven Moreland | ef1a9fe | 2016-10-06 17:19:09 -0700 | [diff] [blame] | 277 | while (ancestor != nullptr) { |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 278 | serial += ancestor->userDefinedMethods().size(); |
Steven Moreland | ef1a9fe | 2016-10-06 17:19:09 -0700 | [diff] [blame] | 279 | ancestor = ancestor->superType(); |
| 280 | } |
| 281 | |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 282 | CHECK(serial <= LAST_CALL_TRANSACTION) << "More than " |
| 283 | << LAST_CALL_TRANSACTION << " methods are not allowed."; |
Steven Moreland | ef1a9fe | 2016-10-06 17:19:09 -0700 | [diff] [blame] | 284 | method->setSerialId(serial); |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 285 | mUserMethods.push_back(method); |
Steven Moreland | 14ee674 | 2016-10-18 12:58:28 -0700 | [diff] [blame] | 286 | |
| 287 | return true; |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 288 | } |
| 289 | |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 290 | |
Andreas Huber | 6cb08cf | 2016-08-03 15:44:51 -0700 | [diff] [blame] | 291 | const Interface *Interface::superType() const { |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 292 | return mSuperType; |
| 293 | } |
| 294 | |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 295 | std::vector<const Interface *> Interface::typeChain() const { |
| 296 | std::vector<const Interface *> v; |
| 297 | const Interface *iface = this; |
| 298 | while (iface != nullptr) { |
| 299 | v.push_back(iface); |
| 300 | iface = iface->mSuperType; |
| 301 | } |
| 302 | return v; |
| 303 | } |
| 304 | |
Yifan Hong | fe95aa2 | 2016-10-19 17:26:45 -0700 | [diff] [blame] | 305 | std::vector<const Interface *> Interface::superTypeChain() const { |
| 306 | return superType()->typeChain(); // should work even if superType is nullptr |
| 307 | } |
| 308 | |
Martijn Coenen | b40ef02 | 2017-01-02 15:21:46 +0100 | [diff] [blame] | 309 | bool Interface::isElidableType() const { |
| 310 | return true; |
| 311 | } |
| 312 | |
Andreas Huber | a2723d2 | 2016-07-29 15:36:07 -0700 | [diff] [blame] | 313 | bool Interface::isInterface() const { |
| 314 | return true; |
| 315 | } |
| 316 | |
Andreas Huber | 295ad30 | 2016-08-16 11:35:00 -0700 | [diff] [blame] | 317 | bool Interface::isBinder() const { |
| 318 | return true; |
| 319 | } |
| 320 | |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 321 | const std::vector<Method *> &Interface::userDefinedMethods() const { |
| 322 | return mUserMethods; |
| 323 | } |
| 324 | |
| 325 | const std::vector<Method *> &Interface::hidlReservedMethods() const { |
| 326 | return mReservedMethods; |
| 327 | } |
| 328 | |
| 329 | std::vector<Method *> Interface::methods() const { |
| 330 | std::vector<Method *> v(mUserMethods); |
| 331 | v.insert(v.end(), mReservedMethods.begin(), mReservedMethods.end()); |
| 332 | return v; |
| 333 | } |
| 334 | |
| 335 | std::vector<InterfaceAndMethod> Interface::allMethodsFromRoot() const { |
| 336 | std::vector<InterfaceAndMethod> v; |
| 337 | std::vector<const Interface *> chain = typeChain(); |
| 338 | for (auto it = chain.rbegin(); it != chain.rend(); ++it) { |
| 339 | const Interface *iface = *it; |
| 340 | for (Method *userMethod : iface->userDefinedMethods()) { |
| 341 | v.push_back(InterfaceAndMethod(iface, userMethod)); |
| 342 | } |
| 343 | } |
| 344 | for (Method *reservedMethod : hidlReservedMethods()) { |
Yifan Hong | c893404 | 2016-11-17 17:10:52 -0800 | [diff] [blame] | 345 | v.push_back(InterfaceAndMethod( |
| 346 | *chain.rbegin(), // IBase |
| 347 | reservedMethod)); |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 348 | } |
| 349 | return v; |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 350 | } |
| 351 | |
Steven Moreland | 14ee674 | 2016-10-18 12:58:28 -0700 | [diff] [blame] | 352 | Method *Interface::lookupMethod(std::string name) const { |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 353 | for (const auto &tuple : allMethodsFromRoot()) { |
| 354 | Method *method = tuple.method(); |
| 355 | if (method->name() == name) { |
| 356 | return method; |
Steven Moreland | 14ee674 | 2016-10-18 12:58:28 -0700 | [diff] [blame] | 357 | } |
Steven Moreland | 14ee674 | 2016-10-18 12:58:28 -0700 | [diff] [blame] | 358 | } |
| 359 | |
| 360 | return nullptr; |
| 361 | } |
| 362 | |
Steven Moreland | 4078631 | 2016-08-16 10:29:40 -0700 | [diff] [blame] | 363 | std::string Interface::getBaseName() const { |
Jayant Chowdhary | 3f32c1f | 2016-09-15 16:53:56 -0700 | [diff] [blame] | 364 | return fqName().getInterfaceBaseName(); |
Steven Moreland | 4078631 | 2016-08-16 10:29:40 -0700 | [diff] [blame] | 365 | } |
| 366 | |
Yifan Hong | eefe4f2 | 2017-01-04 15:32:42 -0800 | [diff] [blame] | 367 | std::string Interface::getProxyName() const { |
| 368 | return fqName().getInterfaceProxyName(); |
| 369 | } |
| 370 | |
| 371 | std::string Interface::getStubName() const { |
| 372 | return fqName().getInterfaceStubName(); |
| 373 | } |
| 374 | |
| 375 | std::string Interface::getHwName() const { |
| 376 | return fqName().getInterfaceHwName(); |
| 377 | } |
| 378 | |
| 379 | std::string Interface::getPassthroughName() const { |
| 380 | return fqName().getInterfacePassthroughName(); |
| 381 | } |
| 382 | |
Yifan Hong | 51a6509 | 2017-01-04 15:41:44 -0800 | [diff] [blame] | 383 | FQName Interface::getProxyFqName() const { |
Yifan Hong | eefe4f2 | 2017-01-04 15:32:42 -0800 | [diff] [blame] | 384 | return fqName().getInterfaceProxyFqName(); |
Yifan Hong | 158655a | 2016-11-08 12:34:07 -0800 | [diff] [blame] | 385 | } |
| 386 | |
Yifan Hong | 51a6509 | 2017-01-04 15:41:44 -0800 | [diff] [blame] | 387 | FQName Interface::getStubFqName() const { |
Yifan Hong | eefe4f2 | 2017-01-04 15:32:42 -0800 | [diff] [blame] | 388 | return fqName().getInterfaceStubFqName(); |
Yifan Hong | 158655a | 2016-11-08 12:34:07 -0800 | [diff] [blame] | 389 | } |
| 390 | |
Yifan Hong | 51a6509 | 2017-01-04 15:41:44 -0800 | [diff] [blame] | 391 | FQName Interface::getPassthroughFqName() const { |
Yifan Hong | eefe4f2 | 2017-01-04 15:32:42 -0800 | [diff] [blame] | 392 | return fqName().getInterfacePassthroughFqName(); |
Yifan Hong | 158655a | 2016-11-08 12:34:07 -0800 | [diff] [blame] | 393 | } |
| 394 | |
Steven Moreland | 979e099 | 2016-09-07 09:18:08 -0700 | [diff] [blame] | 395 | std::string Interface::getCppType(StorageMode mode, |
Steven Moreland | 979e099 | 2016-09-07 09:18:08 -0700 | [diff] [blame] | 396 | bool specifyNamespaces) const { |
Steven Moreland | 979e099 | 2016-09-07 09:18:08 -0700 | [diff] [blame] | 397 | const std::string base = |
| 398 | std::string(specifyNamespaces ? "::android::" : "") |
| 399 | + "sp<" |
| 400 | + (specifyNamespaces ? fullName() : partialCppName()) |
| 401 | + ">"; |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 402 | |
| 403 | switch (mode) { |
| 404 | case StorageMode_Stack: |
| 405 | case StorageMode_Result: |
| 406 | return base; |
| 407 | |
| 408 | case StorageMode_Argument: |
| 409 | return "const " + base + "&"; |
| 410 | } |
| 411 | } |
| 412 | |
Yifan Hong | 4ed1347 | 2016-11-02 10:44:11 -0700 | [diff] [blame] | 413 | std::string Interface::getJavaType(bool /* forInitializer */) const { |
Andreas Huber | 2831d51 | 2016-08-15 09:33:47 -0700 | [diff] [blame] | 414 | return fullJavaName(); |
| 415 | } |
| 416 | |
Zhuoyao Zhang | a588b23 | 2016-11-10 14:37:35 -0800 | [diff] [blame] | 417 | std::string Interface::getVtsType() const { |
| 418 | if (StringHelper::EndsWith(localName(), "Callback")) { |
| 419 | return "TYPE_HIDL_CALLBACK"; |
| 420 | } else { |
| 421 | return "TYPE_HIDL_INTERFACE"; |
| 422 | } |
| 423 | } |
| 424 | |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 425 | void Interface::emitReaderWriter( |
| 426 | Formatter &out, |
| 427 | const std::string &name, |
| 428 | const std::string &parcelObj, |
| 429 | bool parcelObjIsPointer, |
| 430 | bool isReader, |
| 431 | ErrorMode mode) const { |
| 432 | const std::string parcelObjDeref = |
| 433 | parcelObj + (parcelObjIsPointer ? "->" : "."); |
| 434 | |
| 435 | if (isReader) { |
Andreas Huber | e7ff228 | 2016-08-16 13:50:03 -0700 | [diff] [blame] | 436 | out << "{\n"; |
| 437 | out.indent(); |
| 438 | |
Iliyan Malchev | 549e259 | 2016-08-10 08:59:12 -0700 | [diff] [blame] | 439 | const std::string binderName = "_hidl_" + name + "_binder"; |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 440 | |
Andreas Huber | 8a82ff7 | 2016-08-04 10:29:39 -0700 | [diff] [blame] | 441 | out << "::android::sp<::android::hardware::IBinder> " |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 442 | << binderName << ";\n"; |
| 443 | |
Iliyan Malchev | 549e259 | 2016-08-10 08:59:12 -0700 | [diff] [blame] | 444 | out << "_hidl_err = "; |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 445 | out << parcelObjDeref |
| 446 | << "readNullableStrongBinder(&" |
| 447 | << binderName |
| 448 | << ");\n"; |
| 449 | |
| 450 | handleError(out, mode); |
| 451 | |
| 452 | out << name |
| 453 | << " = " |
Martijn Coenen | a63e0ad | 2016-12-07 17:29:00 +0100 | [diff] [blame] | 454 | << "::android::hardware::fromBinder<" |
| 455 | << fqName().cppName() |
| 456 | << "," |
Yifan Hong | 51a6509 | 2017-01-04 15:41:44 -0800 | [diff] [blame] | 457 | << getProxyFqName().cppName() |
Martijn Coenen | a63e0ad | 2016-12-07 17:29:00 +0100 | [diff] [blame] | 458 | << "," |
Yifan Hong | 51a6509 | 2017-01-04 15:41:44 -0800 | [diff] [blame] | 459 | << getStubFqName().cppName() |
Martijn Coenen | a63e0ad | 2016-12-07 17:29:00 +0100 | [diff] [blame] | 460 | << ">(" |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 461 | << binderName |
| 462 | << ");\n"; |
Andreas Huber | e7ff228 | 2016-08-16 13:50:03 -0700 | [diff] [blame] | 463 | |
| 464 | out.unindent(); |
| 465 | out << "}\n\n"; |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 466 | } else { |
Martijn Coenen | e163823 | 2016-10-26 12:51:34 +0200 | [diff] [blame] | 467 | out << "if (" << name << " == nullptr) {\n"; |
| 468 | out.indent(); |
| 469 | out << "_hidl_err = "; |
| 470 | out << parcelObjDeref |
| 471 | << "writeStrongBinder(nullptr);\n"; |
| 472 | out.unindent(); |
| 473 | out << "} else {\n"; |
| 474 | out.indent(); |
Yifan Hong | 158655a | 2016-11-08 12:34:07 -0800 | [diff] [blame] | 475 | out << "::android::sp<::android::hardware::IBinder> _hidl_binder = " |
| 476 | << "::android::hardware::toBinder<\n"; |
Yifan Hong | 33223ca | 2016-12-13 15:07:35 -0800 | [diff] [blame] | 477 | out.indent(2, [&] { |
Martijn Coenen | a63e0ad | 2016-12-07 17:29:00 +0100 | [diff] [blame] | 478 | out << fqName().cppName() |
Yifan Hong | 158655a | 2016-11-08 12:34:07 -0800 | [diff] [blame] | 479 | << ", " |
Yifan Hong | 51a6509 | 2017-01-04 15:41:44 -0800 | [diff] [blame] | 480 | << getProxyFqName().cppName() |
Yifan Hong | 158655a | 2016-11-08 12:34:07 -0800 | [diff] [blame] | 481 | << ">(" |
| 482 | << name |
| 483 | << ");\n"; |
| 484 | }); |
| 485 | out << "if (_hidl_binder.get() != nullptr) {\n"; |
Yifan Hong | 33223ca | 2016-12-13 15:07:35 -0800 | [diff] [blame] | 486 | out.indent([&] { |
Yifan Hong | 158655a | 2016-11-08 12:34:07 -0800 | [diff] [blame] | 487 | out << "_hidl_err = " |
| 488 | << parcelObjDeref |
| 489 | << "writeStrongBinder(_hidl_binder);\n"; |
| 490 | }); |
| 491 | out << "} else {\n"; |
Yifan Hong | 33223ca | 2016-12-13 15:07:35 -0800 | [diff] [blame] | 492 | out.indent([&] { |
Yifan Hong | 158655a | 2016-11-08 12:34:07 -0800 | [diff] [blame] | 493 | out << "_hidl_err = ::android::UNKNOWN_ERROR;\n"; |
| 494 | }); |
| 495 | out << "}\n"; |
Martijn Coenen | e163823 | 2016-10-26 12:51:34 +0200 | [diff] [blame] | 496 | out.unindent(); |
| 497 | out << "}\n"; |
Steven Moreland | 4078631 | 2016-08-16 10:29:40 -0700 | [diff] [blame] | 498 | |
Andreas Huber | 881227d | 2016-08-02 14:20:21 -0700 | [diff] [blame] | 499 | handleError(out, mode); |
| 500 | } |
| 501 | } |
| 502 | |
Yifan Hong | f5cc2f7 | 2017-01-04 18:02:34 -0800 | [diff] [blame^] | 503 | status_t Interface::emitGlobalTypeDeclarations(Formatter &out) const { |
| 504 | status_t status = Scope::emitGlobalTypeDeclarations(out); |
| 505 | if (status != OK) { |
| 506 | return status; |
| 507 | } |
| 508 | out << "std::string toString(" |
| 509 | << getCppArgumentType() |
| 510 | << ");\n"; |
| 511 | return OK; |
| 512 | } |
| 513 | |
| 514 | |
| 515 | status_t Interface::emitTypeDefinitions( |
| 516 | Formatter &out, const std::string prefix) const { |
| 517 | std::string space = prefix.empty() ? "" : (prefix + "::"); |
| 518 | status_t err = Scope::emitTypeDefinitions(out, space + localName()); |
| 519 | if (err != OK) { |
| 520 | return err; |
| 521 | } |
| 522 | |
| 523 | out << "std::string toString(" |
| 524 | << getCppArgumentType() |
| 525 | << " o) "; |
| 526 | |
| 527 | out.block([&] { |
| 528 | out << "std::string os;\nbool ok = false;\n"; |
| 529 | // TODO b/34136228 use interfaceDescriptor instead |
| 530 | out << "auto ret = o->interfaceChain([&os, &ok] (const auto &chain) "; |
| 531 | out.block([&] { |
| 532 | out.sIf("chain.size() >= 1", [&] { |
| 533 | out << "os += chain[0].c_str();\n" |
| 534 | << "ok = true;\n"; |
| 535 | }).endl(); |
| 536 | }); |
| 537 | out << ");\n"; |
| 538 | out.sIf("!ret.isOk() || !ok", [&] { |
| 539 | out << "os += \"[class or subclass of \";\n" |
| 540 | << "os += " << fullName() << "::descriptor;\n" |
| 541 | << "os += \"]\";\n"; |
| 542 | }).endl(); |
| 543 | out << "os += o->isRemote() ? \"@remote\" : \"@local\";\n" |
| 544 | << "return os;\n"; |
| 545 | }).endl().endl(); |
| 546 | |
| 547 | return OK; |
| 548 | } |
| 549 | |
Andreas Huber | 2831d51 | 2016-08-15 09:33:47 -0700 | [diff] [blame] | 550 | void Interface::emitJavaReaderWriter( |
| 551 | Formatter &out, |
| 552 | const std::string &parcelObj, |
| 553 | const std::string &argName, |
| 554 | bool isReader) const { |
| 555 | if (isReader) { |
| 556 | out << fullJavaName() |
| 557 | << ".asInterface(" |
| 558 | << parcelObj |
| 559 | << ".readStrongBinder());\n"; |
| 560 | } else { |
| 561 | out << parcelObj |
| 562 | << ".writeStrongBinder(" |
| 563 | << argName |
| 564 | << " == null ? null : " |
| 565 | << argName |
| 566 | << ".asBinder());\n"; |
| 567 | } |
| 568 | } |
| 569 | |
Zhuoyao Zhang | 864c771 | 2016-08-16 15:35:28 -0700 | [diff] [blame] | 570 | status_t Interface::emitVtsAttributeDeclaration(Formatter &out) const { |
| 571 | for (const auto &type : getSubTypes()) { |
Zhuoyao Zhang | c5ea9f5 | 2016-10-06 15:05:39 -0700 | [diff] [blame] | 572 | // Skip for TypeDef as it is just an alias of a defined type. |
| 573 | if (type->isTypeDef()) { |
| 574 | continue; |
| 575 | } |
Zhuoyao Zhang | 864c771 | 2016-08-16 15:35:28 -0700 | [diff] [blame] | 576 | out << "attribute: {\n"; |
| 577 | out.indent(); |
| 578 | status_t status = type->emitVtsTypeDeclarations(out); |
| 579 | if (status != OK) { |
| 580 | return status; |
| 581 | } |
| 582 | out.unindent(); |
| 583 | out << "}\n\n"; |
| 584 | } |
| 585 | return OK; |
| 586 | } |
| 587 | |
| 588 | status_t Interface::emitVtsMethodDeclaration(Formatter &out) const { |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 589 | for (const auto &method : methods()) { |
Steven Moreland | cea2478 | 2016-11-07 11:40:48 -0800 | [diff] [blame] | 590 | if (method->isHidlReserved()) { |
| 591 | continue; |
| 592 | } |
| 593 | |
Zhuoyao Zhang | 864c771 | 2016-08-16 15:35:28 -0700 | [diff] [blame] | 594 | out << "api: {\n"; |
| 595 | out.indent(); |
| 596 | out << "name: \"" << method->name() << "\"\n"; |
| 597 | // Generate declaration for each return value. |
| 598 | for (const auto &result : method->results()) { |
| 599 | out << "return_type_hidl: {\n"; |
| 600 | out.indent(); |
| 601 | status_t status = result->type().emitVtsAttributeType(out); |
| 602 | if (status != OK) { |
| 603 | return status; |
| 604 | } |
| 605 | out.unindent(); |
| 606 | out << "}\n"; |
| 607 | } |
| 608 | // Generate declaration for each input argument |
| 609 | for (const auto &arg : method->args()) { |
| 610 | out << "arg: {\n"; |
| 611 | out.indent(); |
| 612 | status_t status = arg->type().emitVtsAttributeType(out); |
| 613 | if (status != OK) { |
| 614 | return status; |
| 615 | } |
| 616 | out.unindent(); |
| 617 | out << "}\n"; |
| 618 | } |
| 619 | // Generate declaration for each annotation. |
Steven Moreland | d537ab0 | 2016-09-12 10:32:01 -0700 | [diff] [blame] | 620 | for (const auto &annotation : method->annotations()) { |
Zhuoyao Zhang | 864c771 | 2016-08-16 15:35:28 -0700 | [diff] [blame] | 621 | out << "callflow: {\n"; |
| 622 | out.indent(); |
Steven Moreland | d537ab0 | 2016-09-12 10:32:01 -0700 | [diff] [blame] | 623 | std::string name = annotation->name(); |
Zhuoyao Zhang | 864c771 | 2016-08-16 15:35:28 -0700 | [diff] [blame] | 624 | if (name == "entry") { |
| 625 | out << "entry: true\n"; |
| 626 | } else if (name == "exit") { |
| 627 | out << "exit: true\n"; |
| 628 | } else if (name == "callflow") { |
Steven Moreland | d537ab0 | 2016-09-12 10:32:01 -0700 | [diff] [blame] | 629 | const AnnotationParam *param = |
| 630 | annotation->getParam("next"); |
| 631 | if (param != nullptr) { |
| 632 | for (auto value : *param->getValues()) { |
| 633 | out << "next: " << value << "\n"; |
| 634 | } |
Zhuoyao Zhang | 864c771 | 2016-08-16 15:35:28 -0700 | [diff] [blame] | 635 | } |
| 636 | } else { |
| 637 | std::cerr << "Invalid annotation '" |
| 638 | << name << "' for method: " << method->name() |
| 639 | << ". Should be one of: entry, exit, callflow. \n"; |
| 640 | return UNKNOWN_ERROR; |
| 641 | } |
| 642 | out.unindent(); |
| 643 | out << "}\n"; |
| 644 | } |
| 645 | out.unindent(); |
| 646 | out << "}\n\n"; |
| 647 | } |
| 648 | return OK; |
| 649 | } |
| 650 | |
| 651 | status_t Interface::emitVtsAttributeType(Formatter &out) const { |
Zhuoyao Zhang | a588b23 | 2016-11-10 14:37:35 -0800 | [diff] [blame] | 652 | out << "type: " << getVtsType() << "\n" |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame] | 653 | << "predefined_type: \"" |
| 654 | << localName() |
Zhuoyao Zhang | 1993352 | 2016-08-29 15:06:38 -0700 | [diff] [blame] | 655 | << "\"\n" |
Zhuoyao Zhang | a588b23 | 2016-11-10 14:37:35 -0800 | [diff] [blame] | 656 | << "is_callback: " |
| 657 | << (StringHelper::EndsWith(localName(), "Callback") ? "true" : "false") |
| 658 | << "\n"; |
Zhuoyao Zhang | 5158db4 | 2016-08-10 10:25:20 -0700 | [diff] [blame] | 659 | return OK; |
| 660 | } |
| 661 | |
Steven Moreland | 69e7c70 | 2016-09-09 11:16:32 -0700 | [diff] [blame] | 662 | bool Interface::hasOnewayMethods() const { |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 663 | for (auto const &method : methods()) { |
Steven Moreland | 69e7c70 | 2016-09-09 11:16:32 -0700 | [diff] [blame] | 664 | if (method->isOneway()) { |
| 665 | return true; |
| 666 | } |
| 667 | } |
| 668 | |
| 669 | const Interface* superClass = superType(); |
| 670 | |
| 671 | if (superClass != nullptr) { |
| 672 | return superClass->hasOnewayMethods(); |
| 673 | } |
| 674 | |
| 675 | return false; |
| 676 | } |
| 677 | |
Andreas Huber | 70a59e1 | 2016-08-16 12:57:01 -0700 | [diff] [blame] | 678 | bool Interface::isJavaCompatible() const { |
Andreas Huber | ea081b3 | 2016-08-17 15:57:47 -0700 | [diff] [blame] | 679 | if (mIsJavaCompatibleInProgress) { |
| 680 | // We're currently trying to determine if this Interface is |
| 681 | // java-compatible and something is referencing this interface through |
| 682 | // one of its methods. Assume we'll ultimately succeed, if we were wrong |
| 683 | // the original invocation of Interface::isJavaCompatible() will then |
| 684 | // return the correct "false" result. |
| 685 | return true; |
| 686 | } |
| 687 | |
Andreas Huber | 0fa9e39 | 2016-08-31 09:05:44 -0700 | [diff] [blame] | 688 | if (mSuperType != nullptr && !mSuperType->isJavaCompatible()) { |
| 689 | mIsJavaCompatibleInProgress = false; |
| 690 | return false; |
| 691 | } |
| 692 | |
Andreas Huber | ea081b3 | 2016-08-17 15:57:47 -0700 | [diff] [blame] | 693 | mIsJavaCompatibleInProgress = true; |
| 694 | |
Andreas Huber | 70a59e1 | 2016-08-16 12:57:01 -0700 | [diff] [blame] | 695 | if (!Scope::isJavaCompatible()) { |
Andreas Huber | ea081b3 | 2016-08-17 15:57:47 -0700 | [diff] [blame] | 696 | mIsJavaCompatibleInProgress = false; |
Andreas Huber | 70a59e1 | 2016-08-16 12:57:01 -0700 | [diff] [blame] | 697 | return false; |
| 698 | } |
| 699 | |
Yifan Hong | 10fe0b5 | 2016-10-19 14:20:17 -0700 | [diff] [blame] | 700 | for (const auto &method : methods()) { |
Andreas Huber | 70a59e1 | 2016-08-16 12:57:01 -0700 | [diff] [blame] | 701 | if (!method->isJavaCompatible()) { |
Andreas Huber | ea081b3 | 2016-08-17 15:57:47 -0700 | [diff] [blame] | 702 | mIsJavaCompatibleInProgress = false; |
Andreas Huber | 70a59e1 | 2016-08-16 12:57:01 -0700 | [diff] [blame] | 703 | return false; |
| 704 | } |
| 705 | } |
| 706 | |
Andreas Huber | ea081b3 | 2016-08-17 15:57:47 -0700 | [diff] [blame] | 707 | mIsJavaCompatibleInProgress = false; |
| 708 | |
Andreas Huber | 70a59e1 | 2016-08-16 12:57:01 -0700 | [diff] [blame] | 709 | return true; |
| 710 | } |
| 711 | |
Andreas Huber | c9410c7 | 2016-07-28 12:18:40 -0700 | [diff] [blame] | 712 | } // namespace android |
| 713 | |