From 79f0d17195c21f3c093470968c1750f2440b9f08 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 1 May 2019 11:46:51 -0700 Subject: [PATCH] Block touches under scrimmed bouncer Fixes: 131386038 Test: swipe to bouncer and back on LS Test: tap on notification, hit back on LS Test: tap on notification on locked shade, try to interact with QS Test: tap on notification on locked shade, hit back Change-Id: I4e7c92abd8af2bba1918b7f1680d2a4b7377be12 --- .../statusbar/phone/NotificationPanelView.java | 12 ++++++++++++ .../android/systemui/statusbar/phone/StatusBar.java | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 7b3ddf7cfaef2..1194a1d7b3f29 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -833,6 +833,11 @@ public class NotificationPanelView extends PanelView implements return false; } initDownStates(event); + // Do not let touches go to shade or QS if the bouncer is visible, + // but still let user swipe down to expand the panel, dismissing the bouncer. + if (mStatusBar.isBouncerShowing()) { + return true; + } if (mBar.panelEnabled() && mHeadsUpTouchHelper.onInterceptTouchEvent(event)) { mIsExpansionFromHeadsUp = true; MetricsLogger.count(mContext, COUNTER_PANEL_OPEN, 1); @@ -1000,6 +1005,13 @@ public class NotificationPanelView extends PanelView implements if (mBlockTouches || (mQs != null && mQs.isCustomizing())) { return false; } + + // Do not allow panel expansion if bouncer is scrimmed, otherwise user would be able to + // pull down QS or expand the shade. + if (mStatusBar.isBouncerShowingScrimmed()) { + return false; + } + initDownStates(event); // Make sure the next touch won't the blocked after the current ends. if (event.getAction() == MotionEvent.ACTION_UP diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 93db82d8e1197..2a5b01147d3b3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -4427,6 +4427,13 @@ public class StatusBar extends SystemUI implements DemoMode, return mBouncerShowing; } + /** + * @return Whether the security bouncer from Keyguard is showing. + */ + public boolean isBouncerShowingScrimmed() { + return isBouncerShowing() && mStatusBarKeyguardViewManager.bouncerNeedsScrimming(); + } + /** * @return a PackageManger for userId or if userId is < 0 (USER_ALL etc) then * return PackageManager for mContext