merge in klp-release history after reset to klp-dev
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index e954390..bae0341 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -141,6 +141,9 @@
                 <data android:mimeType="vnd.android.cursor.dir/contact" />
             </intent-filter>
 
+            <meta-data android:name="android.app.searchable"
+                android:resource="@xml/searchable"
+            />
         </activity>
 
         <activity android:name=".activities.ContactSelectionActivity"
diff --git a/res/layout/quickcontact_photo_container.xml b/res/layout/quickcontact_photo_container.xml
index 293278c..409b16e 100644
--- a/res/layout/quickcontact_photo_container.xml
+++ b/res/layout/quickcontact_photo_container.xml
@@ -68,13 +68,13 @@
             android:clickable="true"/>
         <TextView
             android:id="@+id/name"
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="42dip"
             android:layout_alignBottom="@id/photo"
             android:layout_alignLeft="@id/photo"
             android:layout_alignStart="@id/photo"
-            android:layout_toLeftOf="@id/open_details_button"
-            android:layout_toStartOf="@id/open_details_button"
+            android:layout_toLeftOf="@id/quickcontact_star_button"
+            android:layout_toStartOf="@id/quickcontact_star_button"
             android:gravity="center_vertical"
             android:paddingLeft="8dip"
             android:paddingStart="8dip"
diff --git a/res/values-hy-rAM/strings.xml b/res/values-hy-rAM/strings.xml
index 1a56481..9bce106 100644
--- a/res/values-hy-rAM/strings.xml
+++ b/res/values-hy-rAM/strings.xml
@@ -134,10 +134,10 @@
     <string name="no_contact_details" msgid="6636856378019344497">"Այս կոնտակտի համար չկան հավելյալ տվյալներ:"</string>
     <string name="group_read_only" msgid="1061762906115697637">"Խմբագրելի չէ այս սարքից:"</string>
     <string name="display_options_sort_list_by" msgid="6080091755852211076">"Դասավորել ցանկը ըստ"</string>
-    <string name="display_options_sort_by_given_name" msgid="184916793466387067">"Կոչված անունը"</string>
-    <string name="display_options_sort_by_family_name" msgid="7857986975275712622">"Ազգանունը"</string>
+    <string name="display_options_sort_by_given_name" msgid="184916793466387067">"Անունի"</string>
+    <string name="display_options_sort_by_family_name" msgid="7857986975275712622">"Ազգանունի"</string>
     <string name="display_options_view_names_as" msgid="4386932036180428374">"Դիտել կոնտակտի անունները"</string>
-    <string name="display_options_view_given_name_first" msgid="6968288511197363292">"Առաջինը՝ կոչված անունը"</string>
+    <string name="display_options_view_given_name_first" msgid="6968288511197363292">"Առաջինը՝ անունը"</string>
     <string name="display_options_view_family_name_first" msgid="1447288164951453714">"Առաջինը՝ ազգանունը"</string>
     <string name="take_photo" msgid="7496128293167402354">"Լուսանկարել"</string>
     <string name="take_new_photo" msgid="7341354729436576304">"Լուսանկարել նորը"</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index cedb547..8326603 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -85,6 +85,9 @@
     <!-- The tab label for the contact detail activity that displays information about the contact [CHAR LIMIT=15] -->
     <string name="contactDetailUpdates">Updates</string>
 
+    <!-- Hint text in the search box when the user hits the Search key while in the contacts app -->
+    <string name="searchHint">Search contacts</string>
+
     <!-- Menu item used to view the details for a specific contact -->
     <string name="menu_viewContact">View contact</string>
 
@@ -320,6 +323,9 @@
     <!-- Message in progress bar while exporting contact list to a file "(current number) of (total number) contacts" The order of "current number" and "total number" cannot be changed (like "total: (total number), current: (current number)")-->
     <string name="exporting_contact_list_progress"><xliff:g id="current_number">%s</xliff:g> of <xliff:g id="total_number">%s</xliff:g> contacts</string>
 
