am 91b50b81: merge in master-release history after reset to 4aecf0f557a805bb3f2715cade0ab15f6b99ad39

* commit '91b50b81967409ef25b3b1893f2a63c0c5355c53':
  Fix NPE in dispatchViewReleased
  Correctly bind contact tile listeners in PhoneFavoritesTileAdapter
  Reattach listener when fragment is destroyed and recreated
  Don't set search query immediately if searchview is null
diff --git a/res/drawable-hdpi/ic_add_person_dk.png b/res/drawable-hdpi/ic_add_person_dk.png
deleted file mode 100644
index 7096ed2..0000000
--- a/res/drawable-hdpi/ic_add_person_dk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_phone_dk.png b/res/drawable-hdpi/ic_phone_dk.png
deleted file mode 100644
index 984d6fa..0000000
--- a/res/drawable-hdpi/ic_phone_dk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_results_add_contact.png b/res/drawable-hdpi/ic_results_add_contact.png
new file mode 100644
index 0000000..472b281
--- /dev/null
+++ b/res/drawable-hdpi/ic_results_add_contact.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_results_phone.png b/res/drawable-hdpi/ic_results_phone.png
new file mode 100644
index 0000000..3a1a7a7
--- /dev/null
+++ b/res/drawable-hdpi/ic_results_phone.png
Binary files differ
diff --git a/res/drawable-hdpi/list_item_avatar_bg.png b/res/drawable-hdpi/list_item_avatar_bg.png
deleted file mode 100644
index 66e5f3e..0000000
--- a/res/drawable-hdpi/list_item_avatar_bg.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_add_person_dk.png b/res/drawable-mdpi/ic_add_person_dk.png
deleted file mode 100644
index 0e0aed0..0000000
--- a/res/drawable-mdpi/ic_add_person_dk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_phone_dk.png b/res/drawable-mdpi/ic_phone_dk.png
deleted file mode 100644
index c55571a..0000000
--- a/res/drawable-mdpi/ic_phone_dk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_results_add_contact.png b/res/drawable-mdpi/ic_results_add_contact.png
new file mode 100644
index 0000000..d4d4759
--- /dev/null
+++ b/res/drawable-mdpi/ic_results_add_contact.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_results_phone.png b/res/drawable-mdpi/ic_results_phone.png
new file mode 100644
index 0000000..74ccf14
--- /dev/null
+++ b/res/drawable-mdpi/ic_results_phone.png
Binary files differ
diff --git a/res/drawable-mdpi/list_item_avatar_bg.png b/res/drawable-mdpi/list_item_avatar_bg.png
deleted file mode 100644
index 640eb3e..0000000
--- a/res/drawable-mdpi/list_item_avatar_bg.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_add_person_dk.png b/res/drawable-xhdpi/ic_add_person_dk.png
deleted file mode 100644
index 5211f5c..0000000
--- a/res/drawable-xhdpi/ic_add_person_dk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_phone_dk.png b/res/drawable-xhdpi/ic_phone_dk.png
deleted file mode 100644
index 74a7032..0000000
--- a/res/drawable-xhdpi/ic_phone_dk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_results_add_contact.png b/res/drawable-xhdpi/ic_results_add_contact.png
new file mode 100644
index 0000000..6be67e8
--- /dev/null
+++ b/res/drawable-xhdpi/ic_results_add_contact.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_results_phone.png b/res/drawable-xhdpi/ic_results_phone.png
new file mode 100644
index 0000000..0e24fa4
--- /dev/null
+++ b/res/drawable-xhdpi/ic_results_phone.png
Binary files differ
diff --git a/res/drawable-xhdpi/list_item_avatar_bg.png b/res/drawable-xhdpi/list_item_avatar_bg.png
deleted file mode 100644
index cac7fbd..0000000
--- a/res/drawable-xhdpi/list_item_avatar_bg.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_add_person_dk.png b/res/drawable-xxhdpi/ic_add_person_dk.png
deleted file mode 100644
index 54ca1f0..0000000
--- a/res/drawable-xxhdpi/ic_add_person_dk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_phone_dk.png b/res/drawable-xxhdpi/ic_phone_dk.png
deleted file mode 100644
index de9387d..0000000
--- a/res/drawable-xxhdpi/ic_phone_dk.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_results_add_contact.png b/res/drawable-xxhdpi/ic_results_add_contact.png
new file mode 100644
index 0000000..3ba9093
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_results_add_contact.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_results_phone.png b/res/drawable-xxhdpi/ic_results_phone.png
new file mode 100644
index 0000000..9594619
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_results_phone.png
Binary files differ
diff --git a/res/drawable-xxhdpi/list_item_avatar_bg.png b/res/drawable-xxhdpi/list_item_avatar_bg.png
deleted file mode 100644
index fcfe2da..0000000
--- a/res/drawable-xxhdpi/list_item_avatar_bg.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/call_log_background.xml b/res/drawable/call_log_background.xml
index c0c4889..4857fb5 100644
--- a/res/drawable/call_log_background.xml
+++ b/res/drawable/call_log_background.xml
@@ -15,5 +15,5 @@
      limitations under the License.
 -->
 <ripple xmlns:android="http://schemas.android.com/apk/res/android"
