mirror of
https://github.com/Evolution-X-Devices/device_xiaomi_sm6150-common
synced 2026-01-27 12:07:36 +00:00
davinci: fod: Add support for Xiaomi's touchfeature
Change-Id: I15a4a3d777d784abe04e88372647fc9abff78626 Signed-off-by: Arian <arian.kulmer@web.de>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019 The LineageOS Project
|
||||
* Copyright (C) 2019-2020 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,9 +33,7 @@
|
||||
#define PARAM_NIT_FOD 1
|
||||
#define PARAM_NIT_NONE 0
|
||||
|
||||
#define FOD_STATUS_PATH "/sys/devices/virtual/touch/tp_dev/fod_status"
|
||||
#define FOD_STATUS_ON 1
|
||||
#define FOD_STATUS_OFF 0
|
||||
#define TOUCH_FOD_ENABLE 10
|
||||
|
||||
#define FOD_UI_PATH "/sys/devices/platform/soc/soc:qcom,dsi-display/fod_ui"
|
||||
|
||||
@@ -45,12 +43,6 @@
|
||||
|
||||
namespace {
|
||||
|
||||
template <typename T>
|
||||
static void set(const std::string& path, const T& value) {
|
||||
std::ofstream file(path);
|
||||
file << value;
|
||||
}
|
||||
|
||||
static bool readBool(int fd) {
|
||||
char c;
|
||||
int rc;
|
||||
@@ -81,6 +73,7 @@ namespace V1_0 {
|
||||
namespace implementation {
|
||||
|
||||
FingerprintInscreen::FingerprintInscreen() {
|
||||
touchFeatureService = ITouchFeature::getService();
|
||||
xiaomiFingerprintService = IXiaomiFingerprint::getService();
|
||||
|
||||
std::thread([this]() {
|
||||
@@ -138,12 +131,12 @@ Return<void> FingerprintInscreen::onRelease() {
|
||||
}
|
||||
|
||||
Return<void> FingerprintInscreen::onShowFODView() {
|
||||
set(FOD_STATUS_PATH, FOD_STATUS_ON);
|
||||
touchFeatureService->setTouchMode(TOUCH_FOD_ENABLE, 1);
|
||||
return Void();
|
||||
}
|
||||
|
||||
Return<void> FingerprintInscreen::onHideFODView() {
|
||||
set(FOD_STATUS_PATH, FOD_STATUS_OFF);
|
||||
touchFeatureService->resetTouchMode(TOUCH_FOD_ENABLE);
|
||||
return Void();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user