blob: 5e3321fecffdd0a546c76bfe4674037cca5309d8 [file] [log] [blame]
Alex Vakulenkoe4eec202017-01-27 14:41:04 -08001#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
8namespace android {
9namespace dvr {
10
11int VirtualTouchpadService::Initialize() {
12 return touchpad_.Initialize();
13}
14
15binder::Status VirtualTouchpadService::touch(float x, float y, float pressure) {
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080016 const int error = touchpad_.Touch(x, y, pressure);
17 return error ? binder::Status::fromServiceSpecificError(error)
18 : binder::Status::ok();
19}
20
Kevin Schoedel43b5b062017-01-19 13:46:17 -050021binder::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 Vakulenkoe4eec202017-01-27 14:41:04 -080027} // namespace dvr
28} // namespace android