Commit Graph

6 Commits

Author SHA1 Message Date
LuK1337 a7c1c683a9 sm8150-common: sensors: Switch to libgui_vendor
Change-Id: I4ff1fcefb0d3429f0fbbb6e79bdbc3357cbb3c8e
2019-07-07 12:53:46 +02:00
LuK1337 6db771311e sm8150-common: sensors: Use std::min() for calculating rgb_min
Change-Id: I77609ea08813e0c3ade54c5906acc4adb73473ad
2019-07-04 12:48:05 +02:00
Peter Cai c2cae22e74
sm8150-common: sensors: calibrate ALS from /persist
* 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.
2019-07-04 17:53:29 +08:00
Peter Cai 314420522e
sm8150-common: sensors: reduce log spam
* shut the sensors hal debugging information up.
2019-06-29 10:42:57 +08:00
Peter Cai a37dbb2a5a
sm8150-common: sensors: calculate correction for light sensor
* 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`.
2019-06-27 14:06:45 +08:00
Peter Cai 9c7485da81
sm8150-common: import sensors multihal
* 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.
2019-06-25 19:17:37 +08:00