summaryrefslogtreecommitdiffstats
path: root/hidl
diff options
context:
space:
mode:
authorJesse Chan <jc@lineageos.org>2020-05-16 21:17:25 +0800
committerJan Altensen <info@stricted.net>2020-05-19 11:27:32 +0200
commit561a3e7edcd15c2b93cd664ef0a9f4f36e442939 (patch)
tree57db7becad2b13fc03173b7436e11e619b5a34da /hidl
parent5502112367b6715547b02b9e8db9320eff49482d (diff)
downloadhardware_samsung-561a3e7edcd15c2b93cd664ef0a9f4f36e442939.tar.gz
hardware_samsung-561a3e7edcd15c2b93cd664ef0a9f4f36e442939.tar.bz2
hardware_samsung-561a3e7edcd15c2b93cd664ef0a9f4f36e442939.zip
sensors: set max range of proximity sensor to 1
Samsung's proximity sensor type is binary in nature. There are only two state: FAR and NEAR. However, Samsung uses values between min and max for other purposes like proximity detection during Always-On Display. This breaks proximity detection during Doze for AOSP as AOSP only considers the proximity sensor in FAR state when the value equals or larger than max. Thus, this change sets the max to 1 so any > 1 value would be considered as FAR and the behavior of this vendor proximity sensor type matches the behavior expected by AOSP. Change-Id: I56af8e2ae743b47e3c4894e5ef68ce0b54e5cfdb
Diffstat (limited to 'hidl')
-rw-r--r--hidl/sensors/Sensors.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/hidl/sensors/Sensors.cpp b/hidl/sensors/Sensors.cpp
index e9fc5ce..d4e84b3 100644
--- a/hidl/sensors/Sensors.cpp
+++ b/hidl/sensors/Sensors.cpp
@@ -137,6 +137,7 @@ Return<void> Sensors::getSensorsList(getSensorsList_cb _hidl_cb) {
LOG(INFO) << "Fixing com.samsung.sensor.physical_proximity";
dst->type = SensorType::PROXIMITY;
dst->typeAsString = SENSOR_STRING_TYPE_PROXIMITY;
+ dst->maxRange = 1;
}
}