Check IsSleeping to start WAKE transition

Currently, DisplayPolicy#isAwake() is used to see if a WAKE
transition gets started. This assumes that applySleepTokens() is
called before DisplayPolicy#mAwake is updated, but the order is
different depending on how the device is woken up. For example,
if a vendor directly calls PowerManager#wakeUp(), it will be a
race.

With this CL, DisplayContent#mSleeping is checked instead. This
property is updated only in the same function, so there will be
no race whoever wakes up the system.

Bug: 284788259
Test: Manually wake up an app via adb and the window gets shown.
Change-Id: Ic82499cc35ae924478ab7f7484b6cd782c55618e
1 file changed