diff --git a/resource-overlay/dubai/Frameworks/res/values/config.xml b/resource-overlay/dubai/Frameworks/res/values/config.xml
index 697cc19..2985bb9 100644
--- a/resource-overlay/dubai/Frameworks/res/values/config.xml
+++ b/resource-overlay/dubai/Frameworks/res/values/config.xml
@@ -279,6 +279,9 @@
org.lineageos.sensor.double_tap
+
+ org.lineageos.sensor.udfps
+
true
diff --git a/rootdir/etc/init/hw/init.mmi.overlay.rc b/rootdir/etc/init/hw/init.mmi.overlay.rc
index 1940172..623ffa8 100644
--- a/rootdir/etc/init/hw/init.mmi.overlay.rc
+++ b/rootdir/etc/init/hw/init.mmi.overlay.rc
@@ -31,6 +31,8 @@ on post-fs
# Sensors
chown system system /sys/devices/platform/soc/a94000.spi/spi_master/spi0/spi0.0/touchscreen/primary/double_tap_enabled
chown system system /sys/devices/platform/soc/a94000.spi/spi_master/spi0/spi0.0/touchscreen/primary/double_tap_pressed
+ chown system system /sys/devices/platform/soc/a94000.spi/spi_master/spi0/spi0.0/touchscreen/primary/udfps_enabled
+ chown system system /sys/devices/platform/soc/a94000.spi/spi_master/spi0/spi0.0/touchscreen/primary/udfps_pressed
on post-fs-data
mkdir /mnt/vendor/persist/tof 0755 vendor_tcmd camera
diff --git a/sensors/Sensor.h b/sensors/Sensor.h
index 1fed8fe..4bc0676 100644
--- a/sensors/Sensor.h
+++ b/sensors/Sensor.h
@@ -134,6 +134,18 @@ class DoubleTapSensor : public SysfsPollingOneShotSensor {
static_cast(static_cast(SensorType::DEVICE_PRIVATE_BASE) + 1)) {}
};
+const std::string kTsUdfpsPressedPath = kTsPath + "udfps_pressed";
+const std::string kTsUdfpsEnabledPath = kTsPath + "udfps_enabled";
+
+class UdfpsSensor : public SysfsPollingOneShotSensor {
+ public:
+ UdfpsSensor(int32_t sensorHandle, ISensorsEventCallback* callback)
+ : SysfsPollingOneShotSensor(
+ sensorHandle, callback, kTsUdfpsPressedPath, kTsUdfpsEnabledPath,
+ "UDFPS Sensor", "org.lineageos.sensor.udfps",
+ static_cast(static_cast(SensorType::DEVICE_PRIVATE_BASE) + 2)) {}
+};
+
} // namespace implementation
} // namespace subhal
} // namespace V2_1
diff --git a/sensors/SensorsSubHal.cpp b/sensors/SensorsSubHal.cpp
index 9281bfa..3c80bb7 100644
--- a/sensors/SensorsSubHal.cpp
+++ b/sensors/SensorsSubHal.cpp
@@ -34,6 +34,7 @@ using ::android::hardware::sensors::V2_0::implementation::ScopedWakelock;
SensorsSubHal::SensorsSubHal() : mCallback(nullptr), mNextHandle(1) {
AddSensor();
+ AddSensor();
}
Return SensorsSubHal::getSensorsList_2_1(ISensors::getSensorsList_2_1_cb _hidl_cb) {