-                android:tint="?android:attr/colorControlHighlight"
-                android:pinned="false" />
+    android:tint="?android:attr/colorControlHighlight"
+    android:pinned="false" />
\ No newline at end of file
diff --git a/res/drawable/ic_search_add_contact.xml b/res/drawable/ic_search_add_contact.xml
new file mode 100644
index 0000000..2ec75b7
--- /dev/null
+++ b/res/drawable/ic_search_add_contact.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2014 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+    android:src="@drawable/ic_results_add_contact"
+    android:tint="@color/search_shortcut_icon_color" />
diff --git a/res/drawable/ic_search_phone.xml b/res/drawable/ic_search_phone.xml
new file mode 100644
index 0000000..ac90532
--- /dev/null
+++ b/res/drawable/ic_search_phone.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2014 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.
+-->
+
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+    android:src="@drawable/ic_results_phone"
+    android:tint="@color/search_shortcut_icon_color" />
diff --git a/res/drawable/recent_lists_footer_background.xml b/res/drawable/recent_lists_footer_background.xml
new file mode 100644
index 0000000..566e353
--- /dev/null
+++ b/res/drawable/recent_lists_footer_background.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+  ~ Copyright (C) 2014 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
+  -->
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+    android:tint="?android:attr/colorControlHighlight"
+    android:pinned="false">
+    <!-- Mask to constrain the ripple to the bounds of the view. -->
+    <item android:drawable="@android:color/transparent" />
+</ripple>
diff --git a/res/drawable/search_shortcut_background.xml b/res/drawable/search_shortcut_background.xml
new file mode 100644
index 0000000..52b5e3f
--- /dev/null
+++ b/res/drawable/search_shortcut_background.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2014 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.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval" >
+    <size
+        android:height="@dimen/search_shortcut_radius"
+        android:width="@dimen/search_shortcut_radius" />
+    <solid android:color="@color/search_shortcut_background_color" />
+</shape>
\ No newline at end of file
diff --git a/res/layout/call_log_fragment.xml b/res/layout/call_log_fragment.xml
index 7b6aa28..fb7ed2a 100644
--- a/res/layout/call_log_fragment.xml
+++ b/res/layout/call_log_fragment.xml
@@ -71,7 +71,6 @@
             android:background="@color/background_dialer_list_items"
             android:divider="@null"
             android:nestedScrollingEnabled="true"
-            android:clipChildren="false"
         />
         <TextView android:id="@android:id/empty"
             android:layout_width="match_parent"
diff --git a/res/layout/call_log_list_item.xml b/res/layout/call_log_list_item.xml
index 9182bd7..bdf1477 100644
--- a/res/layout/call_log_list_item.xml
+++ b/res/layout/call_log_list_item.xml
@@ -14,16 +14,14 @@
      limitations under the License.
 -->
 
-<view
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<view xmlns:android="http://schemas.android.com/apk/res/android"
     class="com.android.dialer.calllog.CallLogListItemView"
+    android:id="@+id/call_log_list_item"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:paddingBottom="@dimen/call_log_outer_margin"
-    android:id="@+id/call_log_list_item"
     android:orientation="vertical"
-    android:clipChildren="false"
->
+    android:background="@color/background_dialer_list_items" >
+
     <!-- Day group heading. Used to show a "today", "yesterday", "last week" or "other" heading
          above a group of call log entries. -->
     <TextView
@@ -37,17 +35,16 @@
         android:paddingTop="@dimen/call_log_day_group_padding"
         android:paddingBottom="0dp"
         />
+
     <!-- Linear layout to separate the primary area containing the contact badge and caller
          information and the secondary action (call details / play voicemail). -->
     <LinearLayout
         android:id="@+id/call_log_row"
-        android:background="@color/background_dialer_list_items"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:baselineAligned="false"
         android:orientation="vertical"
-        android:gravity="center_vertical"
-        >
+        android:gravity="center_vertical" >
 
         <!-- Primary area containing the contact badge and caller information -->
         <LinearLayout
@@ -55,15 +52,15 @@
             android:background="@drawable/call_log_background"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:paddingLeft="@dimen/call_log_outer_margin"
-            android:paddingRight="@dimen/call_log_outer_margin"
+            android:paddingStart="@dimen/call_log_outer_margin"
+            android:paddingEnd="@dimen/call_log_outer_margin"
             android:paddingTop="@dimen/call_log_outer_margin"
