Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e224017d authored by Andrew Lee's avatar Andrew Lee
Browse files

Fix abundance of "Custom" labels.

Not sure precisely why this changed, but hopefully this logic is
more robust. Show the geocoded location if there is no name to use
and a location is available.

Removed GEOCODE_AS_LABEL, which wasn't really used anymore.

Bug: 21814339
Change-Id: I1343282ef415647853d7995d900a3f50186ad156
parent af049afa
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);
            }
        }

+0 −2
Original line number Diff line number Diff line
@@ -48,8 +48,6 @@ public class ContactInfo {

    public static ContactInfo EMPTY = new ContactInfo();

    public static String GEOCODE_AS_LABEL = "";

    public int sourceType = 0;

    @Override
+0 −1
Original line number Diff line number Diff line
@@ -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) {
+0 −6
Original line number Diff line number Diff line
@@ -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)