Use separate API when sending vCard through ACTION_SEND.
Fixes http://b/2138790
diff --git a/src/com/android/contacts/ViewContactActivity.java b/src/com/android/contacts/ViewContactActivity.java
index 921d5a7..8275686 100644
--- a/src/com/android/contacts/ViewContactActivity.java
+++ b/src/com/android/contacts/ViewContactActivity.java
@@ -670,9 +670,13 @@
return true;
}
case R.id.menu_share: {
+ // TODO: Keep around actual LOOKUP_KEY, or formalize method of extracting
+ final String lookupKey = mLookupUri.getPathSegments().get(2);
+ final Uri shareUri = Uri.withAppendedPath(Contacts.CONTENT_VCARD_URI, lookupKey);
+
final Intent intent = new Intent(Intent.ACTION_SEND);
- intent.setType(Contacts.CONTENT_ITEM_TYPE);
- intent.putExtra(Intent.EXTRA_STREAM, mLookupUri);
+ intent.setType(Contacts.CONTENT_VCARD_TYPE);
+ intent.putExtra(Intent.EXTRA_STREAM, shareUri);
// Launch chooser to share contact via
final CharSequence chooseTitle = getText(R.string.share_via);