Fix extra configuration change when unlocking directly
When unlocking the device directly, if the top activity has different
orientation than keyguard, the orientation of display be updated first.
Otherwise the activity may be updated to the orientation requested by
keyguard, and then update again according to the activity.
If fixed rotation is active in this case, it only increase useless cost
because the display is not frozen, the orientation changes will have
some intermediate states, such as keyguard-going-away is just cleared
but the specified orientation of keyguard still exists a while.
Also make the cleanup of fixed rotation more robust to avoid other
unexpected paths retain the stale state.
Bug: 160131683
Bug: 160239395
Test: atest RootActivityContainerTests# \
testAwakeFromSleepingWithAppConfiguration
Change-Id: I3552b81ffaaff062aa2ee90c51928c92dfb83c48
12 files changed