Merge "Import translations. DO NOT MERGE" into lmp-mr1-dev
diff --git a/src/com/android/contacts/ContactSaveService.java b/src/com/android/contacts/ContactSaveService.java
index 02a2471..7d355cd 100644
--- a/src/com/android/contacts/ContactSaveService.java
+++ b/src/com/android/contacts/ContactSaveService.java
@@ -182,6 +182,10 @@
 
     @Override
     protected void onHandleIntent(Intent intent) {
+        if (intent == null) {
+            Log.d(TAG, "onHandleIntent: could not handle null intent");
+            return;
+        }
         // Call an appropriate method. If we're sure it affects how incoming phone calls are
         // handled, then notify the fact to in-call screen.
         String action = intent.getAction();
diff --git a/src/com/android/contacts/activities/ActionBarAdapter.java b/src/com/android/contacts/activities/ActionBarAdapter.java
index 634f9ad..4b9e83f 100644
--- a/src/com/android/contacts/activities/ActionBarAdapter.java
+++ b/src/com/android/contacts/activities/ActionBarAdapter.java
@@ -30,7 +30,6 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.inputmethod.InputMethodManager;
-import android.widget.SearchView;
 import android.widget.SearchView.OnCloseListener;
 import android.view.View.OnClickListener;
 import android.widget.EditText;
@@ -253,7 +252,11 @@
                 return;
             }
             if (mSearchMode) {
+                mSearchView.setEnabled(true);
                 setFocusOnSearchView();
+            } else {
+                // Disable search view, so that it doesn't keep the IME visible.
+                mSearchView.setEnabled(false);
             }
             setQueryString(null);
         } else if (flag) {
@@ -399,18 +402,6 @@
         outState.putInt(EXTRA_KEY_SELECTED_TAB, mCurrentTab);
     }
 
-    /**
-     * Clears the focus from the {@link SearchView} if we are in search mode.
-     * This will suppress the IME if it is visible.
-     */
-    public void clearFocusOnSearchView() {
-        if (isSearchMode()) {
-            if (mSearchView != null) {
-                mSearchView.clearFocus();
-            }
-        }
-    }
-
     public void setFocusOnSearchView() {
         mSearchView.requestFocus();
         showInputMethod(mSearchView); // Workaround for the "IME not popping up" issue.
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index 4ff6b9e..ffe5016 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -1454,7 +1454,7 @@
     public static interface Listener {
         /**
          * Contact was not found, so somehow close this fragment. This is raised after a contact
-         * is removed via Menu/Delete (unless it was a new contact)
+         * is removed via Menu/Delete
          */
         void onContactNotFound();
 
@@ -1811,7 +1811,7 @@
         outState.putBoolean(KEY_EXISTING_CONTACT_READY, mExistingContactDataReady);
         outState.putParcelableArrayList(KEY_RAW_CONTACTS,
                 mRawContacts == null ?
-                Lists.<RawContact> newArrayList() :  Lists.newArrayList(mRawContacts));
+                Lists.<RawContact>newArrayList() : Lists.newArrayList(mRawContacts));
         outState.putBoolean(KEY_SEND_TO_VOICE_MAIL_STATE, mSendToVoicemailState);
         outState.putString(KEY_CUSTOM_RINGTONE, mCustomRingtone);
         outState.putBoolean(KEY_ARE_PHONE_OPTIONS_CHANGEABLE, mArePhoneOptionsChangable);
@@ -1968,8 +1968,9 @@
             final long loaderCurrentTime = SystemClock.elapsedRealtime();
             Log.v(TAG, "Time needed for loading: " + (loaderCurrentTime-mLoaderStartTime));
             if (!data.isLoaded()) {
-                // Item has been deleted
+                // Item has been deleted. Close activity without saving again.
                 Log.i(TAG, "No contact found. Closing activity");
+                mStatus = Status.CLOSING;
                 if (mListener != null) mListener.onContactNotFound();
                 return;
             }