Loading services/java/com/android/server/accessibility/AccessibilityManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading services/java/com/android/server/accessibility/TouchExplorer.java +26 −14 Original line number Diff line number Diff line Loading @@ -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. * Loading Loading @@ -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; } } Loading Loading @@ -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; Loading @@ -1089,6 +1098,7 @@ public class TouchExplorer { } } } } // Do the click. PointerProperties[] properties = new PointerProperties[1]; Loading Loading @@ -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; Loading @@ -1319,6 +1330,7 @@ public class TouchExplorer { } } } } mLongPressingPointerId = pointerId; mLongPressingPointerDeltaX = (int) mEvent.getX(pointerIndex) - clickLocationX; Loading Loading
services/java/com/android/server/accessibility/AccessibilityManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -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(); Loading
services/java/com/android/server/accessibility/TouchExplorer.java +26 −14 Original line number Diff line number Diff line Loading @@ -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. * Loading Loading @@ -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; } } Loading Loading @@ -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; Loading @@ -1089,6 +1098,7 @@ public class TouchExplorer { } } } } // Do the click. PointerProperties[] properties = new PointerProperties[1]; Loading Loading @@ -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; Loading @@ -1319,6 +1330,7 @@ public class TouchExplorer { } } } } mLongPressingPointerId = pointerId; mLongPressingPointerDeltaX = (int) mEvent.getX(pointerIndex) - clickLocationX; Loading