summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrandon Maxwell <maxwelb@google.com>2015-11-02 11:28:35 -0800
committerBrandon Maxwell <maxwelb@google.com>2015-11-03 15:47:39 -0800
commitab4443c7e235e0feebca7eadf70ecd9bd2455b46 (patch)
treef78f94a64037c39046f3a82c2b13e13b39962dca /src
parent7d048b14177813c9c2b857c67d69698af466a5c7 (diff)
Changing method to public, static for use in InCallUi
+ Changed ContactInfoHelper.lookUpDisplayNameAlternative to public so it's usable in InCallUi + Changed ContactInfoHelper.lookUpDisplayNamealternative to static to cut down on object creation + Added tests for lookUpDisplayNameAlternative since it is public Change-Id: Iede746655a1ca773cb0cd8cf26df665e34ab47fc
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/calllog/ContactInfoHelper.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/dialer/calllog/ContactInfoHelper.java b/src/com/android/dialer/calllog/ContactInfoHelper.java
index 4b9d5532a..e760750b2 100644
--- a/src/com/android/dialer/calllog/ContactInfoHelper.java
+++ b/src/com/android/dialer/calllog/ContactInfoHelper.java
@@ -170,7 +170,7 @@ public class ContactInfoHelper {
}
String lookupKey = phoneLookupCursor.getString(PhoneQuery.LOOKUP_KEY);
ContactInfo contactInfo = createPhoneLookupContactInfo(phoneLookupCursor, lookupKey);
- contactInfo.nameAlternative = lookUpDisplayNameAlternative(lookupKey);
+ contactInfo.nameAlternative = lookUpDisplayNameAlternative(mContext, lookupKey);
return contactInfo;
} finally {
phoneLookupCursor.close();
@@ -193,10 +193,14 @@ public class ContactInfoHelper {
return info;
}
- private String lookUpDisplayNameAlternative(String lookupKey) {
+ public static String lookUpDisplayNameAlternative(Context context, String lookupKey) {
+ if (lookupKey == null) {
+ return null;
+ }
+
Uri uri = Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI, lookupKey);
- Cursor cursor = mContext.getContentResolver().query(uri,
+ Cursor cursor = context.getContentResolver().query(uri,
PhoneQuery.DISPLAY_NAME_ALTERNATIVE_PROJECTION, null, null, null);
if (cursor == null) {