Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 1 | #include "VirtualTouchpadService.h" |
| 2 | |
| 3 | #include <binder/Status.h> |
| 4 | #include <cutils/log.h> |
| 5 | #include <linux/input.h> |
| 6 | #include <utils/Errors.h> |
| 7 | |
| 8 | namespace android { |
| 9 | namespace dvr { |
| 10 | |
| 11 | int VirtualTouchpadService::Initialize() { |
| 12 | return touchpad_.Initialize(); |
| 13 | } |
| 14 | |
| 15 | binder::Status VirtualTouchpadService::touch(float x, float y, float pressure) { |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 16 | const int error = touchpad_.Touch(x, y, pressure); |
| 17 | return error ? binder::Status::fromServiceSpecificError(error) |
| 18 | : binder::Status::ok(); |
| 19 | } |
| 20 | |
Kevin Schoedel | 43b5b06 | 2017-01-19 13:46:17 -0500 | [diff] [blame^] | 21 | binder::Status VirtualTouchpadService::buttonState(int buttons) { |
| 22 | const int error = touchpad_.ButtonState(buttons); |
| 23 | return error ? binder::Status::fromServiceSpecificError(error) |
| 24 | : binder::Status::ok(); |
| 25 | } |
| 26 | |
Alex Vakulenko | e4eec20 | 2017-01-27 14:41:04 -0800 | [diff] [blame] | 27 | } // namespace dvr |
| 28 | } // namespace android |