Clear TextView error when text changes

This change also fixes another bug where error popup
is cleared when cursor moves using dpad, even though
the text is not changed.

Bug: 15538489
Bug: 3370191
Change-Id: I2804b90178e77ced46477a594331ae1f7306717a
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index a82fa65..7d3d2eb 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -5712,8 +5712,6 @@
         }
 
         if (mEditor != null && mEditor.mKeyListener != null) {
-            resetErrorChangedFlag();
-
             boolean doDown = true;
             if (otherEvent != null) {
                 try {
@@ -7630,6 +7628,7 @@
                 list.get(i).afterTextChanged(text);
             }
         }
+        hideErrorIfUnchanged();
     }
 
     void updateAfterEdit() {
@@ -7669,7 +7668,7 @@
             }
             ims.mChangedDelta += after-before;
         }
-
+        resetErrorChangedFlag();
         sendOnTextChanged(buffer, start, before, after);
         onTextChanged(buffer, start, before, after);
     }