Merge "Fix UI issues in call logs when spam is not enabled."
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index aa0b7c9..36726e4 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -21,10 +21,7 @@
 import com.android.dialerbind.ObjectFactory;
 import com.google.common.annotations.VisibleForTesting;
 
-import android.app.AlertDialog;
-import android.content.ContentValues;
 import android.content.Context;
-import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.res.Resources;
@@ -45,7 +42,6 @@
 import android.view.View.AccessibilityDelegate;
 import android.view.ViewGroup;
 import android.view.accessibility.AccessibilityEvent;
-import android.widget.CheckBox;
 
 import com.android.contacts.common.ContactsUtils;
 import com.android.contacts.common.compat.CompatUtils;
@@ -494,6 +490,7 @@
                         if (mExtendedCallInfoService == null) {
                             loadDataAndRender(views);
                         } else {
+                            views.isSpamFeatureEnabled = true;
                             mExtendedCallInfoService.getExtendedCallInfo(number, countryIso,
                                     new ExtendedCallInfoService.Listener() {
                                         @Override
diff --git a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
index aaa9dc8..858cc21 100644
--- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
+++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
@@ -207,7 +207,12 @@
     public ContactInfo info;
 
     /**
-     * Whether the current log entry is a spam number or not. Used in updatePhoto()
+     * Whether spam feature is enabled, which affects UI.
+     */
+    public boolean isSpamFeatureEnabled;
+
+    /**
+     * Whether the current log entry is a spam number or not.
      */
     public boolean isSpam;
 
@@ -626,7 +631,7 @@
     }
 
     public void updatePhoto() {
-        if (isSpam) {
+        if (isSpamFeatureEnabled && isSpam) {
             quickContactView.setImageDrawable(
                     mContext.getDrawable(R.drawable.blocked_contact));
             return;
@@ -747,6 +752,9 @@
     }
 
     private void updateBlockReportActions() {
+        if (!isSpamFeatureEnabled) {
+            return;
+        }
         // Set block/spam actions.
         blockReportView.setVisibility(View.GONE);
         blockView.setVisibility(View.GONE);