diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-11-12 04:18:23 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-11-12 04:18:23 +0000 |
commit | efd5f75eaf20473b34dd19fa259c7fd6525ff9b4 (patch) | |
tree | faf34b910c7c5fbd33a310948d55bd00bc275af0 /java/com/android/dialer | |
parent | ddbde1f91e1db86c9b741c4d339d0685f699526e (diff) | |
parent | 80c8b526a035c7903cf2d2d8fc5196040078c834 (diff) |
Merge changes I220a35f3,I2460308e,I15b52595,I4ba40e53
* changes:
Use type TEXT instead of STRING for annotated call log columns.
Stop turning on the screen when the incoming/outgoing call is via Bluetooth.
Filter out contacts with null primary display names in search.
Conferece call management screen UI adjustment.
Diffstat (limited to 'java/com/android/dialer')
5 files changed, 36 insertions, 21 deletions
diff --git a/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java b/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java index 9fd5bd970..3062710d4 100644 --- a/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java +++ b/java/com/android/dialer/calllog/database/AnnotatedCallLogDatabaseHelper.java @@ -38,26 +38,26 @@ class AnnotatedCallLogDatabaseHelper extends SQLiteOpenHelper { + " (" + (AnnotatedCallLog._ID + " integer primary key, ") + (AnnotatedCallLog.TIMESTAMP + " integer, ") - + (AnnotatedCallLog.NAME + " string, ") + + (AnnotatedCallLog.NAME + " text, ") + (AnnotatedCallLog.NUMBER + " blob, ") - + (AnnotatedCallLog.FORMATTED_NUMBER + " string, ") - + (AnnotatedCallLog.PHOTO_URI + " string, ") + + (AnnotatedCallLog.FORMATTED_NUMBER + " text, ") + + (AnnotatedCallLog.PHOTO_URI + " text, ") + (AnnotatedCallLog.PHOTO_ID + " integer, ") - + (AnnotatedCallLog.LOOKUP_URI + " string, ") + + (AnnotatedCallLog.LOOKUP_URI + " text, ") + (AnnotatedCallLog.DURATION + " integer, ") - + (AnnotatedCallLog.NUMBER_TYPE_LABEL + " string, ") + + (AnnotatedCallLog.NUMBER_TYPE_LABEL + " text, ") + (AnnotatedCallLog.IS_READ + " integer, ") + (AnnotatedCallLog.NEW + " integer, ") - + (AnnotatedCallLog.GEOCODED_LOCATION + " string, ") - + (AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME + " string, ") - + (AnnotatedCallLog.PHONE_ACCOUNT_ID + " string, ") - + (AnnotatedCallLog.PHONE_ACCOUNT_LABEL + " string, ") + + (AnnotatedCallLog.GEOCODED_LOCATION + " text, ") + + (AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME + " text, ") + + (AnnotatedCallLog.PHONE_ACCOUNT_ID + " text, ") + + (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 + " string, ") + + (AnnotatedCallLog.VOICEMAIL_URI + " text, ") + (AnnotatedCallLog.CALL_TYPE + " integer") + ");"; diff --git a/java/com/android/dialer/calllogutils/CallTypeIconsView.java b/java/com/android/dialer/calllogutils/CallTypeIconsView.java index bf33faa33..0c28a9728 100644 --- a/java/com/android/dialer/calllogutils/CallTypeIconsView.java +++ b/java/com/android/dialer/calllogutils/CallTypeIconsView.java @@ -268,7 +268,7 @@ public class CallTypeIconsView extends View { iconId = R.drawable.quantum_ic_voicemail_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); voicemail = drawable.mutate(); - voicemail.setColorFilter(r.getColor(R.color.call_type_icon_color), PorterDuff.Mode.MULTIPLY); + voicemail.setColorFilter(r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_block_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); @@ -278,17 +278,17 @@ public class CallTypeIconsView extends View { iconId = R.drawable.quantum_ic_videocam_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); videoCall = drawable.mutate(); - videoCall.setColorFilter(r.getColor(R.color.call_type_icon_color), PorterDuff.Mode.MULTIPLY); + videoCall.setColorFilter(r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_hd_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); hdCall = drawable.mutate(); - hdCall.setColorFilter(r.getColor(R.color.call_type_icon_color), PorterDuff.Mode.MULTIPLY); + hdCall.setColorFilter(r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY); iconId = R.drawable.quantum_ic_signal_wifi_4_bar_white_24; drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId); wifiCall = drawable.mutate(); - wifiCall.setColorFilter(r.getColor(R.color.call_type_icon_color), PorterDuff.Mode.MULTIPLY); + wifiCall.setColorFilter(r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY); iconMargin = largeIcons ? 0 : r.getDimensionPixelSize(R.dimen.call_log_icon_margin); } diff --git a/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java b/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java index df67b762f..166902b2b 100644 --- a/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java +++ b/java/com/android/dialer/searchfragment/cp2/ContactFilterCursor.java @@ -132,8 +132,8 @@ final class ContactFilterCursor implements Cursor { } private static List<Cp2Contact> coalesceContacts(List<Cp2Contact> contactsWithSameContactId) { - String companyName = null; - String nickName = null; + StringBuilder companyName = new StringBuilder(); + StringBuilder nickName = new StringBuilder(); List<Cp2Contact> phoneContacts = new ArrayList<>(); for (Cp2Contact contact : contactsWithSameContactId) { if (contact.mimeType().equals(Phone.CONTENT_ITEM_TYPE)) { @@ -141,11 +141,11 @@ final class ContactFilterCursor implements Cursor { } else if (contact.mimeType().equals(Organization.CONTENT_ITEM_TYPE)) { // Since a contact can have more than one company name but they aren't visible to the user // in our search UI, we can lazily concatenate them together to make them all searchable. - companyName += " " + contact.companyName(); + companyName.append(" ").append(contact.companyName()); } else if (contact.mimeType().equals(Nickname.CONTENT_ITEM_TYPE)) { // Since a contact can have more than one nickname but they aren't visible to the user // in our search UI, we can lazily concatenate them together to make them all searchable. - nickName += " " + contact.nickName(); + nickName.append(" ").append(contact.nickName()); } } @@ -154,7 +154,11 @@ final class ContactFilterCursor implements Cursor { List<Cp2Contact> coalescedContacts = new ArrayList<>(); for (Cp2Contact phoneContact : phoneContacts) { coalescedContacts.add( - phoneContact.toBuilder().setCompanyName(companyName).setNickName(nickName).build()); + phoneContact + .toBuilder() + .setCompanyName(companyName.length() == 0 ? null : companyName.toString()) + .setNickName(nickName.length() == 0 ? null : nickName.toString()) + .build()); } return coalescedContacts; } diff --git a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java index 35518019e..2b7af1131 100644 --- a/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java +++ b/java/com/android/dialer/searchfragment/cp2/SearchContactsCursorLoader.java @@ -43,9 +43,20 @@ public final class SearchContactsCursorLoader extends CursorLoader { this.query = query; } + /** + * Note: ContactsProvider can make no guarantee that any given field is non-null, and display name + * has been observed to be null in the wild, though it is unclear when that might happen (possibly + * a third-party is inserting such data). See a bug. + * + * <p>We skip showing contacts without a display name because there is no UI treatment for showing + * such results. (Note that even contacts with only a number still have a display name set to the + * number.) + */ private static String whereStatement() { return (Phone.NUMBER + " IS NOT NULL") + " AND " + + (Data.DISPLAY_NAME_PRIMARY + " IS NOT NULL") + + " AND " + Data.MIMETYPE + " IN (\'" + Phone.CONTENT_ITEM_TYPE diff --git a/java/com/android/dialer/theme/res/values/colors.xml b/java/com/android/dialer/theme/res/values/colors.xml index f44a7ccc6..a59fa6704 100644 --- a/java/com/android/dialer/theme/res/values/colors.xml +++ b/java/com/android/dialer/theme/res/values/colors.xml @@ -68,8 +68,8 @@ <color name="blue_grey_100">#CFD8DC</color> - <!-- Color of call type icons in call log, e.g. voicemail, video, WiFi, HD etc. --> - <color name="call_type_icon_color">#89000000</color> + <!-- 54% opacity --> + <color name="icon_color_grey">#89000000</color> <!-- Color for bubble --> <color name="dialer_end_call_button_color">#FFDF0000</color> |