From 6b80f7c41c675c56ff2b67ef3848973b806b73dc Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Wed, 24 Aug 2022 13:45:42 +0000 Subject: [PATCH] Fix shade collapse on keyguard with bypass enabled Only with face unlock + bypass enabled, when dragging down the shade over keyguard, the end motion event was forcing the shade to collapse again, due to an incorrect check on the keyguard state. Use the KeyguardStateController.isShowing() method instead, which is a more accurate check on keyguard state. Fixes: 242813247 Test: All combinations of face unlock enabled/disabled, notifications visible on lockscreen on/off, notification redacted on/off, face bypass on/off Merged-In: I99c6ced66f3269dbf4e6df1d078d7c793492c157 Change-Id: I827128fc5f57a24eee5110f5c2b8ccb697a7f821 --- .../src/com/android/systemui/shade/PanelViewController.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/PanelViewController.java index 11e36c915adf5..e149db08c7376 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/PanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/PanelViewController.java @@ -397,7 +397,7 @@ abstract class PanelViewController { mInitialOffsetOnTouch = expandedHeight; mInitialExpandY = newY; mInitialExpandX = newX; - mInitialTouchFromKeyguard = mStatusBarStateController.getState() == StatusBarState.KEYGUARD; + mInitialTouchFromKeyguard = mKeyguardStateController.isShowing(); if (startTracking) { mTouchSlopExceeded = true; setExpandedHeight(mInitialOffsetOnTouch); @@ -416,9 +416,7 @@ abstract class PanelViewController { float vectorVel = (float) Math.hypot( mVelocityTracker.getXVelocity(), mVelocityTracker.getYVelocity()); - final boolean onKeyguard = - mStatusBarStateController.getState() == StatusBarState.KEYGUARD; - + final boolean onKeyguard = mKeyguardStateController.isShowing(); final boolean expand; if (mKeyguardStateController.isKeyguardFadingAway() || (mInitialTouchFromKeyguard && !onKeyguard)) {