Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61cfd71d authored by Winson Chung's avatar Winson Chung
Browse files

Ignore hidden views when computing exclusion rects

Bug: 138806473
Test: atest SystemGestureExclusionRectsTest
Change-Id: I43629546af641d2b6347889e3ea10bd2cbbe9070
parent 8247b5f5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ class GestureExclusionTracker {
        while (i.hasNext()) {
            final GestureExclusionViewInfo info = i.next();
            final View v = info.getView();
            if (v == null || !v.isAttachedToWindow()) {
            if (v == null || !v.isAttachedToWindow() || !v.isShown()) {
                mGestureExclusionViewsChanged = true;
                i.remove();
                continue;
@@ -122,7 +122,8 @@ class GestureExclusionTracker {

        public int update() {
            final View excludedView = getView();
            if (excludedView == null || !excludedView.isAttachedToWindow()) return GONE;
            if (excludedView == null || !excludedView.isAttachedToWindow()
                    || !excludedView.isShown()) return GONE;
            final List<Rect> localRects = excludedView.getSystemGestureExclusionRects();
            final List<Rect> newRects = new ArrayList<>(localRects.size());
            for (Rect src : localRects) {
+1 −0
Original line number Diff line number Diff line
@@ -14423,6 +14423,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
        notifyAppearedOrDisappearedForContentCaptureIfNeeded(isVisible);
        updateSystemGestureExclusionRects();
    }
    /**