Need to apply the sub-HAL index byte to ensure handles provided in
DYNAMIC_SENSOR_META events align properly with the [dis]connected
callbacks.
Bug: 228879057
Test: try on device with dynamic sensors sub-HAL at index > 0
Merged-In: Ic7290b51733bb829a5494ef41e9430b51dc6074e
Change-Id: Ic7290b51733bb829a5494ef41e9430b51dc6074e
* Required by some OEM sensor implementations, e.g.
ASUS ZenFone 8, ASUS ROG Phone 3, OnePlus 9. This
is done so /dev/input/event* nodes can be read by
the QCOM sensor HAL.
Test: Verified light and proximity sensor work on ASUS
ZenFone 8 & ROG Phone 3 (android-12.1.0_r7).
Change-Id: I1a2d7384da0b159a4b59fcf38c37117d43b3b127
VTS ensures that 2.0 HALs don't expose the hinge angle sensor,
but the 2.1 HALs must run 2.0 VTS tests. This CL ensures that
we don't expose the hinge angle sensor on the 2.0 HAL, to avoid
failing those VTS tests.
Bug: 173135479
Test: run vts -a x86 -m VtsHalSensorsV2_0TargetTest
Change-Id: I944bfb0b01be0831e45cfd3d6ed7dab6770d1b80
Moving to asynchronous capture listener allows us to fix previous race
on GraphicBuffer and make sure it won't be blocked by any incident e.g.
fence timeout.
Also, guard updateScreenBuffer() with mutex to make sure lastScreenUpdate
can be updated safely.
Extends ThreadPoolMaxThreadCount to 1 because 0 is a confusing value.
Although we set max threads to 0 previously, extra binder thread was
still started according to the warning message in startThreadPool(),
which led to the race noted above as sigaction can also be run on binder
thread.
Also add verbose logging so we can do quick debugging with LOG_NDEBUG=0.
Change-Id: I4733919bc20b3c1b382e60b71c5ceaa10dedaf49
Signed-off-by: LibXZR <i@xzr.moe>
* use standard sensor type
* ignore non-wakeup sensor variant
* ignore events that do not properly match a pickup
Signed-off-by: Omkar Chandorkar <gotenksIN@aosip.dev>
This is a much smarter approach as this lets us to
stay suspended for a much longer time, effectively
until we receive any signal.
Change-Id: Ibfc95437f38c6dc5a837cf1b968a78b0fae26f9e
Since these were combined into libhidlbase.
Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: Iba2cd20b8b20fac3e7564de6b853b475fd4ebd2a
Do not reset value to zero, just use original reading. Prevents the
famous "unstable adaptive brightness" bug.
Change-Id: Ia82b4f3a6cf3ce0211e3ffa4ef3ff43be52030d2
Signed-off-by: Anirudh Gupta <anirudhgupta109@aosip.dev>
Silences the following warning:
`warning: "Deprecated: don't include cutils/log.h, use either android/log.h or log/log.h" [-W#warnings]`
Change-Id: I17f280010d357a69edb29ade8a3e6612e0839242
Signed-off-by: Anirudh Gupta <anirudhgupta109@aosip.dev>
* On Android 10, the default binder interface is set according to
whether the service is system or vendor, whereas on pre-10 every
service runs on /dev/binder by default. This breaks our service due to
its dependency on SurfaceFlinger, which is not found on
/dev/vndbinder.
Change-Id: I15584c40db4d432877994274205d7615565ef33b
* The factory calibration data of the ambient light sensor is stored in
/persist. Make use of this and calibrate the sensor readings so we at
least won't get those crazy values any more.
* On OnePlus 7 series phones, the light sensor is placed under the
display. This means that light from the display can affect the reading
of the sensor, messing up the auto brightness algorithm.
* This is an attempt to address this by reading the pixel values right
around the sensor, estimate its brightness and substract it from the
original readings. It requires the following properties to be set:
- persist.vendor.sensors.light.location_{x,y}
The position of the sensor in terms of the coordinates on screen
- persist.vendor.sensors.light.full_white_reading
The reading of the light sensor when all the pixels around it are
white and with full brightness
* This also depends on `libgui` from `frameworks/native` to be available
in vendor namespace. The module was already part of VNDK in AOSP, but
it's VNDK-SP which means it is not available to normal vendor HALs. For
now, we can just patch the `Android.bp` of `libgui` to set
`vendor_available: true`.
* with a full vendor image, we can modify the sensors hal as we want. We
can replace the reported sensor type directly from HAL, instead of
relying on a framework patch.