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

Commit 75fb3e7a authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

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

parents fca9ff38 385d9f24
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;