From 8b0e858d5b4c50813dbe2b5c244e7013814b23ec Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Thu, 10 Jul 2014 12:28:43 -0700 Subject: Adding support for video call icon and data usage in call log. Bug: 16013684 Bug: 16015261 Change-Id: Ie75443d641c1e09a5772bb618aba55de8583716b --- src/com/android/dialer/calllog/CallLogAdapter.java | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src/com/android/dialer/calllog/CallLogAdapter.java') diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 483c5020a..2987c9e4e 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -742,17 +742,23 @@ public class CallLogAdapter extends GroupingListAdapter final int[] callTypes = getCallTypes(c, count); final String geocode = c.getString(CallLogQuery.GEOCODED_LOCATION); final int sourceType = info.sourceType; + final int features = getCallFeatures(c, count); + Long dataUsage = null; + if (!c.isNull(CallLogQuery.DATA_USAGE)) { + dataUsage = c.getLong(CallLogQuery.DATA_USAGE); + } + final PhoneCallDetails details; if (TextUtils.isEmpty(name)) { details = new PhoneCallDetails(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, - duration, accountIcon); + duration, accountIcon, features, dataUsage); } else { details = new PhoneCallDetails(number, numberPresentation, formattedNumber, countryIso, geocode, callTypes, date, duration, name, ntype, label, lookupUri, photoUri, sourceType, - accountIcon); + accountIcon, features, dataUsage); } mCallLogViewsHelper.setPhoneCallDetails(views, details); @@ -1182,6 +1188,25 @@ public class CallLogAdapter extends GroupingListAdapter return callTypes; } + /** + * Determine the features which were enabled for any of the calls that make up a call log + * entry. + * + * @param cursor The cursor. + * @param count The number of calls for the current call log entry. + * @return The features. + */ + private int getCallFeatures(Cursor cursor, int count) { + int features = Calls.FEATURES_NONE; + int position = cursor.getPosition(); + for (int index = 0; index < count; ++index) { + features |= cursor.getInt(CallLogQuery.FEATURES); + cursor.moveToNext(); + } + cursor.moveToPosition(position); + return features; + } + private PhoneAccount getAccount(Cursor c) { final String component_name = c.getString(CallLogQuery.ACCOUNT_COMPONENT_NAME); final String account_id = c.getString(CallLogQuery.ACCOUNT_ID); -- cgit v1.2.3