0

I want to to get ALS(ambient light sensor) data for backlight reference before light up screen during wakeup

I read links for getting brightness level and setting up brightness in Change brightness according to surrounding light in android and Dr. Raymond M. Soneira's AutoBrightness_Controls

And I also find the comment in this code mAutomaticBrightnessController.configure

Seems the origin Android Auto Brightness Control disabled getting ALS data while wakeup

Is there any good way to add a ALS detection into the Android Auto Brightness Control while system wakeup?

Community
  • 1
  • 1
butter
  • 355
  • 1
  • 4
  • 12
  • It would be possible, but let me discourage you from doing it. The ambient light sensors are usually very slow (some take up to two seconds to deliver data, most about 500-1000 ms), which means they would delay screen wakeup. If there is one thing you never ever want to do, then it's introducing input lag. (e.g. let a user press a button and nothing happens for a second) Users tend to get frustrated with this quickly. – showp1984 Oct 15 '15 at 09:30
  • Yes ,that's a big problem.The als I use nearly took 200ms to get data from it is wakeup . I wandered if I make als sampling all the time in the tiny coprocessor, is there any good way to add the als data detection in framework before system wakeup? – butter Oct 15 '15 at 09:38
  • I read code again 1. The call flow starts from Powermanager calling updateDisplayPowerStateLocked to send a MSG_UPDATE_POWER_STATE. 2. Which calls updatePowerState() to changed screen state by animateScreenStateChange 3. After that, updatePowerState() then open ALS by configure()if it's closed. 4. updatePowerState() then calls animateScreenBrightness to update the screen , and the brightness value source is mScreenAutoBrightness 5. The mScreenAutoBrightness is updated only by callbacks of the ALS events I'm not sure if the data could be update d while getting the brightness to light up screen – butter Oct 26 '15 at 03:26

0 Answers0