Preserve decor insets cache if screen is not turned on
Currently, the steps of display switch could be:
1. Awake
2. Transition
3. Screen on fully
The order of 2 and 3 is not always the same.
The condition "mDisplayContent.isSleeping()" depends on 1.
So to avoid the cache from being cleared too early which may
cause additional display configuration changes, preserve the
cache until 2+3 is done rather than 1+2.
Remove the validator after transition because it can be called
before the insets provider windows update new layout, then it
doesn't really help to validate but trigger extra configuration
changes.
Bug: 266197298
Test: DisplayPolicyTests#testSwitchDecorInsets
Change-Id: Iab5fbeb8685a306d5e57c5d4923cf7ad6ed0f454
2 files changed