diff --git a/src/com/android/contacts/model/RawContactModifier.java b/src/com/android/contacts/model/RawContactModifier.java
index f1f5697..5f8b410 100644
--- a/src/com/android/contacts/model/RawContactModifier.java
+++ b/src/com/android/contacts/model/RawContactModifier.java
@@ -58,6 +58,7 @@
 import com.android.contacts.common.model.account.AccountType.EventEditType;
 import com.android.contacts.common.model.account.GoogleAccountType;
 import com.android.contacts.common.model.dataitem.DataKind;
+import com.android.contacts.model.dataitem.PhoneDataItem;
 import com.android.contacts.model.dataitem.StructuredNameDataItem;
 import com.android.contacts.util.DateUtils;
 import com.android.contacts.util.NameConverter;
@@ -693,6 +694,16 @@
             // Won't override the contact name
             if (StructuredName.CONTENT_ITEM_TYPE.equals(mimeType)) {
                 continue;
+            } else if (Phone.CONTENT_ITEM_TYPE.equals(mimeType)) {
+                values.remove(PhoneDataItem.KEY_FORMATTED_PHONE_NUMBER);
+                final Integer type = values.getAsInteger(Phone.TYPE);
+                // If the provided phone number provides a custom phone type but not a label,
+                // replace it with mobile (by default) to avoid the "Enter custom label" from
+                // popping up immediately upon entering the ContactEditorFragment
+                if (type != null && type == Phone.TYPE_CUSTOM &&
+                        TextUtils.isEmpty(values.getAsString(Phone.LABEL))) {
+                    values.put(Phone.TYPE, Phone.TYPE_MOBILE);
+                }
             }
 
             DataKind kind = accountType.getKindForMimetype(mimeType);
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 1e91fb6..28d63ec 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -37,6 +37,9 @@
 import android.provider.ContactsContract.CommonDataKinds.StructuredPostal;
 import android.provider.ContactsContract.CommonDataKinds.Website;
 import android.provider.ContactsContract.Contacts;
+import android.provider.ContactsContract.DisplayNameSources;
+import android.provider.ContactsContract.Intents.Insert;
+import android.provider.ContactsContract.Directory;
 import android.provider.ContactsContract.QuickContact;
 import android.provider.ContactsContract.RawContacts;
 import android.support.v13.app.FragmentPagerAdapter;
@@ -114,11 +117,12 @@
     private View mLineAfterTrack;
 
     private ImageView mPhotoView;
-    private ImageView mOpenDetailsImage;
+    private ImageView mOpenDetailsOrAddContactImage;
     private ImageView mStarImage;
     private ViewPager mListPager;
     private ViewPagerAdapter mPagerAdapter;
 
+    private Contact mContactData;
     private ContactLoader mContactLoader;
 
     private final ImageViewDrawableSetter mPhotoSetter = new ImageViewDrawableSetter();
@@ -159,6 +163,37 @@
     private StopWatch mStopWatch = ENABLE_STOPWATCH
             ? StopWatch.start("QuickContact") : StopWatch.getNullStopWatch();
 
