touch: Implement opt-in IHighTouchPollingRate interface

Change-Id: Ia0b45caa224cc9fea38f9b4efacce3287f888baa
This commit is contained in:
LuK1337
2022-04-11 20:28:02 +02:00
parent cf5e10f923
commit a39ee49e45
4 changed files with 103 additions and 0 deletions

View File

@@ -18,20 +18,28 @@
#include <android-base/logging.h>
#include <hidl/HidlTransportSupport.h>
#include "HighTouchPollingRate.h"
#include "TouchscreenGesture.h"
using android::sp;
using android::hardware::configureRpcThreadpool;
using android::hardware::joinRpcThreadpool;
using vendor::lineage::touch::V1_0::IHighTouchPollingRate;
using vendor::lineage::touch::V1_0::ITouchscreenGesture;
using vendor::lineage::touch::V1_0::implementation::HighTouchPollingRate;
using vendor::lineage::touch::V1_0::implementation::TouchscreenGesture;
int main() {
sp<IHighTouchPollingRate> highToushPollingRateService = new HighTouchPollingRate();
sp<ITouchscreenGesture> gestureService = new TouchscreenGesture();
configureRpcThreadpool(1, true /*callerWillJoin*/);
if (highToushPollingRateService->registerAsService() != android::OK) {
LOG(WARNING) << "Can't register HighTouchPollingRate HAL service";
}
if (gestureService->registerAsService() != android::OK) {
LOG(ERROR) << "Can't register TouchscreenGesture HAL service";
return 1;