* 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.