+            android:paddingBottom="@dimen/call_log_outer_margin"
             android:orientation="horizontal"
             android:gravity="center_vertical"
             android:focusable="true"
             android:nextFocusRight="@+id/call_back_action"
-            android:nextFocusLeft="@+id/quick_contact_photo"
-            >
+            android:nextFocusLeft="@+id/quick_contact_photo" >
             <QuickContactBadge
                 android:id="@+id/quick_contact_photo"
                 android:layout_width="@dimen/call_log_list_contact_photo_size"
diff --git a/res/layout/recents_list_footer.xml b/res/layout/recents_list_footer.xml
index 6156456..7670d81 100644
--- a/res/layout/recents_list_footer.xml
+++ b/res/layout/recents_list_footer.xml
@@ -30,4 +30,4 @@
     android:textColor="@color/view_full_call_history_color"
     android:textSize="14sp"
     android:text="@string/recents_footer_text"
-    android:background="?android:attr/selectableItemBackground" />
+    android:background="@drawable/recent_lists_footer_background" />
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 5b708b6..e064144 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -47,6 +47,9 @@
     <!-- Background color of dialer list items (contacts, call log entries) -->
     <color name="background_dialer_list_items">#fbfbfb</color>
 
+    <color name="search_shortcut_background_color">#b6b6b6</color>
+    <color name="search_shortcut_icon_color">#f8f8f8</color>
+
     <!-- Dark variant of the action bar color. -->
     <color name="actionbar_background_color_dark">#008aa1</color>
 
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 6d7aa84..afb5b2a 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -30,7 +30,7 @@
     <dimen name="call_log_call_action_width">54dp</dimen>
     <dimen name="call_log_icon_margin">4dip</dimen>
     <dimen name="call_log_inner_margin">8dip</dimen>
-    <dimen name="call_log_outer_margin">8dip</dimen>
+    <dimen name="call_log_outer_margin">8dp</dimen>
     <dimen name="call_log_indent_margin">24dip</dimen>
     <dimen name="call_log_list_item_height">56dip</dimen>
     <dimen name="call_log_list_contact_photo_size">40dip</dimen>
@@ -130,8 +130,11 @@
     <dimen name="call_log_secondary_text_size">14sp</dimen>
     <!-- Height of the call log actions section for each call log entry -->
     <dimen name="call_log_action_height">48dp</dimen>
-    <!-- Elevation of expanded call log items. -->
-    <dimen name="call_log_expanded_elevation">4dp</dimen>
+    <!-- Z Translation of expanded call log items. -->
+    <dimen name="call_log_expanded_translation_z">4dp</dimen>
     <!-- Padding above call log day group headers. -->
     <dimen name="call_log_day_group_padding">16dp</dimen>
+
+    <!-- Size of icon for contacts number shortcuts -->
+    <dimen name="search_shortcut_radius">40dp</dimen>
 </resources>
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 66c4d03..12d5531 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -865,8 +865,8 @@
             views.actionsView.setAlpha(1.0f);
             views.callLogEntryView.setBackgroundColor(
                     callLogItem.getResources().getColor(R.color.background_dialer_light));
-            views.callLogEntryView.setElevation(
-                    callLogItem.getResources().getDimension(R.dimen.call_log_expanded_elevation));
+            views.callLogEntryView.setTranslationZ(callLogItem.getResources().getDimension(
+                    R.dimen.call_log_expanded_translation_z));
 
             // Attempt to give accessibility focus to one of the action buttons.
             // This ensures that a user realizes the expansion occurred.
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java
index 232aa39..240de85 100644
--- a/src/com/android/dialer/calllog/CallLogFragment.java
+++ b/src/com/android/dialer/calllog/CallLogFragment.java
@@ -26,6 +26,7 @@
 import android.content.Intent;
 import android.database.ContentObserver;
 import android.database.Cursor;
+import android.graphics.Outline;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
@@ -94,7 +95,11 @@
     private boolean mCallLogFetched;
     private boolean mVoicemailStatusFetched;
 
-    private float mExpandedItemElevation;
+    private float mExpandedItemTranslationZ;
+    private int mFadeInDuration;
+    private int mFadeInStartDelay;
+    private int mFadeOutDuration;
+    private int mExpandCollapseDuration;
 
     private final Handler mHandler = new Handler();
 
@@ -195,7 +200,13 @@
         setHasOptionsMenu(true);
         updateCallList(mCallTypeFilter, mDateLimit);
 
