Skip to content

Commit

Permalink
CallDetailHeader: Don't offer to add a number to contacts.
Browse files Browse the repository at this point in the history
This is related to barrykn/android-cm7-bkndh1#9.
  • Loading branch information
barrykn committed Jun 2, 2013
1 parent 92f9e0d commit f393e5a
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions src/com/android/contacts/CallDetailHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,32 +212,8 @@ public void updateViews(String number, Data data) {
mainActionIcon = R.drawable.ic_contacts_holo_dark;
mainActionDescription =
mResources.getString(R.string.description_view_contact, nameOrNumber);
} else if (isVoicemailNumber) {
mainActionIntent = null;
mainActionIcon = 0;
mainActionDescription = null;
} else if (isSipNumber) {
// TODO: This item is currently disabled for SIP addresses, because
// the Insert.PHONE extra only works correctly for PSTN numbers.
//
// To fix this for SIP addresses, we need to:
// - define ContactsContract.Intents.Insert.SIP_ADDRESS, and use it here if
// the current number is a SIP address
// - update the contacts UI code to handle Insert.SIP_ADDRESS by
// updating the SipAddress field
// and then we can remove the "!isSipNumber" check above.
mainActionIntent = null;
mainActionIcon = 0;
mainActionDescription = null;
} else if (mCanPlaceCallsTo) {
mainActionIntent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
mainActionIntent.setType(Contacts.CONTENT_ITEM_TYPE);
mainActionIntent.putExtra(Insert.PHONE, number);
mainActionIcon = R.drawable.ic_add_contact_holo_dark;
mainActionDescription = mResources.getString(R.string.description_add_contact);
} else {
// If we cannot call the number, when we probably cannot add it as a contact either.
// This is usually the case of private, unknown, or payphone numbers.
// Do not allow the option of adding to contacts.
mainActionIntent = null;
mainActionIcon = 0;
mainActionDescription = null;
Expand Down

0 comments on commit f393e5a

Please sign in to comment.