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

Commit 34b1d213 authored by Yorke Lee's avatar Yorke Lee Committed by Android (Google) Code Review
Browse files

Merge "Format phone number in QuickContactsActivity" into jb-mr1.1-dev

parents 5159ac55 ae87a56c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -206,6 +206,17 @@ public class DataItem {
        return actionBody == null ? null : actionBody.toString();
    }

    /**
     * This builds the data string(intended for display) depending on the type of data item. It
     * returns the same value as {@link #buildDataString} by default, but certain data items can
     * override it to provide their version of formatted data strings.
     *
     * @return Data string representing the data item, possibly formatted for display
     */
    public String buildDataStringForDisplay() {
        return buildDataString();
    }

    public String getKindString() {
        final DataKind kind = getDataKind();
        return (kind.titleRes == -1 || kind.titleRes == 0) ? ""
+13 −0
Original line number Diff line number Diff line
@@ -70,4 +70,17 @@ public class PhoneDataItem extends DataItem {
        }
    }

    /**
     * Returns the formatted phone number (if already computed using {@link
     * #computeFormattedPhoneNumber}). Otherwise this method returns the unformatted phone number.
     */
    @Override
    public String buildDataStringForDisplay() {
        final String formatted = getFormattedPhoneNumber();
        if (formatted != null) {
            return formatted;
        } else {
            return getNumber();
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ public class DataAction implements Action {
        }

        mIsPrimary = item.isSuperPrimary();
        mBody = item.buildDataString();
        mBody = item.buildDataStringForDisplay();

        mDataId = item.getId();
        mDataUri = ContentUris.withAppendedId(Data.CONTENT_URI, mDataId);
+4 −1
Original line number Diff line number Diff line
@@ -546,7 +546,10 @@ public class QuickContactActivity extends Activity {
            if (mLookupUri == null) {
                Log.wtf(TAG, "Lookup uri wasn't initialized. Loader was started too early");
            }
            return new ContactLoader(getApplicationContext(), mLookupUri, false);
            return new ContactLoader(getApplicationContext(), mLookupUri,
                    false /*loadGroupMetaData*/, false /*loadStreamItems*/,
                    false /*loadInvitableAccountTypes*/, false /*postViewNotification*/,
                    true /*computeFormattedPhoneNumber*/);
        }
    };