From e86ce8f2cd55fca9bb9395057d179705a3be8f85 Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Mon, 19 Sep 2022 19:01:39 +0100 Subject: Fixing QS appearing when going from AOD to unlocked in split shade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug was caused by steadily decreasing height of panel instead of snapping it to 0 immediately. While transitioning from AOD to UNLOCKED, we’re using collapsePanel with animation call which creates height animator. That animator is progressing through shade collapse from fraction of 1 through 0.9, 0. 8 etc making the whole shade visible for some time. We need to immediately collapse shade in that case instead of animating the transition, which is done automatically when changing states. This animation was triggered from resetViews() when going out of doze and resetting views doesn’t seem to be necessary as shade is already getting collapsed when going into doze. Bug: 244777135 Test: go to AOD in split shade, unlock with fingerprint without showing keyguard first, QS are not flashing for a moment Change-Id: Ice020b5d40148026709a78b22af9de4dbc203984 --- .../android/systemui/shade/NotificationPanelViewController.java | 8 ++------ .../com/android/systemui/statusbar/phone/CentralSurfacesImpl.java | 5 +++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 1011a6d831e6..1872b35200b0 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -425,8 +425,6 @@ public final class NotificationPanelViewController extends PanelViewController { new KeyguardClockPositionAlgorithm.Result(); private boolean mIsExpanding; - private boolean mBlockTouches; - /** * Determines if QS should be already expanded when expanding shade. * Used for split shade, two finger gesture as well as accessibility shortcut to QS. @@ -1692,7 +1690,6 @@ public final class NotificationPanelViewController extends PanelViewController { public void resetViews(boolean animate) { mIsLaunchTransitionFinished = false; - mBlockTouches = false; mCentralSurfaces.getGutsManager().closeAndSaveGuts(true /* leavebehind */, true /* force */, true /* controls */, -1 /* x */, -1 /* y */, true /* resetMenu */); if (animate && !isFullyCollapsed()) { @@ -4186,7 +4183,7 @@ public final class NotificationPanelViewController extends PanelViewController { "NPVC onInterceptTouchEvent (" + event.getId() + "): (" + event.getX() + "," + event.getY() + ")"); } - if (mBlockTouches || mQs.disallowPanelTouches()) { + if (mQs.disallowPanelTouches()) { return false; } initDownStates(event); @@ -4229,8 +4226,7 @@ public final class NotificationPanelViewController extends PanelViewController { } - if (mBlockTouches || (mQsFullyExpanded && mQs != null - && mQs.disallowPanelTouches())) { + if (mQsFullyExpanded && mQs != null && mQs.disallowPanelTouches()) { return false; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java index 0b63bbfec877..f736047b05d4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java @@ -4453,10 +4453,11 @@ public class CentralSurfacesImpl extends CoreStartable implements Trace.beginSection("CentralSurfaces#updateDozing"); mDozing = isDozing; - // Collapse the notification panel if open boolean dozingAnimated = mDozeServiceHost.getDozingRequested() && mDozeParameters.shouldControlScreenOff(); - mNotificationPanelViewController.resetViews(dozingAnimated); + // resetting views is already done when going into doze, there's no need to + // reset them again when we're waking up + mNotificationPanelViewController.resetViews(dozingAnimated && isDozing); updateQsExpansionEnabled(); mKeyguardViewMediator.setDozing(mDozing); -- cgit v1.2.3-59-g8ed1b