diff options
author | Willi Ye <williye97@gmail.com> | 2019-09-08 18:23:04 +0200 |
---|---|---|
committer | Jesse Chan <jc@lineageos.org> | 2020-05-15 22:15:57 +0800 |
commit | 80c90e970e7f57c91feee265517df878f7c3ddbb (patch) | |
tree | 3b144e4438cbdb90c80a0526631ab533f402fdf8 | |
parent | 834dfaa39b4b6e7cd3e3ae03a567235e6c4db976 (diff) | |
download | android_hardware_samsung-80c90e970e7f57c91feee265517df878f7c3ddbb.tar.gz android_hardware_samsung-80c90e970e7f57c91feee265517df878f7c3ddbb.tar.bz2 android_hardware_samsung-80c90e970e7f57c91feee265517df878f7c3ddbb.zip |
sensors: map Samsung proximity sensor type to generic
Samsung uses their own com.samsung.sensor.physical_proximity
type instead of SENSOR_TYPE_PROXIMITY of Android.
This makes proximity sensor unavailable for us as we only
look for SENSOR_TYPE_PROXIMITY.
Thus, this change maps Samsung's vendor-specific proximity
sensor type to generic one.
Change-Id: I64f6558876e1398dfbea0e5c0eb76aa1aafd2dfd
Signed-off-by: Jesse Chan <jc@lineageos.org>
-rw-r--r-- | hidl/sensors/Sensors.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hidl/sensors/Sensors.cpp b/hidl/sensors/Sensors.cpp index a242e37..a1cd153 100644 --- a/hidl/sensors/Sensors.cpp +++ b/hidl/sensors/Sensors.cpp @@ -129,6 +129,12 @@ Return<void> Sensors::getSensorsList(getSensorsList_cb _hidl_cb) { if (dst->requiredPermission == "com.samsung.permission.SSENSOR") { dst->requiredPermission = ""; } + + if (dst->typeAsString == "com.samsung.sensor.physical_proximity") { + LOG(INFO) << "Fixing com.samsung.sensor.physical_proximity"; + dst->type = SensorType::PROXIMITY; + dst->typeAsString = SENSOR_STRING_TYPE_PROXIMITY; + } } _hidl_cb(out); |