blob: 3fcb8fc743ff4e0bc1814e5cef0b086cee1be94b [file] [log] [blame]
Alex Vakulenkoe4eec202017-01-27 14:41:04 -08001#include "VirtualTouchpadService.h"
2
3#include <binder/Status.h>
Alex Vakulenkoe4eec202017-01-27 14:41:04 -08004#include <linux/input.h>
Alex Vakulenko4fe60582017-02-02 11:35:59 -08005#include <log/log.h>
Alex Vakulenkoe4eec202017-01-27 14:41:04 -08006#include <utils/Errors.h>
7
8namespace android {
9namespace dvr {
10
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080011binder::Status VirtualTouchpadService::touch(float x, float y, float pressure) {
Kevin Schoedel89af70b2017-03-03 18:11:37 -050012 const status_t error = touchpad_->Touch(x, y, pressure);
13 return error ? binder::Status::fromStatusT(error)
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080014 : binder::Status::ok();
15}
16
Kevin Schoedel43b5b062017-01-19 13:46:17 -050017binder::Status VirtualTouchpadService::buttonState(int buttons) {
Kevin Schoedel89af70b2017-03-03 18:11:37 -050018 const status_t error = touchpad_->ButtonState(buttons);
19 return error ? binder::Status::fromStatusT(error)
Kevin Schoedel43b5b062017-01-19 13:46:17 -050020 : binder::Status::ok();
21}
22
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080023} // namespace dvr
24} // namespace android