* Newer samsung devices require 2.X implementation of the sensor
HAL, in order to avoid issues with importing 2.X service to existing
directory, move each to its subdir
Signed-off-by: josip-k <d3hum4niz3d@gmail.com>
Change-Id: If6fc05c166ba488e0be90ec59c9c79ac29c92d79
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
Samsung uses a special OperationMode (5555).
Thanks to Pierre-Hugues HUSSON for the hint.
Change-Id: I037ff5bf5a1edd65b616480d1c43cef8e61ba999
Signed-off-by: Jesse Chan <jc@lineageos.org>
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>
Samsung uses a permission com.samsung.permission.SSENSOR
for Samsung-specfic sensors. Android obviously does not
have that and the default is denied when there is no
permission. As such, those sensors are inaccessible.
Thus, this change removes this permission from those sensors
so we can use them.
Android does not require special permissions for most sensors
so this change doesn't attach additional permission requirements
to those sensors.
However, note that it is possible that some sensitive sensors
introduced by Samsung in the future may use SSENSOR permission
and for privacy reasons they should be handled separately with
appropriate permission control attached.
Change-Id: Ia3033898722039b285e522e226074238508f6093
Signed-off-by: Jesse Chan <jc@lineageos.org>