diff options
author | twyen <twyen@google.com> | 2018-01-24 16:48:49 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-24 19:09:39 -0800 |
commit | 0874af841f7e23357ceb2bb8825180b111d613b4 (patch) | |
tree | 23982c4a353490aa0a605b0e04b8656def2a3775 /java/com/android/dialer/phonelookup | |
parent | 2a422f719b70f6c292b954fb24f324b7f4ac1858 (diff) |
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
Diffstat (limited to 'java/com/android/dialer/phonelookup')
3 files changed, 5 insertions, 48 deletions
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 @@ -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> -<manifest - package="com.android.dialer.phonelookup.consolidator"> -</manifest> 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<Integer> 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 @@ -<!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> - -<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - - <!-- Label under the name of a blocked number in the call log. [CHAR LIMIT=15] --> - <string name="blocked_number_new_call_log_label">Blocked</string> - -</resources> |