diff --git a/src/com/android/contacts/activities/ContactEditorSpringBoardActivity.java b/src/com/android/contacts/activities/ContactEditorSpringBoardActivity.java
index a0db4c5..7396bbd 100644
--- a/src/com/android/contacts/activities/ContactEditorSpringBoardActivity.java
+++ b/src/com/android/contacts/activities/ContactEditorSpringBoardActivity.java
@@ -38,6 +38,7 @@
     private Uri mUri;
     private Cursor mCursor;
     private MaterialPalette mMaterialPalette;
+    private boolean mIsUserProfile;
 
     /**
      * The contact data loader listener.
@@ -59,6 +60,7 @@
                         return;
                     }
                     mCursor = cursor;
+                    mIsUserProfile = ((PickRawContactLoader) loader).isUserProfile();
                     if (mCursor.getCount() == 1) {
                         loadEditor();
                     } else {
@@ -128,8 +130,8 @@
         if (oldFragment != null) {
             ft.remove(oldFragment);
         }
-        final PickRawContactDialogFragment newFragment =
-                PickRawContactDialogFragment.getInstance(mUri, mCursor, mMaterialPalette);
+        final PickRawContactDialogFragment newFragment = PickRawContactDialogFragment.getInstance(
+                mUri, mCursor, mMaterialPalette, mIsUserProfile);
         ft.add(newFragment, TAG_RAW_CONTACTS_DIALOG);
         // commitAllowingStateLoss is safe in this activity because the fragment entirely depends
         // on the result of the loader. Even if we lose the fragment because the activity was
diff --git a/src/com/android/contacts/editor/PickRawContactDialogFragment.java b/src/com/android/contacts/editor/PickRawContactDialogFragment.java
index b9800de..0f87d99 100644
--- a/src/com/android/contacts/editor/PickRawContactDialogFragment.java
+++ b/src/com/android/contacts/editor/PickRawContactDialogFragment.java
@@ -11,6 +11,7 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.provider.ContactsContract.RawContacts;
+import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -21,7 +22,11 @@
 import com.android.contacts.R;
 import com.android.contacts.common.ContactPhotoManager;
 import com.android.contacts.common.model.AccountTypeManager;
+import com.android.contacts.common.model.account.AccountDisplayInfo;
+import com.android.contacts.common.model.account.AccountDisplayInfoFactory;
 import com.android.contacts.common.model.account.AccountType;
+import com.android.contacts.common.model.account.AccountWithDataSet;
+import com.android.contacts.common.model.account.GoogleAccountType;
 import com.android.contacts.common.preference.ContactsPreferences;
 import com.android.contacts.common.util.ImplicitIntentsUtil;
 import com.android.contacts.common.util.MaterialColorMapUtils.MaterialPalette;
@@ -34,14 +39,20 @@
     /**
      * Used to list the account info for the given raw contacts list.
      */
