dubai: sensors: Implement UDFPS sensor
Change-Id: I8b65e3196a7d6f158f4ff589b9755cf7c7e51c92
This commit is contained in:
parent
7216cf8505
commit
ec3f93036c
4 changed files with 18 additions and 0 deletions
|
@ -279,6 +279,9 @@
|
||||||
<!-- Type of the double tap sensor. Empty if double tap is not supported. -->
|
<!-- Type of the double tap sensor. Empty if double tap is not supported. -->
|
||||||
<string name="config_dozeDoubleTapSensorType" translatable="false">org.lineageos.sensor.double_tap</string>
|
<string name="config_dozeDoubleTapSensorType" translatable="false">org.lineageos.sensor.double_tap</string>
|
||||||
|
|
||||||
|
<!-- Type of the udfps long press sensor. Empty if long press is not supported. -->
|
||||||
|
<string name="config_dozeUdfpsLongPressSensorType" translatable="false">org.lineageos.sensor.udfps</string>
|
||||||
|
|
||||||
<!-- Whether the device enable the standalone (SA) mode of 5G NR.-->
|
<!-- Whether the device enable the standalone (SA) mode of 5G NR.-->
|
||||||
<bool name="config_telephony5gStandalone">true</bool>
|
<bool name="config_telephony5gStandalone">true</bool>
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ on post-fs
|
||||||
# Sensors
|
# 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_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/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
|
on post-fs-data
|
||||||
mkdir /mnt/vendor/persist/tof 0755 vendor_tcmd camera
|
mkdir /mnt/vendor/persist/tof 0755 vendor_tcmd camera
|
||||||
|
|
|
@ -134,6 +134,18 @@ class DoubleTapSensor : public SysfsPollingOneShotSensor {
|
||||||
static_cast<SensorType>(static_cast<int32_t>(SensorType::DEVICE_PRIVATE_BASE) + 1)) {}
|
static_cast<SensorType>(static_cast<int32_t>(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<SensorType>(static_cast<int32_t>(SensorType::DEVICE_PRIVATE_BASE) + 2)) {}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace implementation
|
} // namespace implementation
|
||||||
} // namespace subhal
|
} // namespace subhal
|
||||||
} // namespace V2_1
|
} // namespace V2_1
|
||||||
|
|
|
@ -34,6 +34,7 @@ using ::android::hardware::sensors::V2_0::implementation::ScopedWakelock;
|
||||||
|
|
||||||
SensorsSubHal::SensorsSubHal() : mCallback(nullptr), mNextHandle(1) {
|
SensorsSubHal::SensorsSubHal() : mCallback(nullptr), mNextHandle(1) {
|
||||||
AddSensor<DoubleTapSensor>();
|
AddSensor<DoubleTapSensor>();
|
||||||
|
AddSensor<UdfpsSensor>();
|
||||||
}
|
}
|
||||||
|
|
||||||
Return<void> SensorsSubHal::getSensorsList_2_1(ISensors::getSensorsList_2_1_cb _hidl_cb) {
|
Return<void> SensorsSubHal::getSensorsList_2_1(ISensors::getSensorsList_2_1_cb _hidl_cb) {
|
||||||
|
|
Loading…
Reference in a new issue