From 86491a974ae881bdf66245d0bc31be1e743ae30e Mon Sep 17 00:00:00 2001 From: linyuh Date: Wed, 14 Feb 2018 09:46:57 -0800 Subject: Fix the icon & the label for blocked spam numbers in the new call log. Bug: 73077158 Test: CallLogEntryTextTest, GlidePhotoManagerImplTest PiperOrigin-RevId: 185700282 Change-Id: I292f23ea8bf9875d6378c8cc9e20ae6ca86e8827 --- .../dialer/calllogutils/CallLogEntryText.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'java/com/android/dialer/calllogutils') diff --git a/java/com/android/dialer/calllogutils/CallLogEntryText.java b/java/com/android/dialer/calllogutils/CallLogEntryText.java index 737b1d30f..ab851cbbd 100644 --- a/java/com/android/dialer/calllogutils/CallLogEntryText.java +++ b/java/com/android/dialer/calllogutils/CallLogEntryText.java @@ -70,7 +70,8 @@ public final class CallLogEntryText { * * *

Examples: @@ -84,6 +85,7 @@ public final class CallLogEntryText { *

  • Blocked • Brooklyn, NJ • 10 min ago *
  • Spam • Mobile • Now *
  • Spam • Now + *
  • Blocked • Spam • Mobile • Now *
  • Brooklyn, NJ • Jan 15 * * @@ -93,11 +95,11 @@ public final class CallLogEntryText { Context context, Clock clock, CoalescedRow row) { List components = new ArrayList<>(); - // If a number is both spam and blocked, only show "Spam". + if (row.numberAttributes().getIsBlocked()) { + components.add(context.getText(R.string.new_call_log_secondary_blocked)); + } if (row.numberAttributes().getIsSpam()) { components.add(context.getText(R.string.new_call_log_secondary_spam)); - } else if (row.numberAttributes().getIsBlocked()) { - components.add(context.getText(R.string.new_call_log_secondary_blocked)); } components.add(getNumberTypeLabel(context, row)); @@ -121,8 +123,10 @@ public final class CallLogEntryText { * (Duo video, )?$Label|$Location [• NumberIfNoName]? * For blocked non-spam numbers: * Blocked • (Duo video, )?$Label|$Location [• NumberIfNoName]? - * For spam numbers: + * For spam but not blocked numbers: * Spam • (Duo video, )?$Label [• NumberIfNoName]? + * For blocked spam numbers: + * Blocked • Spam • (Duo video, )?$Label [• NumberIfNoName]? * * The number is shown at the end if there is no name for the entry. (It is shown in primary * text otherwise.) @@ -139,11 +143,11 @@ public final class CallLogEntryText { */ List components = new ArrayList<>(); - // If a number is both spam and blocked, only show "Spam". + if (row.numberAttributes().getIsBlocked()) { + components.add(context.getText(R.string.new_call_log_secondary_blocked)); + } if (row.numberAttributes().getIsSpam()) { components.add(context.getText(R.string.new_call_log_secondary_spam)); - } else if (row.numberAttributes().getIsBlocked()) { - components.add(context.getText(R.string.new_call_log_secondary_blocked)); } components.add(getNumberTypeLabel(context, row)); -- cgit v1.2.3