diff --git a/res/drawable-hdpi/ic_link_grey600_drawable_24dp.png b/res/drawable-hdpi/ic_link_grey600_drawable_24dp.png
deleted file mode 100644
index 31fcce2..0000000
--- a/res/drawable-hdpi/ic_link_grey600_drawable_24dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_link_grey600_drawable_24dp.png b/res/drawable-mdpi/ic_link_grey600_drawable_24dp.png
deleted file mode 100644
index 65997eb..0000000
--- a/res/drawable-mdpi/ic_link_grey600_drawable_24dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_link_grey600_drawable_24dp.png b/res/drawable-xhdpi/ic_link_grey600_drawable_24dp.png
deleted file mode 100644
index 9f37410..0000000
--- a/res/drawable-xhdpi/ic_link_grey600_drawable_24dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_link_grey600_drawable_24dp.png b/res/drawable-xxhdpi/ic_link_grey600_drawable_24dp.png
deleted file mode 100644
index 140daef..0000000
--- a/res/drawable-xxhdpi/ic_link_grey600_drawable_24dp.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_link_grey600_drawable_24dp.png b/res/drawable-xxxhdpi/ic_link_grey600_drawable_24dp.png
deleted file mode 100644
index 6fe9b8c..0000000
--- a/res/drawable-xxxhdpi/ic_link_grey600_drawable_24dp.png
+++ /dev/null
Binary files differ
diff --git a/res/layout-land/contact_editor_fragment.xml b/res/layout-land/contact_editor_fragment.xml
index 6b02462..7f98765 100644
--- a/res/layout-land/contact_editor_fragment.xml
+++ b/res/layout-land/contact_editor_fragment.xml
@@ -44,8 +44,6 @@
                 android:layout_height="wrap_content"
                 android:orientation="vertical">
 
-            <include layout="@layout/editor_all_rawcontacts_accounts_selector" />
-
             <include layout="@layout/editor_account_header" />
 
             <include layout="@layout/contact_editor_fields" />
diff --git a/res/layout/contact_editor_fragment.xml b/res/layout/contact_editor_fragment.xml
index 85c4cf1..690be8c 100644
--- a/res/layout/contact_editor_fragment.xml
+++ b/res/layout/contact_editor_fragment.xml
@@ -39,7 +39,6 @@
             android:focusable="true"
             android:focusableInTouchMode="true"/>
 
-        <include layout="@layout/editor_all_rawcontacts_accounts_selector" />
         <include layout="@layout/editor_account_header" />
 
         <include layout="@layout/contact_editor_fields" />
diff --git a/res/layout/editor_all_rawcontacts_accounts_selector.xml b/res/layout/editor_all_rawcontacts_accounts_selector.xml
deleted file mode 100644
index 5606422..0000000
--- a/res/layout/editor_all_rawcontacts_accounts_selector.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-
-<!-- Header at the top of a raw contact editor. This allows users to change the account that
-    the raw contact is saved in. -->
-<LinearLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/all_rawcontacts_accounts_container"
-        android:layout_height="wrap_content"
-        android:layout_width="match_parent"
-        android:minHeight="@dimen/editor_min_line_item_height"
-        android:orientation="horizontal"
-        android:visibility="gone" >
-
-    <ImageView
-            android:src="@drawable/ic_link_grey600_drawable_24dp"
-            android:tint="@color/editor_icon_color"
-            style="@style/EditSelectorIconStyle"/>
-
-    <TextView
-            android:id="@+id/rawcontacts_accounts_summary"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:layout_marginStart="@dimen/editor_account_left_margin"
-            android:textSize="16sp"
-            android:singleLine="true"
-            android:layout_weight="1"
-            android:textColor="@color/primary_text_color"
-            android:textAlignment="viewStart"
-            android:layout_gravity="center_vertical"
-            android:gravity="center_vertical"
-            android:ellipsize="end" />
-
-    <ImageView
-            android:src="@drawable/ic_menu_expand_minimized_24dp"
-            android:tint="@color/quantum_black_secondary_text"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center_vertical|end"
-            android:layout_alignParentEnd="true"
-            android:paddingStart="@dimen/editor_round_button_padding_left"
-            android:paddingEnd="@dimen/editor_round_button_padding_right"
-            android:paddingTop="@dimen/editor_round_button_padding_top"
-            android:paddingBottom="@dimen/editor_round_button_padding_bottom"/>
-
-</LinearLayout>
\ No newline at end of file
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index 90aad4c..48e4bee 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -143,8 +143,6 @@
     private static final String KEY_IS_EDIT = "isEdit";
     private static final String KEY_EXISTING_CONTACT_READY = "existingContactDataReady";
 
