Delaying visibility of search view to suppress soft keyboard

Bug: 3280179
Change-Id: Iec681136b45fcbc20463f698996f37a0bb736a2a
diff --git a/src/com/android/contacts/activities/ContactSelectionActivity.java b/src/com/android/contacts/activities/ContactSelectionActivity.java
index 907edd3..4efc43f 100644
--- a/src/com/android/contacts/activities/ContactSelectionActivity.java
+++ b/src/com/android/contacts/activities/ContactSelectionActivity.java
@@ -54,6 +54,9 @@
     private static final String KEY_ACTION_CODE = "actionCode";
     private static final int DEFAULT_DIRECTORY_RESULT_LIMIT = 20;
 
+    // Delay to allow the UI to settle before making search view visible
+    private static final int FOCUS_DELAY = 200;
+
     private ContactsIntentResolver mIntentResolver;
     protected ContactEntryListFragment<?> mListFragment;
 
@@ -116,13 +119,13 @@
             // at this point.  If search view were visible, it would always grabs focus
             // because it is the first focusable widget in the window.
             mSearchView.setVisibility(View.INVISIBLE);
-            mSearchView.post(new Runnable() {
+            mSearchView.postDelayed(new Runnable() {
 
                 @Override
                 public void run() {
                     mSearchView.setVisibility(View.VISIBLE);
                 }
-            });
+            }, FOCUS_DELAY);
         }
 
         Button cancel = (Button) findViewById(R.id.cancel);