am c3493382: Merge "Cancel all ongoing event when onFinishInputView"

* commit 'c34933828efc2fcb711be4bb7b2b9d7508c4e311':
  Cancel all ongoing event when onFinishInputView
main
Tadashi G. Takaoka 2013-07-25 04:09:58 -07:00 committed by Android Git Automerger
commit 3b1e8d55c6
4 changed files with 15 additions and 8 deletions

View File

@ -1206,15 +1206,18 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
eventTag + eventTime + "," + id + "," + x + "," + y + "," + size + "," + pressure);
}
public void cancelAllMessages() {
public void cancelAllOngoingEvents() {
mKeyTimerHandler.cancelAllMessages();
mDrawingHandler.cancelAllMessages();
dismissAllKeyPreviews();
dismissGestureFloatingPreviewText();
dismissSlidingKeyInputPreview();
PointerTracker.dismissAllMoreKeysPanels();
PointerTracker.cancelAllPointerTrackers();
}
public void closing() {
dismissAllKeyPreviews();
cancelAllMessages();
PointerTracker.dismissAllMoreKeysPanels();
cancelAllOngoingEvents();
mMoreKeysKeyboardCache.clear();
}

View File

@ -413,6 +413,10 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
return sPointerTrackerQueue.isAnyInSlidingKeyInput();
}
public static void cancelAllPointerTrackers() {
sPointerTrackerQueue.cancelAllPointerTrackers();
}
public static void setKeyboardActionListener(final KeyboardActionListener listener) {
final int trackersSize = sTrackers.size();
for (int i = 0; i < trackersSize; ++i) {
@ -833,7 +837,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
}
private void cancelBatchInput() {
sPointerTrackerQueue.cancelAllPointerTracker();
cancelAllPointerTrackers();
mIsDetectingGesture = false;
if (!sInGesture) {
return;
@ -1273,7 +1277,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
}
cancelBatchInput();
sPointerTrackerQueue.cancelAllPointerTracker();
cancelAllPointerTrackers();
sPointerTrackerQueue.releaseAllPointers(eventTime);
onCancelEventInternal();
}

View File

@ -207,7 +207,7 @@ public final class PointerTrackerQueue {
}
}
public void cancelAllPointerTracker() {
public void cancelAllPointerTrackers() {
synchronized (mExpandableArrayOfActivePointers) {
if (DEBUG) {
Log.d(TAG, "cancelAllPointerTracker: " + this);

View File

@ -886,7 +886,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mKeyboardSwitcher.onFinishInputView();
final MainKeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
if (mainKeyboardView != null) {
mainKeyboardView.cancelAllMessages();
mainKeyboardView.cancelAllOngoingEvents();
}
// Remove pending messages related to update suggestions
mHandler.cancelUpdateSuggestionStrip();