Merge "Allow swiping down from area directly below notch to trigger QS instead of notification shade." into sc-dev am: 40116423b0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15108769

Change-Id: Ic0821ee41189c3db419a46e714ac1bf60c72e3a8
This commit is contained in:
Caitlin Cassidy
2021-07-02 14:16:04 +00:00
committed by Automerger Merge Worker
2 changed files with 12 additions and 5 deletions

View File

@@ -592,6 +592,7 @@ public class NotificationPanelViewController extends PanelViewController {
*/ */
private ValueAnimator mQsClippingAnimation = null; private ValueAnimator mQsClippingAnimation = null;
private final Rect mKeyguardStatusAreaClipBounds = new Rect(); private final Rect mKeyguardStatusAreaClipBounds = new Rect();
private final Region mQsInterceptRegion = new Region();
/** /**
* The alpha of the views which only show on the keyguard but not in shade / shade locked * The alpha of the views which only show on the keyguard but not in shade / shade locked
@@ -2684,10 +2685,16 @@ public class NotificationPanelViewController extends PanelViewController {
return false; return false;
} }
View header = mKeyguardShowing || mQs == null ? mKeyguardStatusBar : mQs.getHeader(); View header = mKeyguardShowing || mQs == null ? mKeyguardStatusBar : mQs.getHeader();
final boolean
onHeader = mQsInterceptRegion.set(
x >= mQsFrame.getX() && x <= mQsFrame.getX() + mQsFrame.getWidth() /* left= */ (int) mQsFrame.getX(),
&& y >= header.getTop() && y <= header.getBottom(); /* top= */ header.getTop(),
/* right= */ (int) mQsFrame.getX() + mQsFrame.getWidth(),
/* bottom= */ header.getBottom());
// Also allow QS to intercept if the touch is near the notch.
mStatusBarTouchableRegionManager.updateRegionForNotch(mQsInterceptRegion);
final boolean onHeader = mQsInterceptRegion.contains((int) x, (int) y);
if (mQsExpanded) { if (mQsExpanded) {
return onHeader || (yDiff < 0 && isInQsArea(x, y)); return onHeader || (yDiff < 0 && isInQsArea(x, y));
} else { } else {

View File

@@ -223,7 +223,7 @@ public final class StatusBarTouchableRegionManager implements Dumpable {
} }
} }
private void updateRegionForNotch(Region touchableRegion) { void updateRegionForNotch(Region touchableRegion) {
WindowInsets windowInsets = mNotificationShadeWindowView.getRootWindowInsets(); WindowInsets windowInsets = mNotificationShadeWindowView.getRootWindowInsets();
if (windowInsets == null) { if (windowInsets == null) {
Log.w(TAG, "StatusBarWindowView is not attached."); Log.w(TAG, "StatusBarWindowView is not attached.");