Skip to content

Draft: Use thread sync to await initial proximity state value

Flo Lee requested to merge fix_proximity into ubports/xenial_-_android9

So this was missed almost for 2 years or so:

  • After incoming notifications repowerd needs to know if its allowed to turn on the screen
  • It simply calls proximity_state() on the underlying sensor plugin
  • This triggered a spinup of the sensor in the legacy plugin for the Android HAL direct access
  • Now after changing to sensorfw this does no longer work
  • repowerd receives the last valid value BEFORE device went to sleep, and thats almost always "proximity far"

This PR tries to implement awaiting of an initial read when the proximity sensor was off.

Note: This is probably also needed for ambient light sensor, to await a "valid" read (currently it seems on some devices that it takes a few reads to be in a valid range)

Merge request reports

Loading