Fix launcher flicker when unlocking on seascape.
Test: manual
Fixes: 160544577
Launcher flickers if it is locked on portrait, then unlocked on seascape. DisplayController.Info was consistenly being updated late causing launcher to unlock in lanscape then switching to seascape with enough frames in-between for the user to notice. Updated DisplayController to properly update its rotation info and updated DeviceProfile to force an info update when checking if the device is in seascape orientation.
demo: https://drive.google.com/file/d/1JBCvK3brLwOSTC4k56GSxeYozl5x0k7X/view?usp=sharing
Change-Id: Idce139f0e16cb686684c0d3a460c4ec9e5ae466a
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 12ce9f3..f681d75 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -607,8 +607,9 @@
*/
public boolean updateIsSeascape(Context context) {
if (isVerticalBarLayout()) {
- boolean isSeascape = DisplayController.getDefaultDisplay(context).getInfo().rotation
- == Surface.ROTATION_270;
+ // Check an up-to-date info.
+ boolean isSeascape = DisplayController.getDefaultDisplay(context)
+ .createInfoForContext(context).rotation == Surface.ROTATION_270;
if (mIsSeascape != isSeascape) {
mIsSeascape = isSeascape;
return true;