diff options
author | Nancy Chen <nancychen@google.com> | 2014-07-21 13:41:36 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2014-07-22 12:41:46 -0700 |
commit | b2eebafbc1f1e26b5178b2858ca335467b4bc341 (patch) | |
tree | b4f34c153cb5a0f8cba995ca62d84f96e3cb2ccf /src/com/android/dialer/CallDetailActivity.java | |
parent | ce4126734173687c887652a8914d4e9d13f6249e (diff) |
Enable icon selection in call log
Originally the call log was not hooked up with the PhoneAccount API,
this change hooks that part up.
Bug: 15473965
Change-Id: I96bdde927473abcdf7493573be29bf4979cf2696
Diffstat (limited to 'src/com/android/dialer/CallDetailActivity.java')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 3ef78af5c..42e4659f2 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -17,6 +17,7 @@ package com.android.dialer; import android.app.Activity; +import android.content.ComponentName; import android.content.ContentResolver; import android.content.ContentUris; import android.content.ContentValues; @@ -32,6 +33,8 @@ import android.provider.CallLog; import android.provider.CallLog.Calls; import android.provider.ContactsContract.CommonDataKinds.Phone; import android.provider.VoicemailContract.Voicemails; +import android.telecomm.PhoneAccount; +import android.telecomm.TelecommManager; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; @@ -54,6 +57,7 @@ import com.android.dialer.calllog.CallLogQuery; import com.android.dialer.calllog.CallTypeHelper; import com.android.dialer.calllog.ContactInfo; import com.android.dialer.calllog.ContactInfoHelper; +import com.android.dialer.calllog.PhoneAccountUtils; import com.android.dialer.calllog.PhoneNumberDisplayHelper; import com.android.dialer.calllog.PhoneNumberUtilsWrapper; import com.android.dialer.util.AsyncTaskExecutor; @@ -491,7 +495,11 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware final int callType = callCursor.getInt(CALL_TYPE_COLUMN_INDEX); String countryIso = callCursor.getString(COUNTRY_ISO_COLUMN_INDEX); final String geocode = callCursor.getString(GEOCODED_LOCATION_COLUMN_INDEX); - final Drawable accountIcon = getAccountIcon(callCursor); + + final Drawable accountIcon = PhoneAccountUtils.getAccountIcon(this, + PhoneAccountUtils.getAccount( + callCursor.getString(ACCOUNT_COMPONENT_NAME), + callCursor.getString(ACCOUNT_ID))); if (TextUtils.isEmpty(countryIso)) { countryIso = mDefaultCountryIso; @@ -547,17 +555,6 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware } } - /** - * Generate account object from data in Telecomm database - */ - private Drawable getAccountIcon(Cursor c) { - final String component_name = c.getString(ACCOUNT_COMPONENT_NAME); - final String account_id = c.getString(ACCOUNT_ID); - - // TODO: actually pull data from the database - return null; - } - /** Load the contact photos and places them in the corresponding views. */ private void loadContactPhotos(Uri contactUri, Uri photoUri, String displayName, String lookupKey, int contactType) { |