diff options
author | twyen <twyen@google.com> | 2018-01-11 16:03:11 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-11 17:02:52 -0800 |
commit | 188b42fd10644373175fc204b48da98125004985 (patch) | |
tree | 9f7434fe8cb3bbf3cffc513225288e9946851745 /java/com/android/dialer/calllog/database | |
parent | 98280255db8824cb58caac596cb4f9febcf57306 (diff) |
Merge PhoneLookupDataSource results into a proto in annotated call log.
This allow extra information from PhoneLookup to be more easily added. Only PhoneLookupSelector and the proto will be affected for new attributes.
Test: Unit tests.
PiperOrigin-RevId: 181675568
Change-Id: I4e0bc1c6005b58a9b684b030b55bea6223af9ce3
Diffstat (limited to 'java/com/android/dialer/calllog/database')
-rw-r--r-- | java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java | 10 | ||||
-rw-r--r-- | java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java | 80 |
2 files changed, 6 insertions, 84 deletions
diff --git a/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java b/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java index f90d657b8..da93ff8a3 100644 --- a/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java +++ b/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java @@ -38,15 +38,10 @@ class AnnotatedCallLogDatabaseHelper extends SQLiteOpenHelper { + " (" + (AnnotatedCallLog._ID + " integer primary key, ") + (AnnotatedCallLog.TIMESTAMP + " integer, ") - + (AnnotatedCallLog.NAME + " text, ") + (AnnotatedCallLog.NUMBER + " blob, ") + (AnnotatedCallLog.FORMATTED_NUMBER + " text, ") - + (AnnotatedCallLog.PHOTO_URI + " text, ") - + (AnnotatedCallLog.PHOTO_ID + " integer, ") - + (AnnotatedCallLog.LOOKUP_URI + " text, ") + (AnnotatedCallLog.DURATION + " integer, ") + (AnnotatedCallLog.DATA_USAGE + " integer, ") - + (AnnotatedCallLog.NUMBER_TYPE_LABEL + " text, ") + (AnnotatedCallLog.IS_READ + " integer, ") + (AnnotatedCallLog.NEW + " integer, ") + (AnnotatedCallLog.GEOCODED_LOCATION + " text, ") @@ -55,13 +50,10 @@ class AnnotatedCallLogDatabaseHelper extends SQLiteOpenHelper { + (AnnotatedCallLog.PHONE_ACCOUNT_LABEL + " text, ") + (AnnotatedCallLog.PHONE_ACCOUNT_COLOR + " integer, ") + (AnnotatedCallLog.FEATURES + " integer, ") - + (AnnotatedCallLog.IS_BUSINESS + " integer, ") - + (AnnotatedCallLog.IS_VOICEMAIL + " integer, ") + (AnnotatedCallLog.TRANSCRIPTION + " integer, ") + (AnnotatedCallLog.VOICEMAIL_URI + " text, ") + (AnnotatedCallLog.CALL_TYPE + " integer, ") - + (AnnotatedCallLog.CAN_REPORT_AS_INVALID_NUMBER + " integer, ") - + (AnnotatedCallLog.CP2_INFO_INCOMPLETE + " integer") + + (AnnotatedCallLog.NUMBER_ATTRIBUTES + " blob ") + ");"; /** Deletes all but the first maxRows rows (by timestamp) to keep the table a manageable size. */ diff --git a/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java b/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java index 9161d6087..d382517cd 100644 --- a/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java +++ b/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java @@ -42,15 +42,6 @@ public class AnnotatedCallLogContract { String TIMESTAMP = "timestamp"; /** - * The name (which may be a person's name or business name, but not a number) formatted exactly - * as it should appear to the user. If the user's locale or name display preferences change, - * this column should be rewritten. - * - * <p>Type: TEXT - */ - String NAME = "name"; - - /** * The phone number called or number the call came from, encoded as a {@link * com.android.dialer.DialerPhoneNumber} proto. The number may be empty if it was an incoming * call and the number was unknown. @@ -68,38 +59,6 @@ public class AnnotatedCallLogContract { String FORMATTED_NUMBER = "formatted_number"; /** - * A photo URI for the contact to display in the call log list view. - * - * <p>TYPE: TEXT - */ - String PHOTO_URI = "photo_uri"; - - /** - * A photo ID (from the contacts provider) for the contact to display in the call log list view. - * - * <p>Type: INTEGER (long) - */ - String PHOTO_ID = "photo_id"; - - /** - * The contacts provider lookup URI for the contact associated with the call. - * - * <p>TYPE: TEXT - */ - String LOOKUP_URI = "lookup_uri"; - - // TODO(zachh): If we need to support photos other than local contacts', add a (blob?) column. - - /** - * The number type as a string to be displayed to the user, for example "Home" or "Mobile". - * - * <p>This column should be updated for the appropriate language when the locale changes. - * - * <p>TYPE: TEXT - */ - String NUMBER_TYPE_LABEL = "number_type_label"; - - /** * See {@link android.provider.CallLog.Calls#IS_READ}. * * <p>TYPE: INTEGER (boolean) @@ -156,20 +115,13 @@ public class AnnotatedCallLogContract { String FEATURES = "features"; /** - * True if a caller ID data source informed us that this is a business number. This is used to - * determine if a generic business avatar should be shown vs. a generic person avatar. + * Additional attributes about the number. * - * <p>TYPE: INTEGER (boolean) - */ - String IS_BUSINESS = "is_business"; - - /** - * True if this was a call to voicemail. This is used to determine if the voicemail avatar - * should be displayed. + * <p>TYPE: BLOB * - * <p>TYPE: INTEGER (boolean) + * @see com.android.dialer.calllog.model.NumberAttributes */ - String IS_VOICEMAIL = "is_voicemail"; + String NUMBER_ATTRIBUTES = "number_attributes"; /** * Copied from {@link android.provider.CallLog.Calls#TYPE}. @@ -178,31 +130,12 @@ public class AnnotatedCallLogContract { */ String CALL_TYPE = "call_type"; - /** - * True if the number can be reported as invalid. - * - * <p>TYPE: INTEGER (boolean) - */ - String CAN_REPORT_AS_INVALID_NUMBER = "can_report_as_invalid_number"; - - /** - * True if the CP2 information is incomplete and needs to be queried at display time. - * - * <p>TYPE: INTEGER (boolean) - */ - String CP2_INFO_INCOMPLETE = "cp2_info_incomplete"; - String[] ALL_COMMON_COLUMNS = new String[] { _ID, TIMESTAMP, - NAME, NUMBER, FORMATTED_NUMBER, - PHOTO_URI, - PHOTO_ID, - LOOKUP_URI, - NUMBER_TYPE_LABEL, IS_READ, NEW, GEOCODED_LOCATION, @@ -211,11 +144,8 @@ public class AnnotatedCallLogContract { PHONE_ACCOUNT_LABEL, PHONE_ACCOUNT_COLOR, FEATURES, - IS_BUSINESS, - IS_VOICEMAIL, + NUMBER_ATTRIBUTES, CALL_TYPE, - CAN_REPORT_AS_INVALID_NUMBER, - CP2_INFO_INCOMPLETE }; } |