From 8c47d75d9a128db66faf1e824f628ed5a1a87723 Mon Sep 17 00:00:00 2001 From: yueg Date: Thu, 9 Nov 2017 11:39:10 -0800 Subject: Conferece call management screen UI adjustment. Including: - change action icon color - hide TextView for name if name is empty - if name is empty, use number to generate avatar - don't show number type Bug: 67053842 Test: manual PiperOrigin-RevId: 175188810 Change-Id: I4ba40e5332d7b8567932360d36c8dc6ec3d604a5 --- java/com/android/dialer/calllogutils/CallTypeIconsView.java | 8 ++++---- java/com/android/dialer/theme/res/values/colors.xml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'java/com/android/dialer') 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/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 @@ #CFD8DC - - #89000000 + + #89000000 #FFDF0000 -- cgit v1.2.3 From 3af5c6b002968a44b964d91cdca26056c3aaf8c3 Mon Sep 17 00:00:00 2001 From: zachh Date: Thu, 9 Nov 2017 11:52:13 -0800 Subject: Filter out contacts with null primary display names in search. Bug: 68848807 Test: unit PiperOrigin-RevId: 175190786 Change-Id: I15b525951cb87afb8b48f3bdb2174605c94c99cf --- .../dialer/searchfragment/cp2/ContactFilterCursor.java | 14 +++++++++----- .../searchfragment/cp2/SearchContactsCursorLoader.java | 11 +++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'java/com/android/dialer') 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 coalesceContacts(List contactsWithSameContactId) { - String companyName = null; - String nickName = null; + StringBuilder companyName = new StringBuilder(); + StringBuilder nickName = new StringBuilder(); List 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 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,8 +43,19 @@ 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. + * + *

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 (\'" -- cgit v1.2.3 From 80c8b526a035c7903cf2d2d8fc5196040078c834 Mon Sep 17 00:00:00 2001 From: zachh Date: Thu, 9 Nov 2017 17:33:21 -0800 Subject: Use type TEXT instead of STRING for annotated call log columns. The declared type of "STRING" has an affinity of NUMERIC, not TEXT per: https://sqlite.org/datatype3.html Bug: 34672501 Test: existing PiperOrigin-RevId: 175237916 Change-Id: I220a35f3060eb60870f6e930c821bdb2f6d2c7ed --- .../database/AnnotatedCallLogDatabaseHelper.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'java/com/android/dialer') 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") + ");"; -- cgit v1.2.3