Merge "Cannot click on the last touch explored auto-completion item." into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
75fb3e7ac2
@@ -588,6 +588,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getActiveWindowId() {
|
||||||
|
return mSecurityPolicy.mActiveWindowId;
|
||||||
|
}
|
||||||
|
|
||||||
private Service getQueryBridge() {
|
private Service getQueryBridge() {
|
||||||
if (mQueryBridge == null) {
|
if (mQueryBridge == null) {
|
||||||
AccessibilityServiceInfo info = new AccessibilityServiceInfo();
|
AccessibilityServiceInfo info = new AccessibilityServiceInfo();
|
||||||
|
|||||||
@@ -190,6 +190,9 @@ public class TouchExplorer {
|
|||||||
// The long pressing pointer Y if coordinate remapping is needed.
|
// The long pressing pointer Y if coordinate remapping is needed.
|
||||||
private int mLongPressingPointerDeltaY;
|
private int mLongPressingPointerDeltaY;
|
||||||
|
|
||||||
|
// The id of the last touch explored window.
|
||||||
|
private int mLastTouchedWindowId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new instance.
|
* Creates a new instance.
|
||||||
*
|
*
|
||||||
@@ -305,6 +308,11 @@ public class TouchExplorer {
|
|||||||
mInjectedPointerTracker.mLastInjectedHoverEvent.recycle();
|
mInjectedPointerTracker.mLastInjectedHoverEvent.recycle();
|
||||||
mInjectedPointerTracker.mLastInjectedHoverEvent = null;
|
mInjectedPointerTracker.mLastInjectedHoverEvent = null;
|
||||||
}
|
}
|
||||||
|
mLastTouchedWindowId = -1;
|
||||||
|
} break;
|
||||||
|
case AccessibilityEvent.TYPE_VIEW_HOVER_ENTER:
|
||||||
|
case AccessibilityEvent.TYPE_VIEW_HOVER_EXIT: {
|
||||||
|
mLastTouchedWindowId = event.getWindowId();
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1078,13 +1086,15 @@ public class TouchExplorer {
|
|||||||
clickLocationX = (int) lastExploreEvent.getX(lastExplorePointerIndex);
|
clickLocationX = (int) lastExploreEvent.getX(lastExplorePointerIndex);
|
||||||
clickLocationY = (int) lastExploreEvent.getY(lastExplorePointerIndex);
|
clickLocationY = (int) lastExploreEvent.getY(lastExplorePointerIndex);
|
||||||
Rect activeWindowBounds = mTempRect;
|
Rect activeWindowBounds = mTempRect;
|
||||||
mAms.getActiveWindowBounds(activeWindowBounds);
|
if (mLastTouchedWindowId == mAms.getActiveWindowId()) {
|
||||||
if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
|
mAms.getActiveWindowBounds(activeWindowBounds);
|
||||||
Rect focusBounds = mTempRect;
|
if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
|
||||||
if (mAms.getAccessibilityFocusBoundsInActiveWindow(focusBounds)) {
|
Rect focusBounds = mTempRect;
|
||||||
if (!focusBounds.contains(clickLocationX, clickLocationY)) {
|
if (mAms.getAccessibilityFocusBoundsInActiveWindow(focusBounds)) {
|
||||||
clickLocationX = focusBounds.centerX();
|
if (!focusBounds.contains(clickLocationX, clickLocationY)) {
|
||||||
clickLocationY = focusBounds.centerY();
|
clickLocationX = focusBounds.centerX();
|
||||||
|
clickLocationY = focusBounds.centerY();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1308,13 +1318,15 @@ public class TouchExplorer {
|
|||||||
clickLocationX = (int) lastExploreEvent.getX(lastExplorePointerIndex);
|
clickLocationX = (int) lastExploreEvent.getX(lastExplorePointerIndex);
|
||||||
clickLocationY = (int) lastExploreEvent.getY(lastExplorePointerIndex);
|
clickLocationY = (int) lastExploreEvent.getY(lastExplorePointerIndex);
|
||||||
Rect activeWindowBounds = mTempRect;
|
Rect activeWindowBounds = mTempRect;
|
||||||
mAms.getActiveWindowBounds(activeWindowBounds);
|
if (mLastTouchedWindowId == mAms.getActiveWindowId()) {
|
||||||
if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
|
mAms.getActiveWindowBounds(activeWindowBounds);
|
||||||
Rect focusBounds = mTempRect;
|
if (activeWindowBounds.contains(clickLocationX, clickLocationY)) {
|
||||||
if (mAms.getAccessibilityFocusBoundsInActiveWindow(focusBounds)) {
|
Rect focusBounds = mTempRect;
|
||||||
if (!focusBounds.contains(clickLocationX, clickLocationY)) {
|
if (mAms.getAccessibilityFocusBoundsInActiveWindow(focusBounds)) {
|
||||||
clickLocationX = focusBounds.centerX();
|
if (!focusBounds.contains(clickLocationX, clickLocationY)) {
|
||||||
clickLocationY = focusBounds.centerY();
|
clickLocationX = focusBounds.centerX();
|
||||||
|
clickLocationY = focusBounds.centerY();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user