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

Commit 7a91def9 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android Git Automerger
Browse files

am 75fb3e7a: Merge "Cannot click on the last touch explored auto-completion item." into jb-dev

* commit '75fb3e7a':
  Cannot click on the last touch explored auto-completion item.
parents 765d3d13 75fb3e7a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -588,6 +588,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
        }
    }

    int getActiveWindowId() {
        return mSecurityPolicy.mActiveWindowId;
    }

    private Service getQueryBridge() {
        if (mQueryBridge == null) {
            AccessibilityServiceInfo info = new AccessibilityServiceInfo();
+26 −14
Original line number Diff line number Diff line
@@ -190,6 +190,9 @@ public class TouchExplorer {
    // The long pressing pointer Y if coordinate remapping is needed.
    private int mLongPressingPointerDeltaY;

    // The id of the last touch explored window.
    private int mLastTouchedWindowId;

    /**
     * Creates a new instance.
     *
@@ -305,6 +308,11 @@ public class TouchExplorer {
                    mInjectedPointerTracker.mLastInjectedHoverEvent.recycle();
                    mInjectedPointerTracker.mLastInjectedHoverEvent = null;
                }
                mLastTouchedWindowId = -1;
            } break;
            case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER:
            case AccessibilityEvent.TYPE_VIEW_HOVER_EXIT: {
                mLastTouchedWindowId = event.getWindowId();
            } break;
        }
    }
@@ -1078,6 +1086,7 @@ public class TouchExplorer {
                clickLocationX = (int) lastExploreEvent.getX(lastExplorePointerIndex);
                clickLocationY = (int) lastExploreEvent.getY(lastExplorePointerIndex);
                Rect activeWindowBounds = mTempRect;
                if (mLastTouchedWindowId == mAms.getActiveWindowId()) {
                    mAms.getActiveWindowBounds(activeWindowBounds);
                    if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
                        Rect focusBounds = mTempRect;
@@ -1089,6 +1098,7 @@ public class TouchExplorer {
                        }
                    }
                }
            }

            // Do the click.
            PointerProperties[] properties = new PointerProperties[1];
@@ -1308,6 +1318,7 @@ public class TouchExplorer {
                clickLocationX = (int) lastExploreEvent.getX(lastExplorePointerIndex);
                clickLocationY = (int) lastExploreEvent.getY(lastExplorePointerIndex);
                Rect activeWindowBounds = mTempRect;
                if (mLastTouchedWindowId == mAms.getActiveWindowId()) {
                    mAms.getActiveWindowBounds(activeWindowBounds);
                    if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
                        Rect focusBounds = mTempRect;
@@ -1319,6 +1330,7 @@ public class TouchExplorer {
                        }
                    }
                }
            }

            mLongPressingPointerId = pointerId;
            mLongPressingPointerDeltaX = (int) mEvent.getX(pointerIndex) - clickLocationX;