diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-05 15:23:13 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-05 15:23:13 +0000 |
commit | 300a8683b9c28424fb0f0c571a0abe128c461f69 (patch) | |
tree | 3a325b0effac02fbd228b8ddf2f96589e5df72cd /java/com/android/dialer/app/calllog/CallLogAdapter.java | |
parent | d67f1627521b174f12e0c247f154c7c93c5e408e (diff) | |
parent | 10b34a5ebf12e97ecba0caf3c8e30b476b038a96 (diff) |
Update Dialer to V10 RC16
am: 10b34a5ebf
Change-Id: Iea3e96ccdeaf1fa796ceca702cace82ca20f298c
Diffstat (limited to 'java/com/android/dialer/app/calllog/CallLogAdapter.java')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogAdapter.java | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogAdapter.java b/java/com/android/dialer/app/calllog/CallLogAdapter.java index d4872d5b3..b433e6529 100644 --- a/java/com/android/dialer/app/calllog/CallLogAdapter.java +++ b/java/com/android/dialer/app/calllog/CallLogAdapter.java @@ -77,6 +77,7 @@ import com.android.dialer.enrichedcall.historyquery.proto.HistoryResult; import com.android.dialer.lightbringer.Lightbringer; import com.android.dialer.lightbringer.LightbringerComponent; import com.android.dialer.lightbringer.LightbringerListener; +import com.android.dialer.logging.ContactSource; import com.android.dialer.logging.DialerImpression; import com.android.dialer.logging.Logger; import com.android.dialer.phonenumbercache.CallLogQuery; @@ -177,13 +178,14 @@ public class CallLogAdapter extends GroupingListAdapter } }; + // Todo (uabdullah): Use plurals http://b/37751831 private void showDeleteSelectedItemsDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); Assert.checkArgument(selectedItems.size() > 0); String voicemailString = selectedItems.size() == 1 ? mActivity.getResources().getString(R.string.voicemailMultiSelectVoicemail) - : mActivity.getResources().getString(R.string.voicemailMultiSelectVoicemail); + : mActivity.getResources().getString(R.string.voicemailMultiSelectVoicemails); String deleteVoicemailTitle = mActivity .getResources() @@ -228,14 +230,15 @@ public class CallLogAdapter extends GroupingListAdapter if (ConfigProviderBindings.get(v.getContext()) .getBoolean("enable_call_log_multiselect", true) && mVoicemailPlaybackPresenter != null) { - if (v.getId() == R.id.primary_action_view) { + if (v.getId() == R.id.primary_action_view || v.getId() == R.id.quick_contact_photo) { if (mActionMode == null) { mActionMode = v.startActionMode(mActionModeCallback); } CallLogListItemViewHolder viewHolder = (CallLogListItemViewHolder) v.getTag(); viewHolder.quickContactView.setVisibility(View.GONE); viewHolder.checkBoxView.setVisibility(View.VISIBLE); - return false; + mExpandCollapseListener.onClick(v); + return true; } } return true; @@ -522,6 +525,7 @@ public class CallLogAdapter extends GroupingListAdapter viewHolder.callLogEntryView.setTag(viewHolder); viewHolder.primaryActionView.setTag(viewHolder); + viewHolder.quickContactView.setTag(viewHolder); return viewHolder; } @@ -630,7 +634,7 @@ public class CallLogAdapter extends GroupingListAdapter @Override protected Boolean doInBackground(Void... params) { views.blockId = - mFilteredNumberAsyncQueryHandler.getBlockedIdSynchronousForCalllogOnly( + mFilteredNumberAsyncQueryHandler.getBlockedIdSynchronous( views.number, views.countryIso); details.isBlocked = views.blockId != null; if (isCancelled()) { @@ -872,14 +876,25 @@ public class CallLogAdapter extends GroupingListAdapter } views.info = info; - views.numberType = - (String) - Phone.getTypeLabel(mActivity.getResources(), details.numberType, details.numberLabel); + views.numberType = getNumberType(mActivity.getResources(), details); mCallLogListItemHelper.updatePhoneCallDetails(details); return true; } + private static String getNumberType(Resources res, PhoneCallDetails details) { + // Label doesn't make much sense if the information is coming from CNAP or Cequint Caller ID. + if (details.sourceType == ContactSource.Type.SOURCE_TYPE_CNAP + || details.sourceType == ContactSource.Type.SOURCE_TYPE_CEQUINT_CALLER_ID) { + return ""; + } + // Returns empty label instead of "custom" if the custom label is empty. + if (details.numberType == Phone.TYPE_CUSTOM && TextUtils.isEmpty(details.numberLabel)) { + return ""; + } + return (String) Phone.getTypeLabel(res, details.numberType, details.numberLabel); + } + /** * Render item view given position. This is running on UI thread so DO NOT put any expensive * operation into it. |