Merge "Active window not updated window not updated properly." into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9b1767bbb4
@ -312,9 +312,9 @@ public class TouchExplorer {
|
|||||||
switch (eventType) {
|
switch (eventType) {
|
||||||
case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
|
case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
|
||||||
case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED: {
|
case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED: {
|
||||||
if (mInjectedPointerTracker.mLastInjectedHoverEvent != null) {
|
if (mInjectedPointerTracker.mLastInjectedHoverEventForClick != null) {
|
||||||
mInjectedPointerTracker.mLastInjectedHoverEvent.recycle();
|
mInjectedPointerTracker.mLastInjectedHoverEventForClick.recycle();
|
||||||
mInjectedPointerTracker.mLastInjectedHoverEvent = null;
|
mInjectedPointerTracker.mLastInjectedHoverEventForClick = null;
|
||||||
}
|
}
|
||||||
mLastTouchedWindowId = -1;
|
mLastTouchedWindowId = -1;
|
||||||
} break;
|
} break;
|
||||||
@ -1077,7 +1077,8 @@ public class TouchExplorer {
|
|||||||
final int pointerId = secondTapUp.getPointerId(secondTapUp.getActionIndex());
|
final int pointerId = secondTapUp.getPointerId(secondTapUp.getActionIndex());
|
||||||
final int pointerIndex = secondTapUp.findPointerIndex(pointerId);
|
final int pointerIndex = secondTapUp.findPointerIndex(pointerId);
|
||||||
|
|
||||||
MotionEvent lastExploreEvent = mInjectedPointerTracker.getLastInjectedHoverEvent();
|
MotionEvent lastExploreEvent =
|
||||||
|
mInjectedPointerTracker.getLastInjectedHoverEventForClick();
|
||||||
if (lastExploreEvent == null) {
|
if (lastExploreEvent == null) {
|
||||||
// No last touch explored event but there is accessibility focus in
|
// No last touch explored event but there is accessibility focus in
|
||||||
// the active window. We click in the middle of the focus bounds.
|
// the active window. We click in the middle of the focus bounds.
|
||||||
@ -1328,7 +1329,8 @@ public class TouchExplorer {
|
|||||||
final int pointerId = mEvent.getPointerId(mEvent.getActionIndex());
|
final int pointerId = mEvent.getPointerId(mEvent.getActionIndex());
|
||||||
final int pointerIndex = mEvent.findPointerIndex(pointerId);
|
final int pointerIndex = mEvent.findPointerIndex(pointerId);
|
||||||
|
|
||||||
MotionEvent lastExploreEvent = mInjectedPointerTracker.getLastInjectedHoverEvent();
|
MotionEvent lastExploreEvent =
|
||||||
|
mInjectedPointerTracker.getLastInjectedHoverEventForClick();
|
||||||
if (lastExploreEvent == null) {
|
if (lastExploreEvent == null) {
|
||||||
// No last touch explored event but there is accessibility focus in
|
// No last touch explored event but there is accessibility focus in
|
||||||
// the active window. We click in the middle of the focus bounds.
|
// the active window. We click in the middle of the focus bounds.
|
||||||
@ -1482,6 +1484,9 @@ public class TouchExplorer {
|
|||||||
// The last injected hover event.
|
// The last injected hover event.
|
||||||
private MotionEvent mLastInjectedHoverEvent;
|
private MotionEvent mLastInjectedHoverEvent;
|
||||||
|
|
||||||
|
// The last injected hover event used for performing clicks.
|
||||||
|
private MotionEvent mLastInjectedHoverEventForClick;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes an injected {@link MotionEvent} event.
|
* Processes an injected {@link MotionEvent} event.
|
||||||
*
|
*
|
||||||
@ -1513,6 +1518,10 @@ public class TouchExplorer {
|
|||||||
mLastInjectedHoverEvent.recycle();
|
mLastInjectedHoverEvent.recycle();
|
||||||
}
|
}
|
||||||
mLastInjectedHoverEvent = MotionEvent.obtain(event);
|
mLastInjectedHoverEvent = MotionEvent.obtain(event);
|
||||||
|
if (mLastInjectedHoverEventForClick != null) {
|
||||||
|
mLastInjectedHoverEventForClick.recycle();
|
||||||
|
}
|
||||||
|
mLastInjectedHoverEventForClick = MotionEvent.obtain(event);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
@ -1566,6 +1575,13 @@ public class TouchExplorer {
|
|||||||
return mLastInjectedHoverEvent;
|
return mLastInjectedHoverEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The the last injected hover event.
|
||||||
|
*/
|
||||||
|
public MotionEvent getLastInjectedHoverEventForClick() {
|
||||||
|
return mLastInjectedHoverEventForClick;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
|
Reference in New Issue
Block a user