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.