#include #include #include #include #include "VirtualTouchpadEvdev.h" #include "VirtualTouchpadService.h" int main() { ALOGI("Starting"); android::sp touchpad_service = new android::dvr::VirtualTouchpadService( android::dvr::VirtualTouchpadEvdev::Create()); signal(SIGPIPE, SIG_IGN); android::sp ps(android::ProcessState::self()); ps->setThreadPoolMaxThreadCount(4); ps->startThreadPool(); ps->giveThreadPoolName(); android::sp sm(android::defaultServiceManager()); const android::status_t service_status = sm->addService(android::String16(touchpad_service->SERVICE_NAME()), touchpad_service, false /*allowIsolated*/); if (service_status != android::OK) { ALOGE("virtual touchpad service not added: %d", static_cast(service_status)); exit(2); } android::IPCThreadState::self()->joinThreadPool(); return 0; }