From 6fc623d0b9fc18cc61a2b69389313eb63b229106 Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Tue, 11 May 2021 16:30:54 -0700 Subject: [PATCH] Skip setShelfHeight if Launcher is not started Video: http://recall/-/aaaaaabFQoRHlzixHdtY/gIqsb2WlagwQ8ly3q3RHI0 Bug: 184797356 Test: atest WMShellFlickerTests:PipShelfHeightTest Test: manual, see video Change-Id: Ia02b2da110b05341dfbf92b9d8d7fca4bbf6bdb3 --- .../uioverrides/QuickstepLauncher.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index d07cc35ecc..45bb521336 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -200,14 +200,18 @@ public class QuickstepLauncher extends BaseQuickstepLauncher { */ private void onStateOrResumeChanging(boolean inTransition) { LauncherState state = getStateManager().getState(); - DeviceProfile profile = getDeviceProfile(); - boolean willUserBeActive = (getActivityFlags() & ACTIVITY_STATE_USER_WILL_BE_ACTIVE) != 0; - boolean visible = (state == NORMAL || state == OVERVIEW) - && (willUserBeActive || isUserActive()) - && !profile.isVerticalBarLayout() - && profile.isPhone && !profile.isLandscape; - UiThreadHelper.runAsyncCommand(this, SET_SHELF_HEIGHT, visible ? 1 : 0, - profile.hotseatBarSizePx); + boolean started = ((getActivityFlags() & ACTIVITY_STATE_STARTED)) != 0; + if (started) { + DeviceProfile profile = getDeviceProfile(); + boolean willUserBeActive = + (getActivityFlags() & ACTIVITY_STATE_USER_WILL_BE_ACTIVE) != 0; + boolean visible = (state == NORMAL || state == OVERVIEW) + && (willUserBeActive || isUserActive()) + && !profile.isVerticalBarLayout() + && profile.isPhone && !profile.isLandscape; + UiThreadHelper.runAsyncCommand(this, SET_SHELF_HEIGHT, visible ? 1 : 0, + profile.hotseatBarSizePx); + } if (state == NORMAL && !inTransition) { ((RecentsView) getOverviewPanel()).setSwipeDownShouldLaunchApp(false); }