blob: c11d680f344613e23101f7ffe7fa961f7c46db81 [file] [log] [blame]
Martijn Coenen72110162016-08-19 14:28:25 +02001/*
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
17#ifndef ANDROID_HIDL_SUPPORT_H
18#define ANDROID_HIDL_SUPPORT_H
19
Iliyan Malchev692070a2016-09-12 16:30:44 -070020#include <algorithm>
Zhuoyao Zhang7e1286c2016-09-12 17:28:48 -070021#include <dirent.h>
Steven Morelandbdf26662016-09-02 11:03:15 -070022#include <dlfcn.h>
Zhuoyao Zhang28e03af2016-10-21 11:25:49 -070023#include <cutils/properties.h>
Yifan Hong1e265bb2016-11-08 12:33:44 -080024#include <functional>
Yifan Honga3c31842016-10-21 10:33:14 -070025#include <hidl/Status.h>
Yifan Hong1e265bb2016-11-08 12:33:44 -080026#include <map>
Andreas Huber00a985c2016-09-28 14:24:53 -070027#include <tuple>
Iliyan Malchev692070a2016-09-12 16:30:44 -070028#include <utils/Errors.h>
29#include <utils/RefBase.h>
30#include <utils/StrongPointer.h>
Yifan Hong7f97f442016-11-14 18:31:05 -080031#include <vector>
Martijn Coenen72110162016-08-19 14:28:25 +020032
33namespace android {
34namespace hardware {
35
Martijn Coenen4ca39a02016-11-11 15:58:51 +010036namespace details {
37
38// hidl_log_base is a base class that templatized
39// classes implemented in a header can inherit from,
40// to avoid creating dependencies on liblog.
41struct hidl_log_base {
42 void logAlwaysFatal(const char *message);
43};
44
45// HIDL client/server code should *NOT* use this class.
46//
47// hidl_pointer wraps a pointer without taking ownership,
48// and stores it in a union with a uint64_t. This ensures
49// that we always have enough space to store a pointer,
50// regardless of whether we're running in a 32-bit or 64-bit
51// process.
52template<typename T>
53struct hidl_pointer {
54 hidl_pointer()
55 : mPointer(nullptr) {
56 }
57 hidl_pointer(T* ptr)
58 : mPointer(ptr) {
59 }
60 hidl_pointer(const hidl_pointer<T>& other) {
61 mPointer = other.mPointer;
62 }
63 hidl_pointer(hidl_pointer<T>&& other) {
64 *this = std::move(other);
65 }
66
67 hidl_pointer &operator=(const hidl_pointer<T>& other) {
68 mPointer = other.mPointer;
69 return *this;
70 }
71 hidl_pointer &operator=(hidl_pointer<T>&& other) {
72 mPointer = other.mPointer;
73 other.mPointer = nullptr;
74 return *this;
75 }
76 hidl_pointer &operator=(T* ptr) {
77 mPointer = ptr;
78 return *this;
79 }
80
81 operator T*() const {
82 return mPointer;
83 }
84 explicit operator void*() const { // requires explicit cast to avoid ambiguity
85 return mPointer;
86 }
87 T& operator*() const {
88 return *mPointer;
89 }
90 T* operator->() const {
91 return mPointer;
92 }
93 T &operator[](size_t index) {
94 return mPointer[index];
95 }
96 const T &operator[](size_t index) const {
97 return mPointer[index];
98 }
99private:
100 union {
101 T* mPointer;
102 uint64_t _pad;
103 };
104};
105} // namespace details
106
Martijn Coenen72110162016-08-19 14:28:25 +0200107struct hidl_string {
108 hidl_string();
109 ~hidl_string();
110
Yifan Hong602b85a2016-10-24 13:40:01 -0700111 // copy constructor.
Martijn Coenen72110162016-08-19 14:28:25 +0200112 hidl_string(const hidl_string &);
Yifan Hong602b85a2016-10-24 13:40:01 -0700113 // copy from a C-style string.
Steven Morelande03c0872016-10-24 10:43:50 -0700114 hidl_string(const char *);
Yifan Hong602b85a2016-10-24 13:40:01 -0700115 // copy from an std::string.
116 hidl_string(const std::string &);
117
118 // move constructor.
119 hidl_string(hidl_string &&);
Martijn Coenen72110162016-08-19 14:28:25 +0200120
121 const char *c_str() const;
122 size_t size() const;
123 bool empty() const;
124
Yifan Hong602b85a2016-10-24 13:40:01 -0700125 // copy assignment operator.
Steven Morelande03c0872016-10-24 10:43:50 -0700126 hidl_string &operator=(const hidl_string &);
Yifan Hong602b85a2016-10-24 13:40:01 -0700127 // copy from a C-style string.
Martijn Coenen72110162016-08-19 14:28:25 +0200128 hidl_string &operator=(const char *s);
Yifan Hong602b85a2016-10-24 13:40:01 -0700129 // copy from an std::string.
130 hidl_string &operator=(const std::string &);
131 // move assignment operator.
132 hidl_string &operator=(hidl_string &&other);
133 // cast to std::string.
134 operator std::string() const;
135 // cast to C-style string. Caller is responsible
136 // to maintain this hidl_string alive.
137 operator const char *() const;
Steven Morelande03c0872016-10-24 10:43:50 -0700138
Martijn Coenen72110162016-08-19 14:28:25 +0200139 void clear();
140
141 // Reference an external char array. Ownership is _not_ transferred.
142 // Caller is responsible for ensuring that underlying memory is valid
143 // for the lifetime of this hidl_string.
144 void setToExternal(const char *data, size_t size);
145
Andreas Huberebfeb362016-08-25 13:39:05 -0700146 // offsetof(hidl_string, mBuffer) exposed since mBuffer is private.
147 static const size_t kOffsetOfBuffer;
148
Martijn Coenen72110162016-08-19 14:28:25 +0200149private:
Martijn Coenen4ca39a02016-11-11 15:58:51 +0100150 details::hidl_pointer<const char> mBuffer;
151 uint32_t mSize; // NOT including the terminating '\0'.
Yifan Hong602b85a2016-10-24 13:40:01 -0700152 bool mOwnsBuffer; // if true then mBuffer is a mutable char *
Martijn Coenen72110162016-08-19 14:28:25 +0200153
Yifan Hong602b85a2016-10-24 13:40:01 -0700154 // copy from data with size. Assume that my memory is freed
155 // (through clear(), for example)
156 void copyFrom(const char *data, size_t size);
157 // move from another hidl_string
158 void moveFrom(hidl_string &&);
Martijn Coenen72110162016-08-19 14:28:25 +0200159};
160
Yifan Hong5708fb42016-10-26 17:50:29 -0700161inline bool operator==(const hidl_string &hs, const char *s) {
162 return strcmp(hs.c_str(), s) == 0;
163}
164
165inline bool operator!=(const hidl_string &hs, const char *s) {
166 return !(hs == s);
167}
168
169inline bool operator==(const char *s, const hidl_string &hs) {
170 return strcmp(hs.c_str(), s) == 0;
171}
172
173inline bool operator!=(const char *s, const hidl_string &hs) {
174 return !(s == hs);
175}
176
Andreas Huber20dce082016-09-22 19:39:13 -0700177////////////////////////////////////////////////////////////////////////////////
178
Martijn Coenen72110162016-08-19 14:28:25 +0200179template<typename T>
Martijn Coenen4ca39a02016-11-11 15:58:51 +0100180struct hidl_vec : private details::hidl_log_base {
Martijn Coenen72110162016-08-19 14:28:25 +0200181 hidl_vec()
182 : mBuffer(NULL),
183 mSize(0),
184 mOwnsBuffer(true) {
185 }
186
Yifan Hong602b85a2016-10-24 13:40:01 -0700187 hidl_vec(const hidl_vec<T> &other) : hidl_vec() {
Martijn Coenen72110162016-08-19 14:28:25 +0200188 *this = other;
189 }
190
Janis Danisevskisd3ddf622016-10-24 11:40:50 +0100191 hidl_vec(hidl_vec<T> &&other)
Steven Moreland9fbfe472016-11-14 16:49:17 -0800192 : mOwnsBuffer(false) {
Janis Danisevskisd3ddf622016-10-24 11:40:50 +0100193 *this = std::move(other);
Alexey Polyudov0ebdbe82016-10-18 09:31:46 -0700194 }
195
Steven Morelandb69926a2016-11-15 10:02:57 -0800196 hidl_vec(const std::initializer_list<T> list)
Steven Moreland9fbfe472016-11-14 16:49:17 -0800197 : mSize(list.size()),
198 mOwnsBuffer(true) {
199 mBuffer = new T[mSize];
200
Steven Morelandb69926a2016-11-15 10:02:57 -0800201 size_t idx = 0;
Steven Moreland9fbfe472016-11-14 16:49:17 -0800202 for (auto it = list.begin(); it != list.end(); ++it) {
203 mBuffer[idx++] = *it;
204 }
205 }
206
Yifan Hong602b85a2016-10-24 13:40:01 -0700207 hidl_vec(const std::vector<T> &other) : hidl_vec() {
208 *this = other;
209 }
210
Martijn Coenen72110162016-08-19 14:28:25 +0200211 ~hidl_vec() {
212 if (mOwnsBuffer) {
213 delete[] mBuffer;
214 }
215 mBuffer = NULL;
216 }
217
Alexey Polyudove2299012016-10-19 09:52:00 -0700218 // Reference an existing array, optionally taking ownership. It is the
Martijn Coenen72110162016-08-19 14:28:25 +0200219 // caller's responsibility to ensure that the underlying memory stays
220 // valid for the lifetime of this hidl_vec.
Alexey Polyudove2299012016-10-19 09:52:00 -0700221 void setToExternal(T *data, size_t size, bool shouldOwn = false) {
Martijn Coenen72110162016-08-19 14:28:25 +0200222 if (mOwnsBuffer) {
223 delete [] mBuffer;
224 }
225 mBuffer = data;
Martijn Coenen4ca39a02016-11-11 15:58:51 +0100226 if (size > UINT32_MAX) {
227 logAlwaysFatal("external vector size exceeds 2^32 elements.");
228 }
229 mSize = static_cast<uint32_t>(size);
Alexey Polyudove2299012016-10-19 09:52:00 -0700230 mOwnsBuffer = shouldOwn;
Martijn Coenen72110162016-08-19 14:28:25 +0200231 }
232
Alexey Polyudov6f0c9a12016-10-18 09:37:35 -0700233 T *data() {
234 return mBuffer;
235 }
236
237 const T *data() const {
238 return mBuffer;
239 }
240
Alexey Polyudovc98a99c2016-10-18 09:43:56 -0700241 T *releaseData() {
242 if (!mOwnsBuffer && mSize > 0) {
243 resize(mSize);
244 }
245 mOwnsBuffer = false;
246 return mBuffer;
247 }
248
Alexey Polyudov0ebdbe82016-10-18 09:31:46 -0700249 hidl_vec &operator=(hidl_vec &&other) {
Janis Danisevskisd3ddf622016-10-24 11:40:50 +0100250 if (mOwnsBuffer) {
251 delete[] mBuffer;
252 }
Alexey Polyudov0ebdbe82016-10-18 09:31:46 -0700253 mBuffer = other.mBuffer;
254 mSize = other.mSize;
255 mOwnsBuffer = other.mOwnsBuffer;
256 other.mOwnsBuffer = false;
257 return *this;
258 }
259
Martijn Coenen72110162016-08-19 14:28:25 +0200260 hidl_vec &operator=(const hidl_vec &other) {
261 if (this != &other) {
262 if (mOwnsBuffer) {
263 delete[] mBuffer;
264 }
Yifan Hong602b85a2016-10-24 13:40:01 -0700265 copyFrom(other, other.mSize);
Martijn Coenen72110162016-08-19 14:28:25 +0200266 }
267
268 return *this;
269 }
270
Yifan Hong602b85a2016-10-24 13:40:01 -0700271 // copy from an std::vector.
272 hidl_vec &operator=(const std::vector<T> &other) {
273 if (mOwnsBuffer) {
274 delete[] mBuffer;
275 }
276 copyFrom(other, other.size());
277 return *this;
278 }
279
280 // cast to an std::vector.
281 operator std::vector<T>() const {
282 std::vector<T> v(mSize);
283 for (size_t i = 0; i < mSize; ++i) {
284 v[i] = mBuffer[i];
285 }
286 return v;
287 }
288
Martijn Coenen72110162016-08-19 14:28:25 +0200289 size_t size() const {
290 return mSize;
291 }
292
293 T &operator[](size_t index) {
294 return mBuffer[index];
295 }
296
297 const T &operator[](size_t index) const {
298 return mBuffer[index];
299 }
300
301 void resize(size_t size) {
Martijn Coenen4ca39a02016-11-11 15:58:51 +0100302 if (size > UINT32_MAX) {
303 logAlwaysFatal("hidl_vec can't hold more than 2^32 elements.");
304 }
Martijn Coenen72110162016-08-19 14:28:25 +0200305 T *newBuffer = new T[size];
306
Martijn Coenen4ca39a02016-11-11 15:58:51 +0100307 for (size_t i = 0; i < std::min(static_cast<uint32_t>(size), mSize); ++i) {
Martijn Coenen72110162016-08-19 14:28:25 +0200308 newBuffer[i] = mBuffer[i];
309 }
310
311 if (mOwnsBuffer) {
312 delete[] mBuffer;
313 }
314 mBuffer = newBuffer;
315
Martijn Coenen4ca39a02016-11-11 15:58:51 +0100316 mSize = static_cast<uint32_t>(size);
Martijn Coenen72110162016-08-19 14:28:25 +0200317 mOwnsBuffer = true;
318 }
319
Yifan Hong089ae132016-11-11 11:32:52 -0800320 // offsetof(hidl_string, mBuffer) exposed since mBuffer is private.
321 static const size_t kOffsetOfBuffer;
Martijn Coenen72110162016-08-19 14:28:25 +0200322private:
Martijn Coenen4ca39a02016-11-11 15:58:51 +0100323 details::hidl_pointer<T> mBuffer;
324 uint32_t mSize;
Martijn Coenen72110162016-08-19 14:28:25 +0200325 bool mOwnsBuffer;
Yifan Hong602b85a2016-10-24 13:40:01 -0700326
327 // copy from an array-like object, assuming my resources are freed.
328 template <typename Array>
329 void copyFrom(const Array &data, size_t size) {
330 mSize = size;
331 mOwnsBuffer = true;
332 if (mSize > 0) {
333 mBuffer = new T[size];
334 for (size_t i = 0; i < size; ++i) {
335 mBuffer[i] = data[i];
336 }
337 } else {
338 mBuffer = NULL;
339 }
340 }
Martijn Coenen72110162016-08-19 14:28:25 +0200341};
342
Yifan Hong089ae132016-11-11 11:32:52 -0800343template <typename T>
344const size_t hidl_vec<T>::kOffsetOfBuffer = offsetof(hidl_vec<T>, mBuffer);
345
Andreas Huber20dce082016-09-22 19:39:13 -0700346////////////////////////////////////////////////////////////////////////////////
347
348namespace details {
349
350 template<size_t SIZE1, size_t... SIZES>
351 struct product {
352 static constexpr size_t value = SIZE1 * product<SIZES...>::value;
353 };
354
355 template<size_t SIZE1>
356 struct product<SIZE1> {
357 static constexpr size_t value = SIZE1;
358 };
359
360 template<typename T, size_t SIZE1, size_t... SIZES>
361 struct accessor {
362 explicit accessor(T *base)
363 : mBase(base) {
364 }
365
366 accessor<T, SIZES...> operator[](size_t index) {
367 return accessor<T, SIZES...>(
368 &mBase[index * product<SIZES...>::value]);
369 }
370
371 private:
372 T *mBase;
373 };
374
375 template<typename T, size_t SIZE1>
376 struct accessor<T, SIZE1> {
377 explicit accessor(T *base)
378 : mBase(base) {
379 }
380
381 T &operator[](size_t index) {
382 return mBase[index];
383 }
384
385 private:
386 T *mBase;
387 };
388
389 template<typename T, size_t SIZE1, size_t... SIZES>
390 struct const_accessor {
391 explicit const_accessor(const T *base)
392 : mBase(base) {
393 }
394
395 const_accessor<T, SIZES...> operator[](size_t index) {
396 return const_accessor<T, SIZES...>(
397 &mBase[index * product<SIZES...>::value]);
398 }
399
400 private:
401 const T *mBase;
402 };
403
404 template<typename T, size_t SIZE1>
405 struct const_accessor<T, SIZE1> {
406 explicit const_accessor(const T *base)
407 : mBase(base) {
408 }
409
410 const T &operator[](size_t index) const {
411 return mBase[index];
412 }
413
414 private:
415 const T *mBase;
416 };
417
418} // namespace details
419
420////////////////////////////////////////////////////////////////////////////////
421
422template<typename T, size_t SIZE1, size_t... SIZES>
423struct hidl_array {
424 hidl_array() = default;
425
426 T *data() { return mBuffer; }
427 const T *data() const { return mBuffer; }
428
429 details::accessor<T, SIZES...> operator[](size_t index) {
430 return details::accessor<T, SIZES...>(
431 &mBuffer[index * details::product<SIZES...>::value]);
432 }
433
434 details::const_accessor<T, SIZES...> operator[](size_t index) const {
435 return details::const_accessor<T, SIZES...>(
436 &mBuffer[index * details::product<SIZES...>::value]);
437 }
438
Andreas Huber00a985c2016-09-28 14:24:53 -0700439 using size_tuple_type = std::tuple<decltype(SIZE1), decltype(SIZES)...>;
440
441 static constexpr size_tuple_type size() {
442 return std::make_tuple(SIZE1, SIZES...);
443 }
444
Andreas Huber20dce082016-09-22 19:39:13 -0700445private:
446 T mBuffer[details::product<SIZE1, SIZES...>::value];
447};
448
449template<typename T, size_t SIZE1>
450struct hidl_array<T, SIZE1> {
451 hidl_array() = default;
452
453 T *data() { return mBuffer; }
454 const T *data() const { return mBuffer; }
455
456 T &operator[](size_t index) {
457 return mBuffer[index];
458 }
459
460 const T &operator[](size_t index) const {
461 return mBuffer[index];
462 }
463
Andreas Huber00a985c2016-09-28 14:24:53 -0700464 static constexpr size_t size() { return SIZE1; }
465
Andreas Huber20dce082016-09-22 19:39:13 -0700466private:
467 T mBuffer[SIZE1];
468};
469
Martijn Coenen72110162016-08-19 14:28:25 +0200470// ----------------------------------------------------------------------
471// Version functions
472struct hidl_version {
473public:
Chia-I Wu666b76b2016-10-06 14:15:59 +0800474 constexpr hidl_version(uint16_t major, uint16_t minor) : mMajor(major), mMinor(minor) {}
Martijn Coenen72110162016-08-19 14:28:25 +0200475
Steven Moreland5d5ef7f2016-10-20 19:19:55 -0700476 bool operator==(const hidl_version& other) const {
Martijn Coenen72110162016-08-19 14:28:25 +0200477 return (mMajor == other.get_major() && mMinor == other.get_minor());
478 }
Martijn Coenenc28f1152016-08-22 14:06:56 +0200479
Martijn Coenen097a7672016-09-08 16:56:41 +0200480 constexpr uint16_t get_major() const { return mMajor; }
481 constexpr uint16_t get_minor() const { return mMinor; }
Martijn Coenen72110162016-08-19 14:28:25 +0200482
Martijn Coenen72110162016-08-19 14:28:25 +0200483private:
484 uint16_t mMajor;
485 uint16_t mMinor;
486};
487
488inline android::hardware::hidl_version make_hidl_version(uint16_t major, uint16_t minor) {
489 return hidl_version(major,minor);
490}
491
Yifan Hongc1a60ef2016-11-08 18:53:16 -0800492struct IBase : virtual public RefBase {
Yifan Honga3c31842016-10-21 10:33:14 -0700493 virtual bool isRemote() const = 0;
494 // HIDL reserved methods follow.
495 virtual ::android::hardware::Return<void> interfaceChain(
496 std::function<void(const hidl_vec<hidl_string>&)> _hidl_cb) = 0;
497 // descriptor for HIDL reserved methods.
Steven Moreland5a682322016-11-11 12:32:50 -0800498 static const char* descriptor;
Yifan Honga3c31842016-10-21 10:33:14 -0700499};
500
Steven Morelandbdf26662016-09-02 11:03:15 -0700501#if defined(__LP64__)
502#define HAL_LIBRARY_PATH_SYSTEM "/system/lib64/hw/"
503#define HAL_LIBRARY_PATH_VENDOR "/vendor/lib64/hw/"
504#define HAL_LIBRARY_PATH_ODM "/odm/lib64/hw/"
505#else
506#define HAL_LIBRARY_PATH_SYSTEM "/system/lib/hw/"
507#define HAL_LIBRARY_PATH_VENDOR "/vendor/lib/hw/"
508#define HAL_LIBRARY_PATH_ODM "/odm/lib/hw/"
509#endif
510
Steven Moreland40ede2c2016-11-09 13:51:53 -0800511#define DECLARE_SERVICE_MANAGER_INTERACTIONS(INTERFACE) \
Martijn Coenenc28f1152016-08-22 14:06:56 +0200512 static ::android::sp<I##INTERFACE> getService( \
Iliyan Malchevb42ce262016-09-26 00:09:35 -0700513 const std::string &serviceName, bool getStub=false); \
Steven Moreland40ede2c2016-11-09 13:51:53 -0800514 ::android::status_t registerAsService(const std::string &serviceName); \
515 static bool registerForNotifications( \
516 const std::string &serviceName, \
517 const ::android::sp<::android::hidl::manager::V1_0::IServiceNotification> \
518 &notification); \
Martijn Coenenc28f1152016-08-22 14:06:56 +0200519
Zhuoyao Zhang7e1286c2016-09-12 17:28:48 -0700520// ----------------------------------------------------------------------
Zhuoyao Zhang28e03af2016-10-21 11:25:49 -0700521// Class that provides Hidl instrumentation utilities.
522struct HidlInstrumentor {
523 // Event that triggers the instrumentation. e.g. enter of an API call on
524 // the server/client side, exit of an API call on the server/client side
525 // etc.
526 enum InstrumentationEvent {
527 SERVER_API_ENTRY = 0,
528 SERVER_API_EXIT,
529 CLIENT_API_ENTRY,
530 CLIENT_API_EXIT,
531 SYNC_CALLBACK_ENTRY,
532 SYNC_CALLBACK_EXIT,
533 ASYNC_CALLBACK_ENTRY,
534 ASYNC_CALLBACK_EXIT,
Steven Morelandcefbd6e2016-11-01 10:14:30 -0700535 PASSTHROUGH_ENTRY,
536 PASSTHROUGH_EXIT,
Zhuoyao Zhang28e03af2016-10-21 11:25:49 -0700537 };
Zhuoyao Zhang7e1286c2016-09-12 17:28:48 -0700538
Zhuoyao Zhang28e03af2016-10-21 11:25:49 -0700539 // Signature of the instrumentation callback function.
540 using InstrumentationCallback = std::function<void(
541 const InstrumentationEvent event,
542 const char *package,
543 const char *version,
544 const char *interface,
545 const char *method,
546 std::vector<void *> *args)>;
547
548 explicit HidlInstrumentor(const std::string &prefix);
549 virtual ~HidlInstrumentor();
550
551 protected:
552 // Function that lookup and dynamically loads the hidl instrumentation
553 // libraries and registers the instrumentation callback functions.
554 //
555 // The instrumentation libraries should be stored under any of the following
556 // directories: HAL_LIBRARY_PATH_SYSTEM, HAL_LIBRARY_PATH_VENDOR and
557 // HAL_LIBRARY_PATH_ODM. The name of instrumentation libraries should
558 // follow pattern: ^profilerPrefix(.*).profiler.so$
559 //
560 // Each instrumentation library is expected to implement the instrumentation
561 // function called HIDL_INSTRUMENTATION_FUNCTION.
562 //
563 // A no-op for user build.
564 void registerInstrumentationCallbacks(
565 const std::string &profilerPrefix,
566 std::vector<InstrumentationCallback> *instrumentationCallbacks);
567
568 // Utility function to determine whether a give file is a instrumentation
569 // library (i.e. the file name follow the expected pattern).
570 bool isInstrumentationLib(
571 const std::string &profilerPrefix,
572 const dirent *file);
573 // A list of registered instrumentation callbacks.
574 std::vector<InstrumentationCallback> mInstrumentationCallbacks;
575 // Flag whether to enable instrumentation.
576 bool mEnableInstrumentation;
Zhuoyao Zhang7e1286c2016-09-12 17:28:48 -0700577};
578
Martijn Coenen72110162016-08-19 14:28:25 +0200579} // namespace hardware
580} // namespace android
581
Martijn Coenenc28f1152016-08-22 14:06:56 +0200582
Martijn Coenen72110162016-08-19 14:28:25 +0200583#endif // ANDROID_HIDL_SUPPORT_H
584