From 0874af841f7e23357ceb2bb8825180b111d613b4 Mon Sep 17 00:00:00 2001 From: twyen Date: Wed, 24 Jan 2018 16:48:49 -0800 Subject: Show Icon and label for blocked numbers CallLogPhoto.getPhotoUri() returns a URI to a drawable so it will be easier to transition into glide. Meanwhile ContactPhotoManager will just show the drawable directly. Bug: 70989547 Test: Unit tests PiperOrigin-RevId: 183163818 Change-Id: I4ee4ff98782e35d2be03dfe14f8bf3dfd6ded074 --- .../phonelookup/consolidator/AndroidManifest.xml | 18 ------------------ .../consolidator/PhoneLookupInfoConsolidator.java | 13 +++++-------- .../consolidator/res/values/strings.xml | 22 ---------------------- 3 files changed, 5 insertions(+), 48 deletions(-) delete mode 100644 java/com/android/dialer/phonelookup/consolidator/AndroidManifest.xml delete mode 100644 java/com/android/dialer/phonelookup/consolidator/res/values/strings.xml (limited to 'java/com/android/dialer/phonelookup') diff --git a/java/com/android/dialer/phonelookup/consolidator/AndroidManifest.xml b/java/com/android/dialer/phonelookup/consolidator/AndroidManifest.xml deleted file mode 100644 index 98e07e574..000000000 --- a/java/com/android/dialer/phonelookup/consolidator/AndroidManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/java/com/android/dialer/phonelookup/consolidator/PhoneLookupInfoConsolidator.java b/java/com/android/dialer/phonelookup/consolidator/PhoneLookupInfoConsolidator.java index 27f0d21ae..0373cfe4e 100644 --- a/java/com/android/dialer/phonelookup/consolidator/PhoneLookupInfoConsolidator.java +++ b/java/com/android/dialer/phonelookup/consolidator/PhoneLookupInfoConsolidator.java @@ -15,7 +15,6 @@ */ package com.android.dialer.phonelookup.consolidator; -import android.content.Context; import android.support.annotation.IntDef; import android.support.annotation.Nullable; import com.android.dialer.common.Assert; @@ -68,15 +67,13 @@ public final class PhoneLookupInfoConsolidator { private static final ImmutableList NAME_SOURCES_IN_PRIORITY_ORDER = ImmutableList.of(NameSource.CP2_LOCAL, NameSource.CP2_REMOTE, NameSource.PEOPLE_API); - private final Context appContext; private final @NameSource int nameSource; private final PhoneLookupInfo phoneLookupInfo; @Nullable private final Cp2ContactInfo firstCp2LocalContact; @Nullable private final Cp2ContactInfo firstCp2RemoteContact; - public PhoneLookupInfoConsolidator(Context appContext, PhoneLookupInfo phoneLookupInfo) { - this.appContext = appContext; + public PhoneLookupInfoConsolidator(PhoneLookupInfo phoneLookupInfo) { this.phoneLookupInfo = phoneLookupInfo; this.firstCp2LocalContact = getFirstLocalContact(); @@ -179,10 +176,6 @@ public final class PhoneLookupInfoConsolidator { * returned. */ public String getNumberLabel() { - if (isBlocked()) { - return appContext.getString(R.string.blocked_number_new_call_log_label); - } - switch (nameSource) { case NameSource.CP2_LOCAL: return Assert.isNotNull(firstCp2LocalContact).getLabel(); @@ -215,6 +208,10 @@ public final class PhoneLookupInfoConsolidator { return false; } + /** + * The {@link PhoneLookupInfo} passed to the constructor is associated with a number. This method + * returns whether the number is blocked. + */ public boolean isBlocked() { // If system blocking reported blocked state it always takes priority over the dialer blocking. // It will be absent if dialer blocking should be used. diff --git a/java/com/android/dialer/phonelookup/consolidator/res/values/strings.xml b/java/com/android/dialer/phonelookup/consolidator/res/values/strings.xml deleted file mode 100644 index 2080b3975..000000000 --- a/java/com/android/dialer/phonelookup/consolidator/res/values/strings.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Blocked - - -- cgit v1.2.3