Follow-up to I36faf679  Cancel pending messages related to suggestion updates.

bug: 3058217
Change-Id: I54e29bf051b76ad27e6d653adbf14892083ad7eb
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 4328b82..8eeae86 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -728,6 +728,14 @@
     }
 
     @Override
+    public void onFinishInputView(boolean finishingInput) {
+        super.onFinishInputView(finishingInput);
+        // Remove penging messages related to update suggestions
+        mHandler.removeMessages(MSG_UPDATE_SUGGESTIONS);
+        mHandler.removeMessages(MSG_UPDATE_OLD_SUGGESTIONS);
+    }
+
+    @Override
     public void onUpdateExtractedText(int token, ExtractedText text) {
         super.onUpdateExtractedText(token, text);
         InputConnection ic = getCurrentInputConnection();