Merge "Import revised translations." into honeycomb
diff --git a/res/layout/contact_picker.xml b/res/layout/contact_picker.xml
index 671b766..b226b4f 100644
--- a/res/layout/contact_picker.xml
+++ b/res/layout/contact_picker.xml
@@ -14,8 +14,9 @@
      limitations under the License.
 -->
 
-<LinearLayout
+<view
     xmlns:android="http://schemas.android.com/apk/res/android"
+    class="com.android.contacts.widget.FullHeightLinearLayout"
     style="@style/ContactPickerLayout"
     android:paddingLeft="32dip"
     android:paddingRight="32dip"
@@ -48,4 +49,4 @@
             android:layout_height="wrap_content"
             android:text="@android:string/cancel"/>
     </LinearLayout>
-</LinearLayout>
+</view>
diff --git a/src/com/android/contacts/activities/ShowOrCreateActivity.java b/src/com/android/contacts/activities/ShowOrCreateActivity.java
index ea4fda9..f47d42aa 100755
--- a/src/com/android/contacts/activities/ShowOrCreateActivity.java
+++ b/src/com/android/contacts/activities/ShowOrCreateActivity.java
@@ -25,6 +25,7 @@
 import android.app.Activity;
 import android.app.AlertDialog;
 import android.app.Dialog;
+import android.app.SearchManager;
 import android.content.ComponentName;
 import android.content.DialogInterface;
 import android.content.Intent;
@@ -122,12 +123,14 @@
         // Handle specific query request
         if (Constants.SCHEME_MAILTO.equals(scheme)) {
             mCreateExtras.putString(Intents.Insert.EMAIL, ssp);
+            mCreateExtras.putString(SearchManager.QUERY, ssp);
 
             Uri uri = Uri.withAppendedPath(Email.CONTENT_FILTER_URI, Uri.encode(ssp));
             mQueryHandler.startQuery(QUERY_TOKEN, null, uri, CONTACTS_PROJECTION, null, null, null);
 
         } else if (Constants.SCHEME_TEL.equals(scheme)) {
             mCreateExtras.putString(Intents.Insert.PHONE, ssp);
+            mCreateExtras.putString(SearchManager.QUERY, ssp);
 
             Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, ssp);
             mQueryHandler.startQuery(QUERY_TOKEN, null, uri, PHONES_PROJECTION, null, null, null);
diff --git a/src/com/android/contacts/list/ContactListItemView.java b/src/com/android/contacts/list/ContactListItemView.java
index 2d75eca..6f3db81 100644
--- a/src/com/android/contacts/list/ContactListItemView.java
+++ b/src/com/android/contacts/list/ContactListItemView.java
@@ -33,6 +33,7 @@
 import android.provider.ContactsContract.CommonDataKinds.Email;
 import android.provider.ContactsContract.CommonDataKinds.Nickname;
 import android.provider.ContactsContract.CommonDataKinds.Organization;
+import android.provider.ContactsContract.CommonDataKinds.Phone;
 import android.provider.ContactsContract.Contacts;
 import android.text.SpannableString;
 import android.text.TextUtils;
@@ -866,10 +867,12 @@
             int summarySnippetData1ColumnIndex, int summarySnippetData4ColumnIndex) {
         String snippet = null;
         String snippetMimeType = cursor.getString(summarySnippetMimetypeColumnIndex);
-        if (Email.CONTENT_ITEM_TYPE.equals(snippetMimeType)) {
-            String email = cursor.getString(summarySnippetData1ColumnIndex);
-            if (!TextUtils.isEmpty(email)) {
-                snippet = email;
+        if (Email.CONTENT_ITEM_TYPE.equals(snippetMimeType)
+                || Nickname.CONTENT_ITEM_TYPE.equals(snippetMimeType)
+                || Phone.CONTENT_ITEM_TYPE.equals(snippetMimeType)) {
+            String value = cursor.getString(summarySnippetData1ColumnIndex);
+            if (!TextUtils.isEmpty(value)) {
+                snippet = value;
             }
         } else if (Organization.CONTENT_ITEM_TYPE.equals(snippetMimeType)) {
             String company = cursor.getString(summarySnippetData1ColumnIndex);
@@ -883,11 +886,6 @@
             } else if (!TextUtils.isEmpty(title)) {
                 snippet = title;
             }
-        } else if (Nickname.CONTENT_ITEM_TYPE.equals(snippetMimeType)) {
-            String nickname = cursor.getString(summarySnippetData1ColumnIndex);
-            if (!TextUtils.isEmpty(nickname)) {
-                snippet = nickname;
-            }
         }
 
         setSnippet(snippet);
diff --git a/src/com/android/contacts/widget/FullHeightLinearLayout.java b/src/com/android/contacts/widget/FullHeightLinearLayout.java
new file mode 100644
index 0000000..f9548a6
--- /dev/null
+++ b/src/com/android/contacts/widget/FullHeightLinearLayout.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+package com.android.contacts.widget;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.LinearLayout;
+
+/**
+ * A custom layout for dialogs that need to be stretched to the full height of the screen.
+ * It overrides the height measure specification to ignore "wrap_content" and
+ * do "match_parent" instead.  The "wrap_content" part is hard-coded in the framework
+ * implementation of the dialog theme.
+ */
+public final class FullHeightLinearLayout extends LinearLayout {
+
+    public FullHeightLinearLayout(Context context) {
+        super(context);
+    }
+
+    public FullHeightLinearLayout(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public FullHeightLinearLayout(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        if (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.AT_MOST) {
+            heightMeasureSpec = MeasureSpec.makeMeasureSpec(
+                    MeasureSpec.getSize(heightMeasureSpec), MeasureSpec.EXACTLY);
+        }
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+    }
+}