-    private static final class RawContactAccountListAdapter extends CursorAdapter {
+    private final class RawContactAccountListAdapter extends CursorAdapter {
         private final LayoutInflater mInflater;
         private final Context mContext;
+        private final AccountDisplayInfoFactory mAccountDisplayInfoFactory;
+        private final AccountTypeManager mAccountTypeManager;
+        private final ContactsPreferences mPreferences;
 
         public RawContactAccountListAdapter(Context context, Cursor cursor) {
             super(context, cursor, 0);
             mContext = context;
             mInflater = LayoutInflater.from(context);
+            mAccountDisplayInfoFactory = AccountDisplayInfoFactory.forWritableAccounts(context);
+            mAccountTypeManager = AccountTypeManager.getInstance(context);
+            mPreferences = new ContactsPreferences(context);
         }
 
         @Override
@@ -50,22 +61,18 @@
             final String accountName = cursor.getString(PickRawContactLoader.ACCOUNT_NAME);
             final String accountType = cursor.getString(PickRawContactLoader.ACCOUNT_TYPE);
             final String dataSet = cursor.getString(PickRawContactLoader.DATA_SET);
-            final AccountType account = AccountTypeManager.getInstance(mContext)
-                    .getAccountType(accountType, dataSet);
+            final AccountType account = mAccountTypeManager.getAccountType(accountType, dataSet);
 
-            final ContactsPreferences prefs = new ContactsPreferences(mContext);
             final int displayNameColumn =
-                    prefs.getDisplayOrder() == ContactsPreferences.DISPLAY_ORDER_PRIMARY
+                    mPreferences.getDisplayOrder() == ContactsPreferences.DISPLAY_ORDER_PRIMARY
                             ? PickRawContactLoader.DISPLAY_NAME_PRIMARY
                             : PickRawContactLoader.DISPLAY_NAME_ALTERNATIVE;
+
             String displayName = cursor.getString(displayNameColumn);
 
-            final TextView nameView = (TextView) view.findViewById(
-                    R.id.display_name);
-            final TextView accountTextView = (TextView) view.findViewById(
-                    R.id.account_name);
-            final ImageView accountIconView = (ImageView) view.findViewById(
-                    R.id.account_icon);
+            if (TextUtils.isEmpty(displayName)) {
+                displayName = mContext.getString(R.string.missing_name);
+            }
 
             if (!account.areContactsWritable()) {
                 displayName = mContext
@@ -74,19 +81,42 @@
             } else {
                 view.setAlpha(1f);
             }
-
+            final TextView nameView = (TextView) view.findViewById(
+                    R.id.display_name);
             nameView.setText(displayName);
-            accountTextView.setText(accountName);
+
+            final String accountDisplayLabel;
+
+            // Use the same string as editor if it's an editable user profile raw contact.
+            if (mIsUserProfile && account.areContactsWritable()) {
+                final AccountDisplayInfo displayInfo =
+                        mAccountDisplayInfoFactory.getAccountDisplayInfo(
+                                new AccountWithDataSet(accountName, accountType, dataSet));
+                accountDisplayLabel = EditorUiUtils.getAccountHeaderLabelForMyProfile(mContext,
+                        displayInfo);
+            }
+            else if (GoogleAccountType.ACCOUNT_TYPE.equals(accountType)
+                    && account.dataSet == null) {
+                // Focus Google accounts have the account name shown
+                accountDisplayLabel = accountName;
+            } else {
+                accountDisplayLabel = account.getDisplayLabel(mContext).toString();
+            }
+            final TextView accountTextView = (TextView) view.findViewById(
+                    R.id.account_name);
+            final ImageView accountIconView = (ImageView) view.findViewById(
+                    R.id.account_icon);
+            accountTextView.setText(accountDisplayLabel);
             accountIconView.setImageDrawable(account.getDisplayIcon(mContext));
 
             final ContactPhotoManager.DefaultImageRequest
                     request = new ContactPhotoManager.DefaultImageRequest(
                     displayName, String.valueOf(rawContactId), /* isCircular = */ true);
-            final ImageView photoView = (ImageView) view.findViewById(
-                    R.id.photo);
             final Uri photoUri = Uri.withAppendedPath(
                     ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId),
                     RawContacts.DisplayPhoto.CONTENT_DIRECTORY);
+            final ImageView photoView = (ImageView) view.findViewById(
+                    R.id.photo);
             ContactPhotoManager.getInstance(mContext).loadDirectoryPhoto(photoView,
                     photoUri,
                     /* darkTheme = */ false,
@@ -112,13 +142,15 @@
     private Uri mUri;
     private CursorAdapter mAdapter;
     private MaterialPalette mMaterialPalette;
+    private boolean mIsUserProfile;
 
     public static PickRawContactDialogFragment getInstance(Uri uri, Cursor cursor,
-            MaterialPalette materialPalette) {
+            MaterialPalette materialPalette, boolean isUserProfile) {
         final PickRawContactDialogFragment fragment = new PickRawContactDialogFragment();
         fragment.setUri(uri);
         fragment.setCursor(cursor);
         fragment.setMaterialPalette(materialPalette);
+        fragment.setIsUserProfile(isUserProfile);
         return fragment;
     }
 
@@ -163,6 +195,10 @@
         mMaterialPalette = materialPalette;
     }
 
+    private void setIsUserProfile(boolean isUserProfile) {
+        mIsUserProfile = isUserProfile;
+    }
+
     private void finishActivity() {
         if (getActivity() != null && !getActivity().isFinishing()) {
             getActivity().finish();
diff --git a/src/com/android/contacts/editor/PickRawContactLoader.java b/src/com/android/contacts/editor/PickRawContactLoader.java
index 62be517..ca44e21 100644
--- a/src/com/android/contacts/editor/PickRawContactLoader.java
+++ b/src/com/android/contacts/editor/PickRawContactLoader.java
@@ -4,6 +4,7 @@
 import android.content.CursorLoader;
 import android.database.Cursor;
 import android.net.Uri;
+import android.provider.ContactsContract;
 import android.provider.ContactsContract.Contacts;
 import android.provider.ContactsContract.RawContacts;
 
@@ -13,6 +14,7 @@
  */
 public class PickRawContactLoader extends CursorLoader {
     private Uri mContactUri;
+    private boolean mIsUserProfile;
 
     public static final String[] COLUMNS = new String[] {
             RawContacts.ACCOUNT_NAME,
@@ -41,7 +43,7 @@
     public Cursor loadInBackground() {
         // Get the id of the contact we're looking at.
         final Cursor cursor = getContext().getContentResolver()
-                .query(mContactUri, new String[] { Contacts._ID }, null,
+                .query(mContactUri, new String[] { Contacts._ID, Contacts.IS_USER_PROFILE }, null,
                 null, null);
 
         if (cursor == null) {
@@ -54,14 +56,24 @@
         }
 
         cursor.moveToFirst();
-        final long contactId = cursor.getLong(0);
+        final long contactId = cursor.getLong(/* Contacts._ID */ 0);
+        mIsUserProfile = cursor.getInt(/* Contacts.IS_USER_PROFILE */ 1) == 1;
+
         cursor.close();
         // Update selection arguments and uri.
         setSelectionArgs(new String[]{ Long.toString(contactId) });
-        setUri(RawContacts.CONTENT_URI);
+        if (mIsUserProfile) {
+            setUri(ContactsContract.Profile.CONTENT_RAW_CONTACTS_URI);
+        } else {
+            setUri(RawContacts.CONTENT_URI);
+        }
         return super.loadInBackground();
     }
 
+    public boolean isUserProfile() {
+        return mIsUserProfile;
+    }
+
     /**
      * Ensures that this is a valid contact URI. If invalid, then an exception is
      * thrown. Otherwise, the original URI is returned.
