From 047453e7cba02481ba7d829504b169e9eb88eaf7 Mon Sep 17 00:00:00 2001 From: A2L5E0X1 Date: Tue, 5 Apr 2022 18:28:47 +0000 Subject: [PATCH] hidl: sensors: add hover proximity sensor support * used by Exynos 850 devices * requires a kernel patch in touchscreen driver to invert reported proximity values, see https://github.com/exynos850-dev/android_kernel_samsung_exynos850/commit/d7ab9befc31ae0e5f7b1a82eddd0c8f8a2d11b20 Change-Id: I3d5d7de2f6ef7877490fa36968a4c07e0ac1e40e --- hidl/sensors/2.1/HalProxy.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hidl/sensors/2.1/HalProxy.cpp b/hidl/sensors/2.1/HalProxy.cpp index 30c7d764..18af6197 100644 --- a/hidl/sensors/2.1/HalProxy.cpp +++ b/hidl/sensors/2.1/HalProxy.cpp @@ -123,8 +123,9 @@ Return HalProxy::getSensorsList_2_1(ISensorsV2_1::getSensorsList_2_1_cb _h dst.requiredPermission = ""; } - if (dst.typeAsString == "com.samsung.sensor.physical_proximity") { - ALOGI("Fixing com.samsung.sensor.physical_proximity"); + if (dst.typeAsString == "com.samsung.sensor.physical_proximity" || + dst.typeAsString == "com.samsung.sensor.hover_proximity") { + ALOGI("Fixing %s", dst.typeAsString.c_str()); dst.type = V2_1::SensorType::PROXIMITY; dst.typeAsString = SENSOR_STRING_TYPE_PROXIMITY; dst.maxRange = 1;