-        mExpandedItemElevation = getResources().getDimension(R.dimen.call_log_expanded_elevation);
+        mExpandedItemTranslationZ =
+                getResources().getDimension(R.dimen.call_log_expanded_translation_z);
+        mFadeInDuration = getResources().getInteger(R.integer.call_log_actions_fade_in_duration);
+        mFadeInStartDelay = getResources().getInteger(R.integer.call_log_actions_fade_start);
+        mFadeOutDuration = getResources().getInteger(R.integer.call_log_actions_fade_out_duration);
+        mExpandCollapseDuration = getResources().getInteger(
+                R.integer.call_log_expand_collapse_duration);
     }
 
     /** Called by the CallLogQueryHandler when the list of calls has been fetched or updated. */
@@ -578,27 +589,36 @@
                     viewHolder.actionsView.setVisibility(View.VISIBLE);
                 }
 
+                // If the day group header is shown, subtract the header from the outline of the
+                // view. The outline is used for generating the shadow of the view, but we only want
+                // a shadow on the call log list item and not the header. This is a slight hack, but
+                // the hierarchy of the call log list items makes it hard to achieve the desired
+                // shadow behavior otherwise.
+                if (viewHolder.dayGroupHeader.isShown()) {
+                    Outline outline = new Outline();
+                    outline.setRect(
+                            0 /* left */,
+                            viewHolder.dayGroupHeader.getHeight() /* top */,
+                            view.getWidth() /* right */,
+                            view.getHeight() /* bottom */);
+                    view.setOutline(outline);
+                }
+
                 // Set up the fade effect for the action buttons.
                 if (isExpand) {
-                    int fadeDuration = getResources().getInteger(
-                            R.integer.call_log_actions_fade_in_duration);
-                    int startDelay = getResources().getInteger(
-                            R.integer.call_log_actions_fade_start);
                     // Start the fade in after the expansion has partly completed, otherwise it
                     // will be mostly over before the expansion completes.
                     viewHolder.actionsView.setAlpha(0f);
                     viewHolder.actionsView.animate()
                             .alpha(1f)
-                            .setStartDelay(startDelay)
-                            .setDuration(fadeDuration)
+                            .setStartDelay(mFadeInStartDelay)
+                            .setDuration(mFadeInDuration)
                             .start();
                 } else {
-                    int fadeDuration = getResources().getInteger(
-                            R.integer.call_log_actions_fade_out_duration);
                     viewHolder.actionsView.setAlpha(1f);
                     viewHolder.actionsView.animate()
                             .alpha(0f)
-                            .setDuration(fadeDuration)
+                            .setDuration(mFadeOutDuration)
                             .start();
                 }
                 view.requestLayout();
@@ -613,10 +633,8 @@
                         Float value = (Float) animator.getAnimatedValue();
 
                         // For each value from 0 to 1, animate the various parts of the layout.
-                        view.getLayoutParams().height =
-                                (int) (value * distance + baseHeight);
-                        viewHolder.callLogEntryView
-                                .setElevation(mExpandedItemElevation * value);
+                        view.getLayoutParams().height = (int) (value * distance + baseHeight);
+                        view.setTranslationZ(mExpandedItemTranslationZ * value);
                         view.requestLayout();
                     }
                 });
@@ -632,17 +650,14 @@
                     }
 
                     @Override
-                    public void onAnimationCancel(Animator animation) {}
+                    public void onAnimationCancel(Animator animation) { }
                     @Override
                     public void onAnimationRepeat(Animator animation) { }
                     @Override
                     public void onAnimationStart(Animator animation) { }
                 });
 
-                final int expandCollapseDuration = getResources().getInteger(
-                        R.integer.call_log_expand_collapse_duration);
-
-                animator.setDuration(expandCollapseDuration);
+                animator.setDuration(mExpandCollapseDuration);
                 animator.start();
 
                 // Return false so this draw does not occur to prevent the final frame from
diff --git a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java
index 533a134..abceda4 100644
--- a/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java
+++ b/src/com/android/dialer/list/DialerPhoneNumberListAdapter.java
@@ -139,16 +139,16 @@
         switch (shortcutType) {
             case SHORTCUT_DIRECT_CALL:
                 text = resources.getString(R.string.search_shortcut_call_number, number);
-                drawableId = R.drawable.ic_phone_dk;
+                drawableId = R.drawable.ic_search_phone;
                 break;
             case SHORTCUT_ADD_NUMBER_TO_CONTACTS:
                 text = resources.getString(R.string.search_shortcut_add_to_contacts);
-                drawableId = R.drawable.ic_add_person_dk;
+                drawableId = R.drawable.ic_search_add_contact;
                 break;
             default:
                 throw new IllegalArgumentException("Invalid shortcut type");
         }
-        v.setDrawableResource(R.drawable.list_item_avatar_bg, drawableId);
+        v.setDrawableResource(R.drawable.search_shortcut_background, drawableId);
         v.setDisplayName(text);
         v.setPhotoPosition(super.getPhotoPosition());
     }