Skip to content
Commit 4bb06bed authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Fix setCanTurnScreenOn for a launching activity

Originally the flag set by Activity#setCanTurnScreenOn takes effect
when the activity will be resumed. But if the activity uses the method
while the creation of activity is needed, the flag doesn't have the
chance to be set before the check for applying it because the client
side creation is after the launching flow.

By adding the check for ActivityRecord#canTurnScreenOn at the same
path of FLAG_TURN_SCREEN_ON, it is able to turn the screen on when the
activity relayouts to be visible.

AppWindowToken#canTurnScreenOn is renamed to currentLaunchCanTurnScreenOn
because it only applies to the current launch and avoids confusion with
the one in ActivityRecord.

Bug: 136214822
Test: atest WindowStateTests#testPrepareWindowToDisplayDuringRelayout
Test: atest ActivityVisibilityTests#testTurnScreenOnActivity
Change-Id: I9cb877357fb55c95b0d95044fe9e8ccba0c083ad
parent e6c41d27
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