+    final OnClickListener mOpenDetailsClickHandler = new OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            final Intent intent = new Intent(Intent.ACTION_VIEW, mLookupUri);
+            mContactLoader.cacheResult();
+            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+            startActivity(intent);
+            close(false);
+        }
+    };
+
+    final OnClickListener mAddToContactsClickHandler = new OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            if (mContactData == null) {
+                Log.e(TAG, "Empty contact data when trying to add to contact");
+                return;
+            }
+            final Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
+            intent.setType(Contacts.CONTENT_ITEM_TYPE);
+
+            // Only pre-fill the name field if the provided display name is an organization
+            // name or better (e.g. structured name, nickname)
+            if (mContactData.getDisplayNameSource() >= DisplayNameSources.ORGANIZATION) {
+                intent.putExtra(Insert.NAME, mContactData.getDisplayName());
+            }
+            intent.putExtra(Insert.DATA, mContactData.getContentValues());
+            startActivity(intent);
+        }
+    };
+
     @Override
     protected void onCreate(Bundle icicle) {
         mStopWatch.lap("c"); // create start
@@ -202,7 +237,7 @@
         mFloatingLayout = (FloatingChildLayout) findViewById(R.id.floating_layout);
         mTrack = (ViewGroup) findViewById(R.id.track);
         mTrackScroller = (HorizontalScrollView) findViewById(R.id.track_scroller);
-        mOpenDetailsImage = (ImageView) findViewById(R.id.contact_details_image);
+        mOpenDetailsOrAddContactImage = (ImageView) findViewById(R.id.contact_details_image);
         mStarImage = (ImageView) findViewById(R.id.quickcontact_star_button);
         mListPager = (ViewPager) findViewById(R.id.item_list_pager);
         mSelectedTabRectangle = findViewById(R.id.selected_tab_rectangle);
@@ -216,17 +251,7 @@
             }
         });
 
-        final OnClickListener openDetailsClickHandler = new OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                final Intent intent = new Intent(Intent.ACTION_VIEW, mLookupUri);
-                mContactLoader.cacheResult();
-                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
-                startActivity(intent);
-                close(false);
-            }
-        };
-        mOpenDetailsImage.setOnClickListener(openDetailsClickHandler);
+        mOpenDetailsOrAddContactImage.setOnClickListener(mOpenDetailsClickHandler);
 
         mPagerAdapter = new ViewPagerAdapter(getFragmentManager());
         mListPager.setAdapter(mPagerAdapter);
@@ -243,7 +268,7 @@
         setHeaderNameText(R.id.name, R.string.missing_name);
 
         mPhotoView = (ImageView) mPhotoContainer.findViewById(R.id.photo);
-        mPhotoView.setOnClickListener(openDetailsClickHandler);
+        mPhotoView.setOnClickListener(mOpenDetailsClickHandler);
 
         mStopWatch.lap("v"); // view initialized
 
@@ -341,11 +366,12 @@
      * Handle the result from the ContactLoader
      */
     private void bindData(Contact data) {
+        mContactData = data;
         final ResolveCache cache = ResolveCache.getInstance(this);
         final Context context = this;
 
-        mOpenDetailsImage.setVisibility(isMimeExcluded(Contacts.CONTENT_ITEM_TYPE) ? View.GONE
-                : View.VISIBLE);
+        mOpenDetailsOrAddContactImage.setVisibility(isMimeExcluded(Contacts.CONTENT_ITEM_TYPE) ?
+                View.GONE : View.VISIBLE);
         final boolean isStarred = data.getStarred();
         if (isStarred) {
             mStarImage.setImageResource(R.drawable.ic_favorite_on_lt);
@@ -357,7 +383,19 @@
         // If this is a json encoded URI, there is no local contact to star
         if (UriUtils.isEncodedContactUri(lookupUri)) {
             mStarImage.setVisibility(View.GONE);
+
+            // If directory export support is not allowed, then don't allow the user to add
+            // to contacts
+            if (mContactData.getDirectoryExportSupport() == Directory.EXPORT_SUPPORT_NONE) {
+                mOpenDetailsOrAddContactImage.setImageResource(R.drawable.ic_contacts_holo_dark);
+                mOpenDetailsOrAddContactImage.setOnClickListener(mOpenDetailsClickHandler);
+            } else {
+                mOpenDetailsOrAddContactImage.setImageResource(R.drawable.ic_add_contact_holo_dark);
+                mOpenDetailsOrAddContactImage.setOnClickListener(mAddToContactsClickHandler);
+            }
         } else {
+            mOpenDetailsOrAddContactImage.setImageResource(R.drawable.ic_contacts_holo_dark);
+            mOpenDetailsOrAddContactImage.setOnClickListener(mOpenDetailsClickHandler);
             mStarImage.setVisibility(View.VISIBLE);
             mStarImage.setOnClickListener(new OnClickListener() {
                 @Override
