Provide a library interface to the virtual touchpad service.
And make VrWindowManager pay for^H^H^H^H^H^H^H^H use it. The library
interface is a step toward moving 2D embedding into VrCore because it
hides the binder connection that isn't directly accessible to VrCore.
As a matter of implementation, the touchpad-service client library
and the low-level evdev touchpad are derived from the same interface.
Bug: b/35990873
Test: VirtualTouchpad_test; integration TBD.
Change-Id: Ic922ff223ddd5a44f6fb4433a271f8341e93a0e7
diff --git a/services/vr/virtual_touchpad/main.cpp b/services/vr/virtual_touchpad/main.cpp
index 1debe9f..e73f8b9 100644
--- a/services/vr/virtual_touchpad/main.cpp
+++ b/services/vr/virtual_touchpad/main.cpp
@@ -3,17 +3,13 @@
#include <binder/ProcessState.h>
#include <log/log.h>
+#include "VirtualTouchpadEvdev.h"
#include "VirtualTouchpadService.h"
int main() {
ALOGI("Starting");
- android::dvr::VirtualTouchpad touchpad;
- android::dvr::VirtualTouchpadService touchpad_service(touchpad);
- const int touchpad_status = touchpad_service.Initialize();
- if (touchpad_status) {
- ALOGE("virtual touchpad initialization failed: %d", touchpad_status);
- exit(1);
- }
+ android::dvr::VirtualTouchpadService touchpad_service(
+ android::dvr::VirtualTouchpadEvdev::Create());
signal(SIGPIPE, SIG_IGN);
android::sp<android::ProcessState> ps(android::ProcessState::self());
@@ -23,7 +19,7 @@
android::sp<android::IServiceManager> sm(android::defaultServiceManager());
const android::status_t service_status =
- sm->addService(android::String16(touchpad_service.getServiceName()),
+ sm->addService(android::String16(touchpad_service.SERVICE_NAME()),
&touchpad_service, false /*allowIsolated*/);
if (service_status != android::OK) {
ALOGE("virtual touchpad service not added: %d",