blob: 68f1d70d8444e8f4a4fa8780bef42c4b9eb700f2 [file] [log] [blame]
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
#include <log/log.h>
#include "VirtualTouchpadEvdev.h"
#include "VirtualTouchpadService.h"
int main() {
ALOGI("Starting");
android::dvr::VirtualTouchpadService touchpad_service(
std::move(android::dvr::VirtualTouchpadEvdev::Create()));
signal(SIGPIPE, SIG_IGN);
android::sp<android::ProcessState> ps(android::ProcessState::self());
ps->setThreadPoolMaxThreadCount(4);
ps->startThreadPool();
ps->giveThreadPoolName();
android::sp<android::IServiceManager> 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<int>(service_status));
exit(2);
}
android::IPCThreadState::self()->joinThreadPool();
return 0;
}