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
diff --git a/java/com/android/dialer/calllogutils/CallLogEntryText.java b/java/com/android/dialer/calllogutils/CallLogEntryText.java
index 737b1d3..ab851cb 100644
--- a/java/com/android/dialer/calllogutils/CallLogEntryText.java
+++ b/java/com/android/dialer/calllogutils/CallLogEntryText.java
@@ -70,7 +70,8 @@
* <ul>
* <li>For numbers that are not spam or blocked: (Duo video, )?$Label|$Location • Date
* <li>For blocked non-spam numbers: Blocked • (Duo video, )?$Label|$Location • Date
- * <li>For spam numbers: Spam • (Duo video, )?$Label • Date
+ * <li>For spam but not blocked numbers: Spam • (Duo video, )?$Label • Date
+ * <li>For blocked spam numbers: Blocked • Spam • (Duo video, )?$Label • Date
* </ul>
*
* <p>Examples:
@@ -84,6 +85,7 @@
* <li>Blocked • Brooklyn, NJ • 10 min ago
* <li>Spam • Mobile • Now
* <li>Spam • Now
+ * <li>Blocked • Spam • Mobile • Now
* <li>Brooklyn, NJ • Jan 15
* </ul>
*
@@ -93,11 +95,11 @@
Context context, Clock clock, CoalescedRow row) {
List<CharSequence> 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 @@
* (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 @@
*/
List<CharSequence> 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));
diff --git a/java/com/android/dialer/glidephotomanager/impl/GlidePhotoManagerImpl.java b/java/com/android/dialer/glidephotomanager/impl/GlidePhotoManagerImpl.java
index c6d9205..10c4dfb 100644
--- a/java/com/android/dialer/glidephotomanager/impl/GlidePhotoManagerImpl.java
+++ b/java/com/android/dialer/glidephotomanager/impl/GlidePhotoManagerImpl.java
@@ -68,13 +68,13 @@
// Warning: Glide ignores extra attributes on BitmapDrawable such as tint and draw the bitmap
// directly so be sure not to set tint in the XML of any drawable referenced below.
- // The spam status takes precedence over whether the number is blocked.
- if (photoInfo.isSpam()) {
- return requestManager.load(R.drawable.ic_report_red_48dp);
- }
+ // Whether the number is blocked takes precedence over the spam status.
if (photoInfo.isBlocked()) {
return requestManager.load(R.drawable.ic_block_grey_48dp);
}
+ if (photoInfo.isSpam()) {
+ return requestManager.load(R.drawable.ic_report_red_48dp);
+ }
if (!TextUtils.isEmpty(photoInfo.photoUri())) {
return requestManager.load(parseUri(photoInfo.photoUri()));
}