diff options
author | Tingting Wang <tingtingw@google.com> | 2015-07-07 16:58:13 -0700 |
---|---|---|
committer | Tingting Wang <tingtingw@google.com> | 2015-07-08 12:55:22 -0700 |
commit | d55b348e629d5ae5a2efbba6735be4b30220e50b (patch) | |
tree | 740474cdbca7d59f0faf02dbd9f04a2591e52a3c /core/java/android/provider | |
parent | 024bce82292786f9b71da488f06a0bb35d029bbf (diff) | |
download | frameworks_base-d55b348e629d5ae5a2efbba6735be4b30220e50b.zip frameworks_base-d55b348e629d5ae5a2efbba6735be4b30220e50b.tar.gz frameworks_base-d55b348e629d5ae5a2efbba6735be4b30220e50b.tar.bz2 |
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
Diffstat (limited to 'core/java/android/provider')
-rw-r--r-- | core/java/android/provider/ContactsContract.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java index 8ce1cbf..d547a60 100644 --- a/core/java/android/provider/ContactsContract.java +++ b/core/java/android/provider/ContactsContract.java @@ -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); |