diff options
author | Qi Wang <wangqi@google.com> | 2016-04-08 18:40:10 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-04-08 18:40:11 +0000 |
commit | 9b65259cbefd157f1949bf34e0b93e6b66cff8e4 (patch) | |
tree | 7d27855e8cdea54d66621579fffd1e4df3f50df5 | |
parent | e450f37245e694e72836e78daf02d841c40d9dd8 (diff) | |
parent | bbb397c9834493418a73d75e6cbb9173c861aba5 (diff) |
Merge "Fix UI issues in call logs when spam is not enabled."
-rw-r--r-- | src/com/android/dialer/calllog/CallLogAdapter.java | 5 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallLogListItemViewHolder.java | 12 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index aa0b7c94d..36726e456 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -21,10 +21,7 @@ import com.android.dialer.service.ExtendedCallInfoService; 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; 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 @@ public class CallLogAdapter extends GroupingListAdapter 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 aaa9dc83b..858cc2102 100644 --- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java +++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java @@ -207,7 +207,12 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder 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 final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } public void updatePhoto() { - if (isSpam) { + if (isSpamFeatureEnabled && isSpam) { quickContactView.setImageDrawable( mContext.getDrawable(R.drawable.blocked_contact)); return; @@ -747,6 +752,9 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } private void updateBlockReportActions() { + if (!isSpamFeatureEnabled) { + return; + } // Set block/spam actions. blockReportView.setVisibility(View.GONE); blockView.setVisibility(View.GONE); |