Don't display Custom for PHONE_TYPE=CUSTOM part 1.

Dialer sometimes creates custom PHONE_TYPE values without
specifying the custom string. In this case, we shouldn't
display "Custom". We should display nothing.

BUG 21900262

Change-Id: I11aff369c76126a3f60f95aa589ae2a8a3e98bb1
This commit is contained in:
Tingting Wang
2015-07-07 16:58:13 -07:00
parent 024bce8229
commit d55b348e62

View File

@@ -5957,7 +5957,9 @@ public final class ContactsContract {
*/
public static final CharSequence getTypeLabel(Resources res, int type,
CharSequence label) {
if ((type == TYPE_CUSTOM || type == TYPE_ASSISTANT) && !TextUtils.isEmpty(label)) {
if (type == TYPE_CUSTOM) {
return (label != null ? label : "");
} else if (type == TYPE_ASSISTANT && !TextUtils.isEmpty(label)) {
return label;
} else {
final int labelRes = getTypeLabelResource(type);