Hide software input when the Activity is closed.

Input method manager does not close software input when the text
field focus is out. This is a workaround of Bug 20612313 by hiding
in onPause callback manually.

Bug: 20612313
Change-Id: I81d0c8e41b1df81c2383a361c56698a61afe89c8
diff --git a/src/com/android/contacts/activities/ContactEditorBaseActivity.java b/src/com/android/contacts/activities/ContactEditorBaseActivity.java
index 41b0c6b..ae9374d 100644
--- a/src/com/android/contacts/activities/ContactEditorBaseActivity.java
+++ b/src/com/android/contacts/activities/ContactEditorBaseActivity.java
@@ -38,6 +38,7 @@
 import android.provider.ContactsContract.Contacts;
 import android.provider.ContactsContract.RawContacts;
 import android.util.Log;
+import android.view.inputmethod.InputMethodManager;
 
 import java.util.ArrayList;
 
@@ -225,6 +226,15 @@
     }
 
     @Override
+    protected void onPause() {
+        super.onPause();
+        InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
+        if (imm != null) {
+            imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
+        }
+    }
+
+    @Override
     protected void onNewIntent(Intent intent) {
         super.onNewIntent(intent);