summaryrefslogtreecommitdiff
path: root/src/com/android/dialer/calllog/CallLogAdapter.java
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2014-07-10 12:28:43 -0700
committerTyler Gunn <tgunn@google.com>2014-07-10 12:28:43 -0700
commit8b0e858d5b4c50813dbe2b5c244e7013814b23ec (patch)
treee17124adb6cfd3f4e70595baf4f66d847292bc1d /src/com/android/dialer/calllog/CallLogAdapter.java
parent70d301e1239c9324c071c10888bf6d7b0b48ddaa (diff)
Adding support for video call icon and data usage in call log.
Bug: 16013684 Bug: 16015261 Change-Id: Ie75443d641c1e09a5772bb618aba55de8583716b
Diffstat (limited to 'src/com/android/dialer/calllog/CallLogAdapter.java')
-rw-r--r--src/com/android/dialer/calllog/CallLogAdapter.java29
1 files changed, 27 insertions, 2 deletions
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);