Skip to content
Commit d553b332 authored by Robert Horvath's avatar Robert Horvath
Browse files

Allow wake from quiescent during boot

In quiescent boots, the display is off during boot and after boot
completes when the device goes to sleep. The display can only be woken
up after the device finishes booting and goes to sleep.

With this change, pressing a power or wake key during a quiescent boot
exits the 'quiescent mode' early, turning on the screen again even
before boot completes, and prevents the device from going to sleep once
boot finishes. Other sources calling PowerManager#wakeUp before boot
completes will exit quiescent mode as well.

- Propagate initial display state to DisplayPowerController
  - This prevents attempt to run fade out animation when screen is set
    to be off when already off, which can block mDisplayReady
- Forward power and wake key presses from PhoneWindowManager to
  PowerManagerService even if system is not yet fully booted.
  - Needed so that PowerManager knows to exit quiescent mode
- Pass in current listener to PhoneWindowManager#screenTurningOn in
  #systemBooted
  - If a display state transition happens before boot completes, this
    line would drop the existing listener,
    and the display would never become ready again.
- Only unset sQuiescent when mDisplayReady
  - The initial-off state needs to be fully applied before we can
    request the display to come on again, otherwise the screen might
    stay in quiescent mode.

Bug: 157494508
Test: atest PowerManagerServiceTest#testQuiescentBoot_WakeKeyBeforeBootCompleted_AwakeAfterBootCompleted
Change-Id: Idb05c4e85b32406bcdfc97d73e91083e4219230a
parent 258ae119
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment