Merge "Use framework style for section headers and visual tweaks"
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 40d5c26..01a6f95 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -597,7 +597,7 @@
         <!-- vCard related -->
         <activity android:name=".vcard.ImportVCardActivity"
             android:configChanges="orientation|screenSize|keyboardHidden"
-            android:theme="@style/BackgroundOnly">
+            android:theme="@style/BackgroundOnlyTheme">
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
                 <data android:mimeType="text/directory" />
@@ -610,7 +610,7 @@
 
         <activity android:name=".vcard.NfcImportVCardActivity"
             android:configChanges="orientation|screenSize|keyboardHidden"
-            android:theme="@style/BackgroundOnly">
+            android:theme="@style/BackgroundOnlyTheme">
             <intent-filter>
                 <action android:name="android.nfc.action.NDEF_DISCOVERED" />
                 <data android:mimeType="text/vcard" />
@@ -621,13 +621,13 @@
         </activity>
 
         <activity android:name=".vcard.CancelActivity"
-            android:theme="@style/BackgroundOnly" />
+            android:theme="@style/BackgroundOnlyTheme" />
 
         <activity android:name=".vcard.SelectAccountActivity"
-            android:theme="@style/BackgroundOnly" />
+            android:theme="@style/BackgroundOnlyTheme" />
 
         <activity android:name=".vcard.ExportVCardActivity"
-            android:theme="@style/BackgroundOnly" />
+            android:theme="@style/BackgroundOnlyTheme" />
 
         <service
             android:name=".vcard.VCardService"
diff --git a/res/drawable-hdpi/change_photo_box_normal_holo_light.9.png b/res/drawable-hdpi/change_photo_box_normal_holo_light.9.png
deleted file mode 100644
index f026cc8..0000000
--- a/res/drawable-hdpi/change_photo_box_normal_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/change_photo_box_pressed_holo_light.9.png b/res/drawable-hdpi/change_photo_box_pressed_holo_light.9.png
deleted file mode 100644
index a0770ea..0000000
--- a/res/drawable-hdpi/change_photo_box_pressed_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/directory_bg.9.png b/res/drawable-hdpi/directory_bg.9.png
deleted file mode 100644
index f0a92d4..0000000
--- a/res/drawable-hdpi/directory_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/directory_bg_holo.9.png b/res/drawable-hdpi/directory_bg_holo.9.png
deleted file mode 100644
index 7f7209d..0000000
--- a/res/drawable-hdpi/directory_bg_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_menu_compose_holo_light.png b/res/drawable-hdpi/ic_menu_compose_holo_light.png
deleted file mode 100644
index 07ab787..0000000
--- a/res/drawable-hdpi/ic_menu_compose_holo_light.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_menu_done_holo_light.png b/res/drawable-hdpi/ic_menu_done_holo_light.png
deleted file mode 100644
index 89c6e04..0000000
--- a/res/drawable-hdpi/ic_menu_done_holo_light.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/infobar_dark.9.png b/res/drawable-hdpi/infobar_dark.9.png
deleted file mode 100644
index 5a08290..0000000
--- a/res/drawable-hdpi/infobar_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/section_header.9.png b/res/drawable-hdpi/section_header.9.png
deleted file mode 100644
index 8cd231b..0000000
--- a/res/drawable-hdpi/section_header.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/sym_action_audiochat_holo_dark.png b/res/drawable-hdpi/sym_action_audiochat_holo_dark.png
deleted file mode 100644
index d4e3329..0000000
--- a/res/drawable-hdpi/sym_action_audiochat_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/sym_action_sms.png b/res/drawable-hdpi/sym_action_sms.png
deleted file mode 100644
index 9f18105..0000000
--- a/res/drawable-hdpi/sym_action_sms.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/sym_action_videochat_holo_dark.png b/res/drawable-hdpi/sym_action_videochat_holo_dark.png
deleted file mode 100644
index 821940a..0000000
--- a/res/drawable-hdpi/sym_action_videochat_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/change_photo_box_normal_holo_light.9.png b/res/drawable-mdpi/change_photo_box_normal_holo_light.9.png
deleted file mode 100644
index 591e6d5..0000000
--- a/res/drawable-mdpi/change_photo_box_normal_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/change_photo_box_pressed_holo_light.9.png b/res/drawable-mdpi/change_photo_box_pressed_holo_light.9.png
deleted file mode 100644
index 5d5eee2..0000000
--- a/res/drawable-mdpi/change_photo_box_pressed_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/directory_bg.9.png b/res/drawable-mdpi/directory_bg.9.png
deleted file mode 100644
index 80578cd..0000000
--- a/res/drawable-mdpi/directory_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/directory_bg_holo.9.png b/res/drawable-mdpi/directory_bg_holo.9.png
deleted file mode 100644
index 7f7209d..0000000
--- a/res/drawable-mdpi/directory_bg_holo.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_compose_holo_light.png b/res/drawable-mdpi/ic_menu_compose_holo_light.png
deleted file mode 100644
index 5236c1c..0000000
--- a/res/drawable-mdpi/ic_menu_compose_holo_light.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_menu_done_holo_light.png b/res/drawable-mdpi/ic_menu_done_holo_light.png
deleted file mode 100644
index 3468bbd..0000000
--- a/res/drawable-mdpi/ic_menu_done_holo_light.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/infobar_dark.9.png b/res/drawable-mdpi/infobar_dark.9.png
deleted file mode 100644
index ae3caf7..0000000
--- a/res/drawable-mdpi/infobar_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/section_header.9.png b/res/drawable-mdpi/section_header.9.png
deleted file mode 100644
index ac906cd..0000000
--- a/res/drawable-mdpi/section_header.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/sym_action_audiochat_holo_dark.png b/res/drawable-mdpi/sym_action_audiochat_holo_dark.png
deleted file mode 100644
index 848404d..0000000
--- a/res/drawable-mdpi/sym_action_audiochat_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/sym_action_sms.png b/res/drawable-mdpi/sym_action_sms.png
deleted file mode 100644
index f098f4a..0000000
--- a/res/drawable-mdpi/sym_action_sms.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/sym_action_videochat_holo_dark.png b/res/drawable-mdpi/sym_action_videochat_holo_dark.png
deleted file mode 100644
index 9112e87..0000000
--- a/res/drawable-mdpi/sym_action_videochat_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/change_photo_box_normal_holo_light.9.png b/res/drawable-xhdpi/change_photo_box_normal_holo_light.9.png
deleted file mode 100644
index 7e1e97f..0000000
--- a/res/drawable-xhdpi/change_photo_box_normal_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/change_photo_box_pressed_holo_light.9.png b/res/drawable-xhdpi/change_photo_box_pressed_holo_light.9.png
deleted file mode 100644
index e98266f..0000000
--- a/res/drawable-xhdpi/change_photo_box_pressed_holo_light.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_compose_holo_light.png b/res/drawable-xhdpi/ic_menu_compose_holo_light.png
deleted file mode 100644
index 9561ce7..0000000
--- a/res/drawable-xhdpi/ic_menu_compose_holo_light.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_menu_done_holo_light.png b/res/drawable-xhdpi/ic_menu_done_holo_light.png
deleted file mode 100644
index a8a0972..0000000
--- a/res/drawable-xhdpi/ic_menu_done_holo_light.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/infobar_dark.9.png b/res/drawable-xhdpi/infobar_dark.9.png
deleted file mode 100644
index 24ed9a2..0000000
--- a/res/drawable-xhdpi/infobar_dark.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/quickactions_icon_activated.9.png b/res/drawable-xhdpi/quickactions_icon_activated.9.png
deleted file mode 100644
index b3aaf7d..0000000
--- a/res/drawable-xhdpi/quickactions_icon_activated.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/section_header.9.png b/res/drawable-xhdpi/section_header.9.png
deleted file mode 100644
index 5026ea6..0000000
--- a/res/drawable-xhdpi/section_header.9.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/sym_action_audiochat_holo_dark.png b/res/drawable-xhdpi/sym_action_audiochat_holo_dark.png
deleted file mode 100644
index 216d34f..0000000
--- a/res/drawable-xhdpi/sym_action_audiochat_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/sym_action_sms.png b/res/drawable-xhdpi/sym_action_sms.png
deleted file mode 100644
index 5003be1..0000000
--- a/res/drawable-xhdpi/sym_action_sms.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/sym_action_videochat_holo_dark.png b/res/drawable-xhdpi/sym_action_videochat_holo_dark.png
deleted file mode 100644
index 5011489..0000000
--- a/res/drawable-xhdpi/sym_action_videochat_holo_dark.png
+++ /dev/null
Binary files differ
diff --git a/res/layout-sw580dp/contact_detail_container.xml b/res/layout-sw580dp/contact_detail_container.xml
index 62c4081..58a6eb3 100644
--- a/res/layout-sw580dp/contact_detail_container.xml
+++ b/res/layout-sw580dp/contact_detail_container.xml
@@ -18,8 +18,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
-    android:background="@color/background_primary"
-    android:padding="16dip">
+    android:background="@color/background_primary">
 
     <android.support.v4.view.ViewPager
         android:id="@+id/pager"
diff --git a/res/layout/stream_item_container.xml b/res/layout/stream_item_container.xml
index 6a65357..308c5f5 100644
--- a/res/layout/stream_item_container.xml
+++ b/res/layout/stream_item_container.xml
@@ -25,17 +25,19 @@
         android:id="@+id/stream_item_content"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:paddingTop="@dimen/detail_update_section_item_vertical_padding"
-        android:paddingBottom="@dimen/detail_update_section_item_vertical_padding"
         android:paddingLeft="@dimen/detail_update_section_item_horizontal_padding"
         android:paddingRight="@dimen/detail_update_section_item_horizontal_padding"
+        android:paddingTop="@dimen/detail_update_section_item_vertical_padding"
+        android:paddingBottom="@dimen/detail_update_section_item_vertical_padding"
         android:background="?android:attr/selectableItemBackground"
+        android:layout_gravity="center_vertical"
         />
 
     <View
         android:id="@+id/horizontal_divider"
         android:layout_width="match_parent"
         android:layout_height="1px"
-        android:background="?android:attr/dividerHorizontal" />
+        android:background="?android:attr/dividerHorizontal"
+        android:layout_gravity="bottom" />
 
 </LinearLayout>
diff --git a/res/layout/stream_item_row_image_and_text.xml b/res/layout/stream_item_row_image_and_text.xml
index ea87ff0..3642592 100644
--- a/res/layout/stream_item_row_image_and_text.xml
+++ b/res/layout/stream_item_row_image_and_text.xml
@@ -16,9 +16,7 @@
 
 <TableRow
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
-    android:paddingBottom="@dimen/detail_update_section_between_items_vertical_padding"
-    android:paddingTop="@dimen/detail_update_section_between_items_vertical_padding">
+    xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts">
 
     <view
         class="com.android.contacts.widget.ProportionalLayout"
diff --git a/res/layout/stream_item_row_text_only.xml b/res/layout/stream_item_row_text_only.xml
index d1d0efd..7b1f255 100644
--- a/res/layout/stream_item_row_text_only.xml
+++ b/res/layout/stream_item_row_text_only.xml
@@ -17,8 +17,7 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:orientation="vertical"
-    android:paddingBottom="@dimen/detail_update_section_between_items_vertical_padding">
+    android:orientation="vertical">
 
     <TextView android:id="@+id/stream_item_html"
         android:layout_width="match_parent"
diff --git a/res/layout/stream_item_row_two_images.xml b/res/layout/stream_item_row_two_images.xml
index f127129..f10b7d8 100644
--- a/res/layout/stream_item_row_two_images.xml
+++ b/res/layout/stream_item_row_two_images.xml
@@ -16,8 +16,7 @@
 
 <TableRow
     xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
-    android:paddingBottom="@dimen/detail_update_section_between_items_vertical_padding">
+    xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts">
 
     <view
         class="com.android.contacts.widget.ProportionalLayout"
diff --git a/res/layout/dialpad_activity.xml b/res/values-sw580dp-w1000dp-port/dimens.xml
similarity index 63%
rename from res/layout/dialpad_activity.xml
rename to res/values-sw580dp-w1000dp-port/dimens.xml
index 93e9523..767fda4 100644
--- a/res/layout/dialpad_activity.xml
+++ b/res/values-sw580dp-w1000dp-port/dimens.xml
@@ -13,13 +13,6 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
->
-    <fragment class="com.android.contacts.dialpad.DialpadFragment"
-            android:id="@+id/dialpad_fragment"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent" />
-</FrameLayout>
+<resources>
+    <dimen name="contact_detail_list_top_padding">8dip</dimen>
+</resources>
diff --git a/res/values-sw580dp/styles.xml b/res/values-sw580dp/styles.xml
index 07bb371..33bb632 100644
--- a/res/values-sw580dp/styles.xml
+++ b/res/values-sw580dp/styles.xml
@@ -123,7 +123,7 @@
         <item name="android:layout_height">200dip</item>
     </style>
 
-    <style name="BackgroundOnly" parent="@android:Theme.Holo.Light">
+    <style name="BackgroundOnlyTheme" parent="@android:Theme.Holo.Light">
         <item name="android:windowBackground">@null</item>
         <item name="android:windowContentOverlay">@null</item>
         <item name="android:windowAnimationStyle">@null</item>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 9509d6d..dc209c5 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -92,7 +92,7 @@
         <item name="android:textColorSecondary">@color/secondary_text_color</item>
     </style>
 
-    <style name="BackgroundOnly">
+    <style name="BackgroundOnlyTheme" parent="@android:style/Theme.Holo.Light">
         <item name="android:windowBackground">@null</item>
         <item name="android:windowContentOverlay">@null</item>
         <item name="android:windowAnimationStyle">@null</item>
diff --git a/src/com/android/contacts/ContactLoader.java b/src/com/android/contacts/ContactLoader.java
index a28b1db..0dbb22c 100644
--- a/src/com/android/contacts/ContactLoader.java
+++ b/src/com/android/contacts/ContactLoader.java
@@ -74,6 +74,7 @@
     private static final String TAG = "ContactLoader";
 
     private Uri mLookupUri;
+    private final Uri mRequestedUri;
     private boolean mLoadGroupMetaData;
     private boolean mLoadStreamItems;
     private final boolean mLoadInvitableAccountTypes;
@@ -95,6 +96,7 @@
          */
         public static final Result NOT_FOUND = new Result((Exception) null);
 
+        private final Uri mRequestedUri;
         private final Uri mLookupUri;
         private final Uri mUri;
         private final long mDirectoryId;
@@ -134,6 +136,7 @@
          * Constructor for special results, namely "no contact found" and "error".
          */
         private Result(Exception exception) {
+            mRequestedUri = null;
             mLookupUri = null;
             mUri = null;
             mDirectoryId = -1;
@@ -165,12 +168,13 @@
         /**
          * Constructor to call when contact was found
          */
-        private Result(Uri uri, Uri lookupUri, long directoryId, String lookupKey, long id,
-                long nameRawContactId, int displayNameSource, long photoId, String photoUri,
-                String displayName, String altDisplayName, String phoneticName, boolean starred,
-                Integer presence, boolean sendToVoicemail, String customRingtone,
+        private Result(Uri requestedUri, Uri uri, Uri lookupUri, long directoryId, String lookupKey,
+                long id, long nameRawContactId, int displayNameSource, long photoId,
+                String photoUri, String displayName, String altDisplayName, String phoneticName,
+                boolean starred, Integer presence, boolean sendToVoicemail, String customRingtone,
                 boolean isUserProfile) {
             mException = null;
+            mRequestedUri = requestedUri;
             mLookupUri = lookupUri;
             mUri = uri;
             mDirectoryId = directoryId;
@@ -196,6 +200,7 @@
 
         private Result(Result from) {
             mException = from.mException;
+            mRequestedUri = from.mRequestedUri;
             mLookupUri = from.mLookupUri;
             mUri = from.mUri;
             mDirectoryId = from.mDirectoryId;
@@ -250,6 +255,11 @@
             mPhotoBinaryData = photoBinaryData;
         }
 
+        /**
+         * Returns the URI for the contact that contains both the lookup key and the ID. This is
+         * the best URI to reference a contact.
+         * For directory contacts, this is the same a the URI as returned by {@link #getUri()}
+         */
         public Uri getLookupUri() {
             return mLookupUri;
         }
@@ -258,10 +268,23 @@
             return mLookupKey;
         }
 
+        /**
+         * Returns the contact Uri that was passed to the provider to make the query. This is
+         * the same as the requested Uri, unless the requested Uri doesn't specify a Contact:
+         * If it either references a Raw-Contact or a Person (a pre-Eclair style Uri), this Uri will
+         * always reference the full aggregate contact.
+         */
         public Uri getUri() {
             return mUri;
         }
 
+        /**
+         * Returns the URI for which this {@link ContactLoader) was initially requested.
+         */
+        public Uri getRequestedUri() {
+            return mRequestedUri;
+        }
+
         @VisibleForTesting
         /*package*/ long getId() {
             return mId;
@@ -850,8 +873,8 @@
                 lookupUri = contactUri;
             }
 
-            return new Result(contactUri, lookupUri, directoryId, lookupKey, contactId,
-                    nameRawContactId, displayNameSource, photoId, photoUri, displayName,
+            return new Result(mRequestedUri, contactUri, lookupUri, directoryId, lookupKey,
+                    contactId, nameRawContactId, displayNameSource, photoId, photoUri, displayName,
                     altDisplayName, phoneticName, starred, presence, sendToVoicemail,
                     customRingtone, isUserProfile);
         }
@@ -1217,6 +1240,7 @@
             boolean loadStreamItems, boolean loadInvitableAccountTypes) {
         super(context);
         mLookupUri = lookupUri;
+        mRequestedUri = lookupUri;
         mLoadGroupMetaData = loadGroupMetaData;
         mLoadStreamItems = loadStreamItems;
         mLoadInvitableAccountTypes = loadInvitableAccountTypes;
diff --git a/src/com/android/contacts/ContactsApplication.java b/src/com/android/contacts/ContactsApplication.java
index 1c8c080..4007916 100644
--- a/src/com/android/contacts/ContactsApplication.java
+++ b/src/com/android/contacts/ContactsApplication.java
@@ -18,6 +18,7 @@
 
 import com.android.contacts.model.AccountTypeManager;
 import com.android.contacts.test.InjectedServices;
+import com.android.contacts.util.Constants;
 import com.google.common.annotations.VisibleForTesting;
 
 import android.app.Application;
@@ -27,9 +28,9 @@
 import android.content.SharedPreferences;
 import android.os.StrictMode;
 import android.preference.PreferenceManager;
+import android.util.Log;
 
 public final class ContactsApplication extends Application {
-
     private static InjectedServices sInjectedServices;
     private AccountTypeManager mAccountTypeManager;
     private ContactPhotoManager mContactPhotoManager;
@@ -100,6 +101,10 @@
     public void onCreate() {
         super.onCreate();
 
+        if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
+            Log.d(Constants.PERFORMANCE_TAG, "ContactsApplication.onCreate start");
+        }
+
         // Priming caches to placate the StrictMode police
         Context context = getApplicationContext();
         PreferenceManager.getDefaultSharedPreferences(context);
@@ -108,5 +113,9 @@
 
         StrictMode.setThreadPolicy(
                 new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
+
+        if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
+            Log.d(Constants.PERFORMANCE_TAG, "ContactsApplication.onCreate finish");
+        }
     }
 }
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index b68bfc9..ebf1dbd 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -55,6 +55,7 @@
 import com.android.contacts.preference.DisplayOptionsPreferenceFragment;
 import com.android.contacts.util.AccountSelectionUtil;
 import com.android.contacts.util.AccountsListAdapter;
+import com.android.contacts.util.Constants;
 import com.android.contacts.util.DialogManager;
 import com.android.contacts.util.PhoneCapabilityTester;
 
@@ -233,6 +234,9 @@
 
     @Override
     protected void onCreate(Bundle savedState) {
+        if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
+            Log.d(Constants.PERFORMANCE_TAG, "PeopleActivity.onCreate start");
+        }
         super.onCreate(savedState);
 
         if (!processIntent(false)) {
@@ -242,6 +246,9 @@
 
         mIsRecreatedInstance = (savedState != null);
         createViewsAndFragments(savedState);
+        if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
+            Log.d(Constants.PERFORMANCE_TAG, "PeopleActivity.onCreate finish");
+        }
     }
 
     @Override
diff --git a/src/com/android/contacts/detail/ContactLoaderFragment.java b/src/com/android/contacts/detail/ContactLoaderFragment.java
index ac22677..9417ee7 100644
--- a/src/com/android/contacts/detail/ContactLoaderFragment.java
+++ b/src/com/android/contacts/detail/ContactLoaderFragment.java
@@ -183,7 +183,7 @@
 
         @Override
         public void onLoadFinished(Loader<ContactLoader.Result> loader, ContactLoader.Result data) {
-            if (!mLookupUri.equals(data.getUri())) {
+            if (!mLookupUri.equals(data.getRequestedUri())) {
                 return;
             }
 
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index 87fcfe0..21ac3bb 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -1658,6 +1658,15 @@
 
     @Override
     public void onSplitContactConfirmed() {
+        if (mState == null) {
+            // This may happen when this Fragment is recreated by the system during users
+            // confirming the split action (and thus this method is called just before onCreate()),
+            // for example.
+            Log.e(TAG, "mState became null during the user's confirming split action. " +
+                    "Cannot perform the save action.");
+            return;
+        }
+
         mState.markRawContactsForSplitting();
         save(SaveMode.SPLIT);
     }
diff --git a/src/com/android/contacts/model/AccountTypeManager.java b/src/com/android/contacts/model/AccountTypeManager.java
index d60f355..65af3ee 100644
--- a/src/com/android/contacts/model/AccountTypeManager.java
+++ b/src/com/android/contacts/model/AccountTypeManager.java
@@ -16,6 +16,7 @@
 
 package com.android.contacts.model;
 
+import com.android.contacts.util.Constants;
 import com.android.i18n.phonenumbers.PhoneNumberUtil;
 import com.android.internal.util.Objects;
 import com.google.android.collect.Lists;
@@ -271,6 +272,9 @@
      * called on a background thread.
      */
     protected void loadAccountsInBackground() {
+        if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
+            Log.d(Constants.PERFORMANCE_TAG, "AccountTypeManager.loadAccountsInBackground start");
+        }
         long startTime = SystemClock.currentThreadTimeMillis();
 
         // Account types, keyed off the account type and data set concatenation.
@@ -419,6 +423,9 @@
             mInitializationLatch.countDown();
             mInitializationLatch = null;
         }
+        if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
+            Log.d(Constants.PERFORMANCE_TAG, "AccountTypeManager.loadAccountsInBackground finish");
+        }
     }
 
     // Bookkeeping method for tracking the known account types in the given maps.
diff --git a/src/com/android/contacts/model/BaseAccountType.java b/src/com/android/contacts/model/BaseAccountType.java
index dae09b2..eee7241 100644
--- a/src/com/android/contacts/model/BaseAccountType.java
+++ b/src/com/android/contacts/model/BaseAccountType.java
@@ -65,7 +65,7 @@
     public BaseAccountType() {
         this.accountType = null;
         this.dataSet = null;
-        this.titleRes = R.string.account_phone;
+        this.titleRes = R.string.local_profile_title;
         this.iconRes = R.mipmap.ic_launcher_contacts;
     }
 
diff --git a/src/com/android/contacts/model/FallbackAccountType.java b/src/com/android/contacts/model/FallbackAccountType.java
index 8bb3992..a40828e 100644
--- a/src/com/android/contacts/model/FallbackAccountType.java
+++ b/src/com/android/contacts/model/FallbackAccountType.java
@@ -25,7 +25,7 @@
     public FallbackAccountType(Context context) {
         this.accountType = null;
         this.dataSet = null;
-        this.titleRes = R.string.account_phone;
+        this.titleRes = R.string.local_profile_title;
         this.iconRes = R.mipmap.ic_launcher_contacts;
 
         this.resPackageName = null;
diff --git a/src/com/android/contacts/quickcontact/DataAction.java b/src/com/android/contacts/quickcontact/DataAction.java
index 109e8b0..2066997 100644
--- a/src/com/android/contacts/quickcontact/DataAction.java
+++ b/src/com/android/contacts/quickcontact/DataAction.java
@@ -3,7 +3,6 @@
 import com.android.contacts.ContactsUtils;
 import com.android.contacts.R;
 import com.android.contacts.model.AccountType.EditType;
-import com.android.contacts.model.AccountTypeManager;
 import com.android.contacts.model.DataKind;
 import com.android.contacts.util.Constants;
 import com.android.contacts.util.PhoneCapabilityTester;
@@ -179,14 +178,11 @@
                     final boolean isAudioChatCapable =
                             (chatCapability & Im.CAPABILITY_HAS_VOICE) != 0;
                     if (isVideoChatCapable || isAudioChatCapable) {
-                        final AccountTypeManager accountTypes = AccountTypeManager.getInstance(
-                                context.getApplicationContext());
                         mAlternateIntent = new Intent(
                                 Intent.ACTION_SENDTO, Uri.parse("xmpp:" + data + "?call"));
-                        // Use Holo dark theme since the background is darker than usual.
                         mAlternateIconRes = (isVideoChatCapable
-                                ? R.drawable.sym_action_videochat_holo_dark
-                                : R.drawable.sym_action_audiochat_holo_dark);
+                                ? R.drawable.sym_action_videochat_holo_light
+                                : R.drawable.sym_action_audiochat_holo_light);
                     }
                 }
             }
@@ -297,16 +293,13 @@
             Log.e(TAG, "t must be DataAction");
             return false;
         }
-        DataAction other = (DataAction)t;
-        if (!ContactsUtils.areObjectsEqual(mKind, other.mKind)) {
+        DataAction that = (DataAction)t;
+        if (!ContactsUtils.shouldCollapse(mContext, mMimeType, mBody, that.mMimeType,
+                that.mBody)) {
             return false;
         }
-        if (!ContactsUtils.shouldCollapse(mContext, mMimeType, mBody, other.mMimeType,
-                other.mBody)) {
-            return false;
-        }
-        if (!TextUtils.equals(mMimeType, other.mMimeType)
-                || !ContactsUtils.areIntentActionEqual(mIntent, other.mIntent)) {
+        if (!TextUtils.equals(mMimeType, that.mMimeType)
+                || !ContactsUtils.areIntentActionEqual(mIntent, that.mIntent)) {
             return false;
         }
         return true;
diff --git a/src/com/android/contacts/util/Constants.java b/src/com/android/contacts/util/Constants.java
index a8ba059..d79f029 100644
--- a/src/com/android/contacts/util/Constants.java
+++ b/src/com/android/contacts/util/Constants.java
@@ -24,4 +24,8 @@
     public static final String SCHEME_MAILTO = "mailto";
     public static final String SCHEME_IMTO = "imto";
     public static final String SCHEME_SIP = "sip";
+
+    // Log tag for performance measurement.
+    // To enable: adb shell setprop log.tag.ContactsPerf VERBOSE
+    public static final String PERFORMANCE_TAG = "ContactsPerf";
 }