diff options
author | Andrew Lee <anwlee@google.com> | 2015-06-15 21:40:56 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-06-15 21:40:56 +0000 |
commit | a396ed89f79196443cb4781bf4f2eeea1c5e72fc (patch) | |
tree | f10103365509972de0cbca40dacfa26d1c2b420e | |
parent | 9ca1072866f9c76d1a6ed39117eef2535ec57ccd (diff) | |
parent | becbb119bdcd96257106b990ce84bac99388deac (diff) |
am becbb119: Merge "Fix abundance of "Custom" labels." into mnc-dev
* commit 'becbb119bdcd96257106b990ce84bac99388deac':
Fix abundance of "Custom" labels.
4 files changed, 3 insertions, 12 deletions
diff --git a/src/com/android/dialer/PhoneCallDetailsHelper.java b/src/com/android/dialer/PhoneCallDetailsHelper.java index c8206227a..68b47afcf 100644 --- a/src/com/android/dialer/PhoneCallDetailsHelper.java +++ b/src/com/android/dialer/PhoneCallDetailsHelper.java @@ -181,11 +181,11 @@ public class PhoneCallDetailsHelper { && !mPhoneNumberUtilsWrapper.isVoicemailNumber(details.accountHandle, details.number)) { - if (details.numberLabel == ContactInfo.GEOCODE_AS_LABEL) { + if (TextUtils.isEmpty(details.name) && !TextUtils.isEmpty(details.geocode)) { numberFormattedLabel = details.geocode; } else { - numberFormattedLabel = Phone.getTypeLabel(mResources, details.numberType, - details.numberLabel); + numberFormattedLabel = Phone.getTypeLabel( + mResources, details.numberType, details.numberLabel); } } diff --git a/src/com/android/dialer/calllog/ContactInfo.java b/src/com/android/dialer/calllog/ContactInfo.java index effe14270..357c832cf 100644 --- a/src/com/android/dialer/calllog/ContactInfo.java +++ b/src/com/android/dialer/calllog/ContactInfo.java @@ -48,8 +48,6 @@ public class ContactInfo { public static ContactInfo EMPTY = new ContactInfo(); - public static String GEOCODE_AS_LABEL = ""; - public int sourceType = 0; @Override diff --git a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java index 9edbbc9b3..2ee38cbe5 100644 --- a/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java +++ b/tests/src/com/android/dialer/PhoneCallDetailsHelperTest.java @@ -389,7 +389,6 @@ public class PhoneCallDetailsHelperTest extends AndroidTestCase { details.date = TEST_DATE; details.duration = TEST_DURATION; details.geocode = TEST_GEOCODE; - details.numberLabel = ContactInfo.GEOCODE_AS_LABEL; } private boolean isVoicemail(String number) { diff --git a/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java b/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java index a739b16d2..b3906f814 100644 --- a/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java @@ -227,8 +227,6 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme @MediumTest public void testBindView_WithCachedName() { mCursor.moveToFirst(); - // provide a default custom label instead of an empty string, which corresponds to - // {@value com.android.dialer.calllog.ContactInfo#GEOCODE_AS_LABEL} insertWithCachedValues(TEST_NUMBER, NOW, 0, Calls.INCOMING_TYPE, "John Doe", Phone.TYPE_HOME, TEST_DEFAULT_CUSTOM_LABEL); CallLogListItemViewHolder viewHolder = (CallLogListItemViewHolder) @@ -255,8 +253,6 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme @MediumTest public void testBindView_HomeLabel() { mCursor.moveToFirst(); - // provide a default custom label instead of an empty string, which corresponds to - // {@value com.android.dialer.calllog.ContactInfo#GEOCODE_AS_LABEL} insertWithCachedValues(TEST_NUMBER, NOW, 0, Calls.INCOMING_TYPE, "John Doe", Phone.TYPE_HOME, TEST_DEFAULT_CUSTOM_LABEL); CallLogListItemViewHolder viewHolder = (CallLogListItemViewHolder) @@ -270,8 +266,6 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme @MediumTest public void testBindView_WorkLabel() { mCursor.moveToFirst(); - // provide a default custom label instead of an empty string, which corresponds to - // {@link com.android.dialer.calllog.ContactInfo#GEOCODE_AS_LABEL} insertWithCachedValues(TEST_NUMBER, NOW, 0, Calls.INCOMING_TYPE, "John Doe", Phone.TYPE_WORK, TEST_DEFAULT_CUSTOM_LABEL); CallLogListItemViewHolder viewHolder = (CallLogListItemViewHolder) |