From 9f6c43e65c5fa2af7ba73ae67ded695e3c84b7d8 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 8 Jun 2021 21:29:37 -0700 Subject: [PATCH] Fix for IME exclusions not working with expanded bubble - Technically the IME window is above the Bubble window, but when traversing the windows top-down for calculating the final exclusion region for SysUI, the IME is placed just above its target (the embedded task), and the Bubble's full touchable region effectively overrides the IME's requested exclusion region Fixes: 190338512 Test: Expand a bubble, swipe from IME edge Change-Id: Idd71eabfaba1be4bc6fc90d09db28d3f9e9106c5 --- .../com/android/wm/shell/bubbles/BubbleStackView.java | 11 ++++------- .../bubbles/animation/StackAnimationController.java | 5 +++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index 8613dcbda8728..786772446325b 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -852,13 +852,6 @@ public class BubbleStackView extends FrameLayout mTaskbarScrim.setAlpha(0f); mTaskbarScrim.setVisibility(GONE); - setOnApplyWindowInsetsListener((View view, WindowInsets insets) -> { - if (!mIsExpanded || mIsExpansionAnimating) { - return view.onApplyWindowInsets(insets); - } - return view.onApplyWindowInsets(insets); - }); - mOrientationChangedListener = (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> { mPositioner.update(); @@ -2465,6 +2458,10 @@ public class BubbleStackView extends FrameLayout } } else { mBubbleContainer.getBoundsOnScreen(outRect); + // Account for the IME in the touchable region so that the touchable region of the + // Bubble window doesn't obscure the IME. The touchable region affects which areas + // of the screen can be excluded by lower windows (IME is just above the embedded task) + outRect.bottom -= (int) mStackAnimationController.getImeHeight(); } if (mFlyout.getVisibility() == View.VISIBLE) { diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java index 12d55b85fac6a..0802fb59a0087 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/animation/StackAnimationController.java @@ -529,6 +529,11 @@ public class StackAnimationController extends mImeHeight = imeHeight; } + /** Returns the current IME height that the stack is offset by. */ + public float getImeHeight() { + return mImeHeight; + } + /** * Animates the stack either away from the newly visible IME, or back to its original position * due to the IME going away.