Martijn Coenen | 1b7297c | 2016-05-19 09:23:46 +0200 | [diff] [blame] | 1 | // Boilerplate code for the passthrough client to get a service |
| 2 | // proxy object. Not auto-generated, but probably cut-and-pasted. |
| 3 | |
| 4 | #include "MathImplementations.h" |
| 5 | #include <string> |
| 6 | |
| 7 | using android::hardware::MathImplementation; |
| 8 | |
| 9 | ptrdiff_t findServiceSingleton(std::string name) |
| 10 | { |
| 11 | (void)name; |
| 12 | static MathImplementation serviceSingleton; |
| 13 | // We don't need this anymore, since the handle we're returning is the object we're calling into |
| 14 | // registerService(name, serviceSingleton); |
| 15 | return (ptrdiff_t) &serviceSingleton; |
| 16 | } |
| 17 | extern "C" { |
| 18 | struct { |
| 19 | ptrdiff_t (*findService)(std::string name) = findServiceSingleton; |
| 20 | } hidlServiceFinderFunctionHolder; // This name is magic |
| 21 | } |