From b5714042282c4abb348a59ebbec2e192a8f5e737 Mon Sep 17 00:00:00 2001 From: Dan Sandler Date: Mon, 1 Mar 2021 14:46:09 -0500 Subject: [PATCH] Block touches from descendants of an invisible panel. This defends against a certain class of bugs where swiping down the notification shade stops working because those gestures are being sent to the shade contents rather than the panel dragging code. Bug: 178277858 Test: none; this adds robustness to broken states Change-Id: Id088f20599cb272611c141948de6c6303b536960 --- .../systemui/statusbar/phone/PanelViewController.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java index 55744f94f2b08..b6ed3e50ed7ea 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java @@ -27,7 +27,6 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; -import android.annotation.Nullable; import android.content.res.Configuration; import android.content.res.Resources; import android.os.SystemClock; @@ -1243,7 +1242,10 @@ public abstract class PanelViewController { mVelocityTracker.clear(); break; } - return false; + + // Finally, if none of the above cases applies, ensure that touches do not get handled + // by the contents of a panel that is not showing (a bit of a hack to avoid b/178277858) + return (mView.getVisibility() != View.VISIBLE); } @Override