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

Commit 5746559d authored by Filip Gruszczynski's avatar Filip Gruszczynski Committed by Android (Google) Code Review
Browse files

Merge "Add input method to the tap detection exclude area."

parents e7f24e22 912d9197
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -94,8 +94,9 @@ class DisplayContent {
    Region mNonResizeableRegion = new Region();

    /** Save allocating when calculating rects */
    private Rect mTmpRect = new Rect();
    private Rect mTmpRect2 = new Rect();
    private final Rect mTmpRect = new Rect();
    private final Rect mTmpRect2 = new Rect();
    private final Region mTmpRegion = new Region();

    /** For gathering Task objects in order. */
    final ArrayList<Task> mTmpTaskHistory = new ArrayList<Task>();
@@ -403,6 +404,14 @@ class DisplayContent {
        if (addBackFocusedTask) {
            mTouchExcludeRegion.op(mTmpRect2, Region.Op.UNION);
        }
        final WindowState inputMethod = mService.mInputMethodWindow;
        if (inputMethod != null && inputMethod.isVisibleLw()) {
            // If the input method is visible and the user is typing, we don't want these touch
            // events to be intercepted and used to change focus. This would likely cause a
            // disappearance of the input method.
            inputMethod.getTouchableRegion(mTmpRegion);
            mTouchExcludeRegion.op(mTmpRegion, Region.Op.UNION);
        }
        if (mTapDetector != null) {
            mTapDetector.setTouchExcludeRegion(mTouchExcludeRegion, mNonResizeableRegion);
        }