From ba9fef04274c53041f677be7352760d3b112d8d8 Mon Sep 17 00:00:00 2001 From: Joshua Tsuji Date: Thu, 9 Apr 2020 17:40:35 -0400 Subject: [PATCH] Fix the ActivityView consuming shade touches. Test: manual Fixes: 153675983 Change-Id: I2f21124d017402f2197d29015e973e013a643389 --- .../android/systemui/bubbles/BubbleController.java | 2 +- .../android/systemui/bubbles/BubbleStackView.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java index 99e5eb66a00f1..669a86b8a7429 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java @@ -599,7 +599,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi if (mStackView == null) { mStackView = new BubbleStackView( mContext, mBubbleData, mSurfaceSynchronizer, mFloatingContentCoordinator, - mSysUiState); + mSysUiState, mNotificationShadeWindowController); ViewGroup nsv = mNotificationShadeWindowController.getNotificationShadeView(); int bubbleScrimIndex = nsv.indexOfChild(nsv.findViewById(R.id.scrim_for_bubble)); int stackIndex = bubbleScrimIndex + 1; // Show stack above bubble scrim. diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java index 644e54fb82aea..61e6f39c054fd 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java @@ -83,6 +83,7 @@ import com.android.systemui.bubbles.animation.StackAnimationController; import com.android.systemui.model.SysUiState; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.SysUiStatsLog; +import com.android.systemui.statusbar.phone.NotificationShadeWindowController; import com.android.systemui.util.DismissCircleView; import com.android.systemui.util.FloatingContentCoordinator; import com.android.systemui.util.RelativeTouchListener; @@ -330,6 +331,8 @@ public class BubbleStackView extends FrameLayout { @NonNull private final SurfaceSynchronizer mSurfaceSynchronizer; + private final NotificationShadeWindowController mNotificationShadeWindowController; + /** * The currently magnetized object, which is being dragged and will be attracted to the magnetic * dismiss target. @@ -626,13 +629,15 @@ public class BubbleStackView extends FrameLayout { public BubbleStackView(Context context, BubbleData data, @Nullable SurfaceSynchronizer synchronizer, FloatingContentCoordinator floatingContentCoordinator, - SysUiState sysUiState) { + SysUiState sysUiState, + NotificationShadeWindowController notificationShadeWindowController) { super(context); mBubbleData = data; mInflater = LayoutInflater.from(context); mSysUiState = sysUiState; + mNotificationShadeWindowController = notificationShadeWindowController; Resources res = getResources(); mMaxBubbles = res.getInteger(R.integer.bubbles_max_rendered); @@ -1557,7 +1562,11 @@ public class BubbleStackView extends FrameLayout { */ @Override public void subtractObscuredTouchableRegion(Region touchableRegion, View view) { - + // If the notification shade is expanded, we shouldn't let the ActivityView steal any touch + // events from any location. + if (mNotificationShadeWindowController.getPanelExpanded()) { + touchableRegion.setEmpty(); + } } /**