-    private static final String KEY_RAW_CONTACT_DISPLAY_ALONE_IS_READ_ONLY = "isReadOnly";
-
     // Phone option menus
     private static final String KEY_SEND_TO_VOICE_MAIL_STATE = "sendToVoicemailState";
     private static final String KEY_ARE_PHONE_OPTIONS_CHANGEABLE = "arePhoneOptionsChangable";
@@ -350,7 +348,6 @@
     protected RawContactDeltaList mState;
     protected int mStatus;
     protected long mRawContactIdToDisplayAlone = -1;
-    protected boolean mRawContactDisplayAloneIsReadOnly = false;
 
     // Whether to show the new contact blank form and if it's corresponding delta is ready.
     protected boolean mHasNewContact;
@@ -497,8 +494,6 @@
             // Read state from savedState. No loading involved here
             mState = savedState.<RawContactDeltaList> getParcelable(KEY_EDIT_STATE);
             mStatus = savedState.getInt(KEY_STATUS);
-            mRawContactDisplayAloneIsReadOnly = savedState.getBoolean(
-                    KEY_RAW_CONTACT_DISPLAY_ALONE_IS_READ_ONLY);
 
             mHasNewContact = savedState.getBoolean(KEY_HAS_NEW_CONTACT);
             mNewContactDataReady = savedState.getBoolean(KEY_NEW_CONTACT_READY);
@@ -629,8 +624,6 @@
         outState.putBoolean(KEY_NEW_CONTACT_READY, mNewContactDataReady);
         outState.putBoolean(KEY_IS_EDIT, mIsEdit);
         outState.putBoolean(KEY_EXISTING_CONTACT_READY, mExistingContactDataReady);
-        outState.putBoolean(KEY_RAW_CONTACT_DISPLAY_ALONE_IS_READ_ONLY,
-                mRawContactDisplayAloneIsReadOnly);
 
         outState.putBoolean(KEY_IS_USER_PROFILE, mIsUserProfile);
 
@@ -780,7 +773,7 @@
         }
 
         // Save menu is invisible when there's only one read only contact in the editor.
