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>
Since these were combined into libhidlbase.
Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: Iba2cd20b8b20fac3e7564de6b853b475fd4ebd2a
* 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
* 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.