diff options
Diffstat (limited to 'java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 9b7741df4..5b579f50f 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -69,7 +69,7 @@ import com.android.dialer.clipboard.ClipboardUtils; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.AsyncTaskExecutors; -import com.android.dialer.configprovider.ConfigProviderBindings; +import com.android.dialer.configprovider.ConfigProviderComponent; import com.android.dialer.constants.ActivityRequestCodes; import com.android.dialer.contactphoto.ContactPhotoManager; import com.android.dialer.dialercontact.DialerContact; @@ -309,7 +309,8 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder primaryActionButtonView.setOnClickListener(this); primaryActionView.setOnClickListener(this.expandCollapseListener); if (this.voicemailPlaybackPresenter != null - && ConfigProviderBindings.get(this.context) + && ConfigProviderComponent.get(this.context) + .getConfigProvider() .getBoolean( CallLogAdapter.ENABLE_CALL_LOG_MULTI_SELECT, CallLogAdapter.ENABLE_CALL_LOG_MULTI_SELECT_FLAG)) { @@ -599,6 +600,29 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder setUpVideoButtonView.setVisibility(View.GONE); inviteVideoButtonView.setVisibility(View.GONE); + // For an emergency number, show "Call details" only. + if (PhoneNumberHelper.isLocalEmergencyNumber(context, number)) { + createNewContactButtonView.setVisibility(View.GONE); + addToExistingContactButtonView.setVisibility(View.GONE); + sendMessageView.setVisibility(View.GONE); + callWithNoteButtonView.setVisibility(View.GONE); + callComposeButtonView.setVisibility(View.GONE); + blockReportView.setVisibility(View.GONE); + blockView.setVisibility(View.GONE); + unblockView.setVisibility(View.GONE); + reportNotSpamView.setVisibility(View.GONE); + voicemailPlaybackView.setVisibility(View.GONE); + + detailsButtonView.setVisibility(View.VISIBLE); + detailsButtonView.setTag( + IntentProvider.getCallDetailIntentProvider( + callDetailsEntries, + buildContact(), + /* canReportCallerId = */ false, + /* canSupportAssistedDialing = */ false)); + return; + } + if (isFullyUndialableVoicemail()) { // Sometimes the voicemail server will report the message is from some non phone number // source. If the number does not contains any dialable digit treat it as it is from a unknown @@ -687,7 +711,8 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder videoCallButtonView.setVisibility(View.VISIBLE); CallIntentBuilder.increaseLightbringerCallButtonAppearInExpandedCallLogItemCount(); } else if (duo.isActivated(context) && !identifiedSpamCall) { - if (ConfigProviderBindings.get(context) + if (ConfigProviderComponent.get(context) + .getConfigProvider() .getBoolean("enable_call_log_duo_invite_button", false)) { inviteVideoButtonView.setTag(IntentProvider.getDuoInviteIntentProvider(number)); inviteVideoButtonView.setVisibility(View.VISIBLE); @@ -696,7 +721,8 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } } else if (duo.isEnabled(context) && !identifiedSpamCall) { if (!duo.isInstalled(context)) { - if (ConfigProviderBindings.get(context) + if (ConfigProviderComponent.get(context) + .getConfigProvider() .getBoolean("enable_call_log_install_duo_button", false)) { setUpVideoButtonView.setTag(IntentProvider.getInstallDuoIntentProvider()); setUpVideoButtonView.setVisibility(View.VISIBLE); @@ -705,7 +731,8 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder CallIntentBuilder.increaseLightbringerCallButtonAppearInExpandedCallLogItemCount(); } } else { - if (ConfigProviderBindings.get(context) + if (ConfigProviderComponent.get(context) + .getConfigProvider() .getBoolean("enable_call_log_activate_duo_button", false)) { setUpVideoButtonView.setTag(IntentProvider.getSetUpDuoIntentProvider()); setUpVideoButtonView.setVisibility(View.VISIBLE); |