-        saveMenu.setVisible(!mRawContactDisplayAloneIsReadOnly);
+        saveMenu.setVisible(!isEditingReadOnlyRawContact());
         if (saveMenu.isVisible()) {
             // Since we're using a custom action layout we have to manually hook up the handler.
             saveMenu.getActionView().setOnClickListener(new View.OnClickListener() {
@@ -1009,6 +1002,16 @@
     }
 
     /**
+     * @return true if the single raw contact we're looking at is read-only.
+     */
+    private boolean isEditingReadOnlyRawContact() {
+        return hasValidState() && mRawContactIdToDisplayAlone > 0
+                && !mState.getByRawContactId(mRawContactIdToDisplayAlone)
+                        .getAccountType(AccountTypeManager.getInstance(mContext))
+                                .areContactsWritable();
+    }
+
+    /**
      * Return true if there are any edits to the current contact which need to
      * be saved.
      */
@@ -1860,13 +1863,6 @@
         getEditorActivity().changePhoto(getPhotoMode());
     }
 
-    @Override
-    public void onRawContactSelected(long rawContactId, boolean isReadOnly) {
-        mRawContactDisplayAloneIsReadOnly = isReadOnly;
-        mRawContactIdToDisplayAlone = rawContactId;
-        bindEditors();
-    }
-
     private int getPhotoMode() {
         return getContent().isWritablePhotoSet() ? PhotoActionPopup.Modes.WRITE_ABLE_PHOTO
                 : PhotoActionPopup.Modes.NO_PHOTO;
diff --git a/src/com/android/contacts/editor/RawContactEditorView.java b/src/com/android/contacts/editor/RawContactEditorView.java
index bbd23d4..d3c7535 100644
--- a/src/com/android/contacts/editor/RawContactEditorView.java
+++ b/src/com/android/contacts/editor/RawContactEditorView.java
@@ -44,7 +44,6 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.AdapterView;
-import android.widget.BaseAdapter;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.ListPopupWindow;
@@ -62,8 +61,6 @@
 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.DeviceLocalAccountType;
-import com.android.contacts.common.model.account.SimAccountType;
 import com.android.contacts.common.model.dataitem.CustomDataItem;
 import com.android.contacts.common.model.dataitem.DataKind;
 import com.android.contacts.common.util.AccountsListAdapter;
@@ -73,7 +70,6 @@
 import java.io.FileNotFoundException;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
@@ -120,76 +116,7 @@
          * Invoked after editors have been bound for the contact.
          */
         public void onEditorsBound();
-
-        /**
-         * Invoked when a rawcontact from linked contacts is selected in editor.
-         */
-        void onRawContactSelected(long rawContactId, boolean isReadOnly);
     }
-
-    /**
-     * Used to list the account info for the given raw contacts list.
-     */
-    private static final class RawContactAccountListAdapter extends BaseAdapter {
-        private final LayoutInflater mInflater;
-        private final Context mContext;
-        private final RawContactDeltaList mRawContactDeltas;
-
-        public RawContactAccountListAdapter(Context context, RawContactDeltaList rawContactDeltas) {
-            mContext = context;
-            mRawContactDeltas = new RawContactDeltaList();
-            for (RawContactDelta rawContactDelta : rawContactDeltas) {
-                if (rawContactDelta.isVisible() && rawContactDelta.getRawContactId() > 0) {
-                    mRawContactDeltas.add(rawContactDelta);
-                }
-            }
-            mInflater = LayoutInflater.from(context);
-        }
-
-        @Override
-        public View getView(int position, View convertView, ViewGroup parent) {
-            final View resultView = convertView != null ? convertView
-                    : mInflater.inflate(R.layout.account_selector_list_item, parent, false);
-
-            final RawContactDelta rawContactDelta = mRawContactDeltas.get(position);
-
-            final TextView text1 = (TextView) resultView.findViewById(android.R.id.text1);
-            final AccountType accountType = rawContactDelta.getRawContactAccountType(mContext);
-            text1.setText(accountType.getDisplayLabel(mContext));
-
-            final TextView text2 = (TextView) resultView.findViewById(android.R.id.text2);
-            final String accountName = rawContactDelta.getAccountName();
-            if (TextUtils.isEmpty(accountName) || accountType instanceof DeviceLocalAccountType
-                    || accountType instanceof SimAccountType) {
-                text2.setVisibility(View.GONE);
-            } else {
-                // Truncate email addresses in the middle so we don't lose the domain
-                text2.setText(accountName);
-                text2.setEllipsize(TextUtils.TruncateAt.MIDDLE);
-            }
-
-            final ImageView icon = (ImageView) resultView.findViewById(android.R.id.icon);
-            icon.setImageDrawable(accountType.getDisplayIcon(mContext));
-
-            return resultView;
-        }
-
-        @Override
-        public int getCount() {
-            return mRawContactDeltas.size();
-        }
-
-        @Override
-        public RawContactDelta getItem(int position) {
-            return mRawContactDeltas.get(position);
-        }
-
-        @Override
-        public long getItemId(int position) {
-            return getItem(position).getRawContactId();
-        }
-    }
-
     /**
      * Sorts kinds roughly the same as quick contacts; we diverge in the following ways:
      * <ol>
@@ -578,7 +505,6 @@
     }
 
     private void pickRawContactDelta() {
-        // Build the kind section data list map
         vlog("parse: " + mRawContactDeltas.size() + " rawContactDelta(s)");
         for (int j = 0; j < mRawContactDeltas.size(); j++) {
             final RawContactDelta rawContactDelta = mRawContactDeltas.get(j);
@@ -618,15 +544,17 @@
 
         for (int i = 0; i < dataKindSize; i++) {
             final DataKind dataKind = dataKinds.get(i);
-            if (dataKind == null) {
-                vlog("parse: " + i + " " + dataKind.mimeType + " dropped null data kind");
+            // Skip null and un-editable fields.
+            if (dataKind == null || !dataKind.editable) {
+                vlog("parse: " + i +
+                        (dataKind == null ? " dropped null data kind"
+                        : " dropped uneditable mimetype: " + dataKind.mimeType));
                 continue;
             }
             final String mimeType = dataKind.mimeType;
 
             // Skip psuedo mime types
-            if (DataKind.PSEUDO_MIME_TYPE_DISPLAY_NAME.equals(mimeType)
-                    || DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME.equals(mimeType)) {
+            if (DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME.equals(mimeType)) {
                 vlog("parse: " + i + " " + dataKind.mimeType + " dropped pseudo type");
                 continue;
             }
@@ -777,51 +705,16 @@
                 ? EditorUiUtils.getAccountHeaderLabelForMyProfile(getContext(), account)
                 : account.getNameLabel().toString();
 
-        // Either the account header or selector should be shown, not both.
+        addAccountHeader(accountLabel);
+
+        // If we're saving a new contact and there are multiple accounts, add the account selector.
         final List<AccountWithDataSet> accounts =
                 AccountTypeManager.getInstance(getContext()).getAccounts(true);
-
-        if (mHasNewContact && !mIsUserProfile) {
-            if (accounts.size() > 1) {
-                addAccountSelector(mCurrentRawContactDelta, accountLabel);
-            } else {
-                addAccountHeader(accountLabel);
-            }
-        } else {
-            // The raw contact selector should only display linked raw contacts that can be edited
-            // in the full editor (i.e. they are not newly created raw contacts)
-            final RawContactAccountListAdapter adapter =  new RawContactAccountListAdapter(
-                    getContext(), getRawContactDeltaListForSelector(mRawContactDeltas));
-            if (adapter.getCount() > 0 && !mIsEditingReadOnlyRawContactWithNewContact) {
-                addRawContactAccountSelector(accountLabel, adapter);
-            } else {
-                addAccountHeader(accountLabel);
-            }
+        if (mHasNewContact && !mIsUserProfile && accounts.size() > 1) {
+            addAccountSelector(mCurrentRawContactDelta);
         }
     }
 
-    private RawContactDeltaList getRawContactDeltaListForSelector(
-            RawContactDeltaList rawContactDeltas) {
-        // Sort raw contacts so google accounts come first
-        Collections.sort(rawContactDeltas, new RawContactDeltaComparator(getContext()));
-
-        final RawContactDeltaList result = new RawContactDeltaList();
-        for (int i = 0; i < rawContactDeltas.size(); i++) {
-            final RawContactDelta rawContactDelta = rawContactDeltas.get(i);
-            if (rawContactDelta.isVisible() && rawContactDelta.getRawContactId() > 0) {
-                // Only add raw contacts that can be opened in the editor
-                result.add(rawContactDelta);
-            }
-        }
-        // Don't return a list of size 1 that would just open the current raw contact being edited.
-        if (result.size() == 1 && result.get(0).getRawContactAccountType(
-                getContext()).areContactsWritable()) {
-            result.clear();
-            return result;
-        }
-        return result;
-    }
-
     private void addAccountHeader(String accountLabel) {
         mAccountHeaderContainer.setVisibility(View.VISIBLE);
 
@@ -846,8 +739,10 @@
                         selectorTitle));
     }
 
-    private void addAccountSelector(final RawContactDelta rawContactDelta, CharSequence nameLabel) {
-        final View.OnClickListener onClickListener = new View.OnClickListener() {
+    private void addAccountSelector(final RawContactDelta rawContactDelta) {
+        // Add handlers for choosing another account to save to.
+        mAccountHeaderExpanderIcon.setVisibility(View.VISIBLE);
+        mAccountHeaderContainer.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 final ListPopupWindow popup = new ListPopupWindow(getContext(), null);
@@ -877,53 +772,7 @@
                 });
                 popup.show();
             }
-        };
-        setUpAccountSelector(nameLabel.toString(), onClickListener);
-    }
-
-    private void addRawContactAccountSelector(String nameLabel,
-            final RawContactAccountListAdapter adapter) {
-        final View.OnClickListener onClickListener = new OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                final ListPopupWindow popup = new ListPopupWindow(getContext(), null);
-                popup.setWidth(mAccountHeaderContainer.getWidth());
-                popup.setAnchorView(mAccountHeaderContainer);
-                popup.setAdapter(adapter);
-                popup.setModal(true);
-                popup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NOT_NEEDED);
-                popup.setOnItemClickListener(new AdapterView.OnItemClickListener() {
-                    @Override
-                    public void onItemClick(AdapterView<?> parent, View view, int position,
-                                            long id) {
-                        UiClosables.closeQuietly(popup);
-                        final long rawContactId = adapter.getItemId(position);
-                        // Only switch if it's actually a different raw contact.
-                        if (rawContactId != mCurrentRawContactDelta.getRawContactId()
-                                && mListener != null) {
-                            final RawContactDelta rawContactDelta = adapter.getItem(position);
-                            final AccountTypeManager accountTypes = AccountTypeManager.getInstance(
-                                    getContext());
-                            final AccountType accountType = rawContactDelta.getAccountType(
-                                    accountTypes);
-                            final boolean isReadOnly = !accountType.areContactsWritable();
-                            // Reset state.
-                            mIsExpanded = false;
-                            mListener.onRawContactSelected(rawContactId, isReadOnly);
-                        }
-                    }
-                });
-                popup.show();
-            }
-        };
-        setUpAccountSelector(nameLabel, onClickListener);
-    }
-
-    private void setUpAccountSelector(String nameLabel, OnClickListener listener) {
-        addAccountHeader(nameLabel);
-        // Add handlers for choosing another account to save to.
-        mAccountHeaderExpanderIcon.setVisibility(View.VISIBLE);
-        mAccountHeaderContainer.setOnClickListener(listener);
+        });
     }
 
     private void addPhotoView() {
