@Override protected boolean isCustom(Integer type) { return ContactDisplayUtils.isCustomPhoneType(type); }
@Override protected boolean isCustom(Integer type) { return ContactDisplayUtils.isCustomPhoneType(type); }
/** * Gets a display label for a given phone type. * * @param type The type of number. * @param customLabel A custom label to use if the phone is determined to be of custom type * determined by {@link #isCustomPhoneType(Integer))} * @param interactionType whether this is a call or sms. Either {@link #INTERACTION_CALL} or * {@link #INTERACTION_SMS}. * @param context The application context. * @return An appropriate string label */ public static CharSequence getLabelForCallOrSms(Integer type, CharSequence customLabel, int interactionType, Context context) { Preconditions.checkNotNull(context); if (isCustomPhoneType(type)) { return (customLabel == null) ? "" : customLabel; } else { int resId; if (interactionType == INTERACTION_SMS) { resId = getSmsLabelResourceId(type); } else { resId = getPhoneLabelResourceId(type); if (interactionType != INTERACTION_CALL) { Log.e(TAG, "Un-recognized interaction type: " + interactionType + ". Defaulting to ContactDisplayUtils.INTERACTION_CALL."); } } return context.getResources().getText(resId); } }