Fix for search UI remaining on screen after call is made

Also slide up the action bar after it is faded out - this is so that
it doesn't remain in the same position and intercept touches

Remove unneeded FragmentTransaction fadeout animation in exitSearchUI
that was causing jank when returning to the favorites screen

Bug: 15120649

Change-Id: Idcf96c2339603af09e1773729994d267158f70a0
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java
index 82b7838..b7772c1 100644
--- a/src/com/android/dialer/DialtactsActivity.java
+++ b/src/com/android/dialer/DialtactsActivity.java
@@ -263,10 +263,11 @@
                 // no need to do anything here.
                 return;
             }
-            mSearchQuery = newText;
             if (DEBUG) {
                 Log.d(TAG, "onTextChange for mSearchView called with new query: " + newText);
+                Log.d(TAG, "Previous Query: " + mSearchQuery);
             }
+            mSearchQuery = newText;
 
             // Show search fragment only when the query string is changed to non-empty text.
             if (!TextUtils.isEmpty(newText)) {
@@ -687,8 +688,11 @@
     }
 
     private void hideDialpadAndSearchUi() {
-        mSearchView.setText(null);
-        hideDialpadFragment(false, true);
+        if (mIsDialpadShown) {
+            hideDialpadFragment(false, true);
+        } else {
+            exitSearchUi();
+        }
     }
 
     private void hideInputMethod(View view) {
@@ -873,7 +877,6 @@
         setNotInSearchUi();
 
         final FragmentTransaction transaction = getFragmentManager().beginTransaction();
-        transaction.setCustomAnimations(0, android.R.animator.fade_out);
         if (mSmartDialSearchFragment != null) {
             transaction.remove(mSmartDialSearchFragment);
         }