+    <!-- The string used to describe Contacts as a searchable item within system search settings. -->
+    <string name="search_settings_description">Names of your contacts</string>
+
     <!-- Shown as a toast when the user taps on a QuickContact icon, and no application
          was found that could perform the selected action. [CHAR LIMIT=NONE] -->
     <string name="quickcontact_missing_app">No app was found to handle this action.</string>
diff --git a/res/xml/searchable.xml b/res/xml/searchable.xml
new file mode 100644
index 0000000..3d6876e
--- /dev/null
+++ b/res/xml/searchable.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<searchable xmlns:android="http://schemas.android.com/apk/res/android"
+    android:label="@string/contactsList"
+    android:hint="@string/searchHint"
+    android:searchMode="queryRewriteFromText"
+
+    android:includeInGlobalSearch="true"
+    android:queryAfterZeroResults="true"
+    android:searchSuggestAuthority="com.android.contacts"
+    android:searchSuggestIntentAction="android.provider.Contacts.SEARCH_SUGGESTION_CLICKED"
+    android:searchSuggestIntentData="content://com.android.contacts/contacts/lookup"
+    android:searchSettingsDescription="@string/search_settings_description"
+>
+</searchable>
diff --git a/src/com/android/contacts/activities/AttachPhotoActivity.java b/src/com/android/contacts/activities/AttachPhotoActivity.java
index 678c1d2..78b482e 100644
--- a/src/com/android/contacts/activities/AttachPhotoActivity.java
+++ b/src/com/android/contacts/activities/AttachPhotoActivity.java
@@ -111,6 +111,9 @@
         if (mTempPhotoUri != null) {
             outState.putString(KEY_TEMP_PHOTO_URI, mTempPhotoUri.toString());
         }
+        if (mCroppedPhotoUri != null) {
+            outState.putString(KEY_CROPPED_PHOTO_URI, mCroppedPhotoUri.toString());
+        }
     }
 
     @Override
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 28d63ec..15e119b 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -387,15 +387,12 @@
             // If directory export support is not allowed, then don't allow the user to add
             // to contacts
             if (mContactData.getDirectoryExportSupport() == Directory.EXPORT_SUPPORT_NONE) {
-                mOpenDetailsOrAddContactImage.setImageResource(R.drawable.ic_contacts_holo_dark);
-                mOpenDetailsOrAddContactImage.setOnClickListener(mOpenDetailsClickHandler);
+                configureHeaderClickActions(false);
             } else {
-                mOpenDetailsOrAddContactImage.setImageResource(R.drawable.ic_add_contact_holo_dark);
-                mOpenDetailsOrAddContactImage.setOnClickListener(mAddToContactsClickHandler);
+                configureHeaderClickActions(true);
             }
         } else {
-            mOpenDetailsOrAddContactImage.setImageResource(R.drawable.ic_contacts_holo_dark);
-            mOpenDetailsOrAddContactImage.setOnClickListener(mOpenDetailsClickHandler);
+            configureHeaderClickActions(false);
             mStarImage.setVisibility(View.VISIBLE);
             mStarImage.setOnClickListener(new OnClickListener() {
                 @Override
@@ -545,6 +542,24 @@
     }
 
     /**
+     * Bind the correct image resource and click handlers to the header views
+     *
+     * @param canAdd Whether or not the user can directly add information in this quick contact
+     * to their local contacts
+     */
+    private void configureHeaderClickActions(boolean canAdd) {
+        if (canAdd) {
+            mOpenDetailsOrAddContactImage.setImageResource(R.drawable.ic_add_contact_holo_dark);
+            mOpenDetailsOrAddContactImage.setOnClickListener(mAddToContactsClickHandler);
+            mPhotoView.setOnClickListener(mAddToContactsClickHandler);
+        } else {
+            mOpenDetailsOrAddContactImage.setImageResource(R.drawable.ic_contacts_holo_dark);
+            mOpenDetailsOrAddContactImage.setOnClickListener(mOpenDetailsClickHandler);
+            mPhotoView.setOnClickListener(mOpenDetailsClickHandler);
+        }
+    }
+
+    /**
      * Inflate the in-track view for the action of the given MIME-type, collapsing duplicate values.
      * Will use the icon provided by the {@link DataKind}.
      */