diff options
author | zachh <zachh@google.com> | 2018-01-26 10:56:46 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-26 12:13:04 -0800 |
commit | 03b13198537df025febb842db7f95794a1faad8f (patch) | |
tree | 2e013c45154e63429d9c4db817d07d3e79a06658 /java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java | |
parent | 268aed51f835788ef44329db50b62b34215b9203 (diff) |
Added number presentation to AnnotatedCallLog.
Updated the new call log UI to properly show text based on the presentation.
Bug: 70989592
Test: unit
PiperOrigin-RevId: 183414195
Change-Id: I2123f37cd3c733060125b6e894c1a80be4193ad6
Diffstat (limited to 'java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java')
-rw-r--r-- | java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java index 93c35c5fa..24410ee30 100644 --- a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java +++ b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java @@ -196,6 +196,7 @@ public class SystemCallLogDataSource implements CallLogDataSource { // recent one. .useMostRecentBlob(AnnotatedCallLog.NUMBER) .useMostRecentString(AnnotatedCallLog.FORMATTED_NUMBER) + .useSingleValueInt(AnnotatedCallLog.NUMBER_PRESENTATION) .useMostRecentString(AnnotatedCallLog.GEOCODED_LOCATION) .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME) .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_ID) @@ -239,6 +240,7 @@ public class SystemCallLogDataSource implements CallLogDataSource { Calls.DATE, Calls.LAST_MODIFIED, // TODO(a bug): Not available in M Calls.NUMBER, + Calls.NUMBER_PRESENTATION, Calls.TYPE, Calls.COUNTRY_ISO, Calls.DURATION, @@ -251,7 +253,7 @@ public class SystemCallLogDataSource implements CallLogDataSource { Calls.PHONE_ACCOUNT_COMPONENT_NAME, Calls.PHONE_ACCOUNT_ID, Calls.FEATURES, - Calls.POST_DIAL_DIGITS, // TODO(a bug): Not available in M + Calls.POST_DIAL_DIGITS // TODO(a bug): Not available in M }, // TODO(a bug): LAST_MODIFIED not available on M Calls.LAST_MODIFIED + " > ? AND " + Voicemails.DELETED + " = 0", @@ -273,6 +275,7 @@ public class SystemCallLogDataSource implements CallLogDataSource { int dateColumn = cursor.getColumnIndexOrThrow(Calls.DATE); int lastModifiedColumn = cursor.getColumnIndexOrThrow(Calls.LAST_MODIFIED); int numberColumn = cursor.getColumnIndexOrThrow(Calls.NUMBER); + int presentationColumn = cursor.getColumnIndexOrThrow(Calls.NUMBER_PRESENTATION); int typeColumn = cursor.getColumnIndexOrThrow(Calls.TYPE); int countryIsoColumn = cursor.getColumnIndexOrThrow(Calls.COUNTRY_ISO); int durationsColumn = cursor.getColumnIndexOrThrow(Calls.DURATION); @@ -295,11 +298,18 @@ public class SystemCallLogDataSource implements CallLogDataSource { long id = cursor.getLong(idColumn); long date = cursor.getLong(dateColumn); String numberAsStr = cursor.getString(numberColumn); - long type; + int type; if (cursor.isNull(typeColumn) || (type = cursor.getInt(typeColumn)) == 0) { // CallLog.Calls#TYPE lists the allowed values, which are non-null and non-zero. throw new IllegalStateException("call type is missing"); } + int presentation; + if (cursor.isNull(presentationColumn) + || (presentation = cursor.getInt(presentationColumn)) == 0) { + // CallLog.Calls#NUMBER_PRESENTATION lists the allowed values, which are non-null and + // non-zero. + throw new IllegalStateException("presentation is missing"); + } String countryIso = cursor.getString(countryIsoColumn); int duration = cursor.getInt(durationsColumn); int dataUsage = cursor.getInt(dataUsageColumn); @@ -333,6 +343,7 @@ public class SystemCallLogDataSource implements CallLogDataSource { contentValues.put( AnnotatedCallLog.NUMBER, DialerPhoneNumber.getDefaultInstance().toByteArray()); } + contentValues.put(AnnotatedCallLog.NUMBER_PRESENTATION, presentation); contentValues.put(AnnotatedCallLog.CALL_TYPE, type); contentValues.put(AnnotatedCallLog.IS_READ, isRead); contentValues.put(AnnotatedCallLog.NEW, isNew); |