b1f26c0899
* This can be used by any Xiaomi device that has a touch display that supports multiple sample rates and Xiaomi touch. * Most newer Xiaomi phones with high screen refresh rates fit this category: * e.g. Mi 10/Pro/Ultra/T/T Pro, Xiaomi SM8350 platform phones & Xiaomi SM6375 phones Change-Id: Iaf956420157bbc978690fac9053d507ccaea847a
34 lines
917 B
C++
34 lines
917 B
C++
/*
|
|
* Copyright (C) 2022 The LineageOS Project
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#define LOG_TAG "lineage.touch@1.0-service.xiaomi"
|
|
|
|
#include <android-base/logging.h>
|
|
#include <hidl/HidlTransportSupport.h>
|
|
|
|
#include "HighTouchPollingRate.h"
|
|
|
|
using ::vendor::lineage::touch::V1_0::IHighTouchPollingRate;
|
|
using ::vendor::lineage::touch::V1_0::implementation::HighTouchPollingRate;
|
|
|
|
int main() {
|
|
android::sp<IHighTouchPollingRate> highTouchPollingRate = new HighTouchPollingRate();
|
|
|
|
android::hardware::configureRpcThreadpool(1, true);
|
|
|
|
if (highTouchPollingRate->registerAsService() != android::OK) {
|
|
LOG(ERROR) << "Cannot register touchscreen high polling rate HAL service.";
|
|
return 1;
|
|
}
|
|
|
|
LOG(INFO) << "Touchscreen HAL service ready.";
|
|
|
|
android::hardware::joinRpcThreadpool();
|
|
|
|
LOG(ERROR) << "Touchscreen HAL service failed to join thread pool.";
|
|
return 1;
|
|
}
|