From 59d1214798549259d2a123ce174cd434b6d18435 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Mon, 17 Apr 2023 12:53:05 -0700 Subject: [PATCH] Remove ActivityInfo.CONFIG_SCREEN_SIZE if orientation is still the same. Avoid NPE to unblock development while we investigate root cause. Bug: 274394837 Test: see repo steps in bug comment #11 Change-Id: Ib18aa9da1d2827ae03037215ff9e34d27493995b Flag: ENABLE_TRANSIENT_TASKBAR true --- .../src/com/android/launcher3/taskbar/TaskbarManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java index 3d8bf9ea63..ca29afb1ad 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java @@ -168,9 +168,14 @@ public class TaskbarManager { DeviceProfile oldDp = mTaskbarActivityContext.getDeviceProfile(); boolean isOrientationChange = (configDiff & ActivityInfo.CONFIG_ORIENTATION) != 0; + + int newOrientation = newConfig.windowConfiguration.getRotation(); + int oldOrientation = mOldConfig.windowConfiguration.getRotation(); int oldWidth = isOrientationChange ? oldDp.heightPx : oldDp.widthPx; int oldHeight = isOrientationChange ? oldDp.widthPx : oldDp.heightPx; - if (dp.widthPx == oldWidth && dp.heightPx == oldHeight) { + + if ((dp.widthPx == oldWidth && dp.heightPx == oldHeight) + || (newOrientation == oldOrientation)) { configDiffForRecreate &= ~ActivityInfo.CONFIG_SCREEN_SIZE; } }