diff options
author | Qi Wang <wangqi@google.com> | 2016-04-07 13:00:25 -0700 |
---|---|---|
committer | Qi Wang <wangqi@google.com> | 2016-04-08 11:28:41 -0700 |
commit | bbb397c9834493418a73d75e6cbb9173c861aba5 (patch) | |
tree | ef442dcd0afd643c4250ba4c49a8b7fd06a771ee /src/com/android | |
parent | 93761a2d2729625380db4b9a7fe8334ff96b654c (diff) |
Fix UI issues in call logs when spam is not enabled.
* Don't add spam related action menu to call log.
Change-Id: Id32a7e0e0819c780bcb60e917ea6f4a4d19394c9
Diffstat (limited to 'src/com/android')
-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 0c1bf9e2e..c763b7f39 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; @@ -496,6 +492,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); |