diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-12-28 02:35:07 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-12-28 02:35:07 +0000 |
commit | 281998c825ad48d842bb653e2f462719fdb0c1d9 (patch) | |
tree | bc8bfcce809257b3ddbb423a9808082292b9f6a3 /java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | |
parent | fc81a030a7b4f6d4a497f71aed593d398795e7da (diff) | |
parent | 183cb71663320f16149d83eeebaff7795a4b55f2 (diff) |
Merge "Remove field prefixes."
Diffstat (limited to 'java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java')
-rw-r--r-- | java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java | 257 |
1 files changed, 127 insertions, 130 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java index 15c4b5850..f8d3a4cd8 100644 --- a/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java +++ b/java/com/android/dialer/app/calllog/CallLogListItemViewHolder.java @@ -132,13 +132,13 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder /** The actionable view which places a call to the number corresponding to the call log row. */ public final ImageView primaryActionButtonView; - private final Context mContext; - @Nullable private final PhoneAccountHandle mDefaultPhoneAccountHandle; - private final CallLogCache mCallLogCache; - private final CallLogListItemHelper mCallLogListItemHelper; - private final CachedNumberLookupService mCachedNumberLookupService; - private final VoicemailPlaybackPresenter mVoicemailPlaybackPresenter; - private final OnClickListener mBlockReportListener; + private final Context context; + @Nullable private final PhoneAccountHandle defaultPhoneAccountHandle; + private final CallLogCache callLogCache; + private final CallLogListItemHelper callLogListItemHelper; + private final CachedNumberLookupService cachedNumberLookupService; + private final VoicemailPlaybackPresenter voicemailPlaybackPresenter; + private final OnClickListener blockReportListener; @HostUi private final int hostUi; /** Whether the data fields are populated by the worker thread, ready to be shown. */ public boolean isLoaded; @@ -233,10 +233,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder public boolean isCallComposerCapable; - private View.OnClickListener mExpandCollapseListener; + private View.OnClickListener expandCollapseListener; private final OnActionModeStateChangedListener onActionModeStateChangedListener; private final View.OnLongClickListener longPressListener; - private boolean mVoicemailPrimaryActionButtonClicked; + private boolean voicemailPrimaryActionButtonClicked; public int callbackAction; public int dayGroupHeaderVisibility; @@ -264,18 +264,18 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder ImageView primaryActionButtonView) { super(rootView); - mContext = context; - mExpandCollapseListener = expandCollapseListener; + this.context = context; + this.expandCollapseListener = expandCollapseListener; onActionModeStateChangedListener = actionModeStateChangedListener; longPressListener = longClickListener; - mCallLogCache = callLogCache; - mCallLogListItemHelper = callLogListItemHelper; - mVoicemailPlaybackPresenter = voicemailPlaybackPresenter; - mBlockReportListener = blockReportListener; - mCachedNumberLookupService = PhoneNumberCache.get(mContext).getCachedNumberLookupService(); + this.callLogCache = callLogCache; + this.callLogListItemHelper = callLogListItemHelper; + this.voicemailPlaybackPresenter = voicemailPlaybackPresenter; + this.blockReportListener = blockReportListener; + cachedNumberLookupService = PhoneNumberCache.get(this.context).getCachedNumberLookupService(); // Cache this to avoid having to look it up each time we bind to a call log entry - mDefaultPhoneAccountHandle = + defaultPhoneAccountHandle = TelecomUtil.getDefaultOutgoingPhoneAccount(context, PhoneAccount.SCHEME_TEL); this.rootView = rootView; @@ -292,19 +292,19 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder phoneCallDetailsViews.nameView.setElegantTextHeight(false); phoneCallDetailsViews.callLocationAndDate.setElegantTextHeight(false); - if (mContext instanceof CallLogActivity) { + if (this.context instanceof CallLogActivity) { hostUi = HostUi.CALL_HISTORY; - Logger.get(mContext) + Logger.get(this.context) .logQuickContactOnTouch( quickContactView, InteractionEvent.Type.OPEN_QUICK_CONTACT_FROM_CALL_HISTORY, true); - } else if (mVoicemailPlaybackPresenter == null) { + } else if (this.voicemailPlaybackPresenter == null) { hostUi = HostUi.CALL_LOG; - Logger.get(mContext) + Logger.get(this.context) .logQuickContactOnTouch( quickContactView, InteractionEvent.Type.OPEN_QUICK_CONTACT_FROM_CALL_LOG, true); } else { hostUi = HostUi.VOICEMAIL; - Logger.get(mContext) + Logger.get(this.context) .logQuickContactOnTouch( quickContactView, InteractionEvent.Type.OPEN_QUICK_CONTACT_FROM_VOICEMAIL, false); } @@ -314,16 +314,16 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder quickContactView.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE); } primaryActionButtonView.setOnClickListener(this); - primaryActionView.setOnClickListener(mExpandCollapseListener); - if (mVoicemailPlaybackPresenter != null - && ConfigProviderBindings.get(mContext) + primaryActionView.setOnClickListener(this.expandCollapseListener); + if (this.voicemailPlaybackPresenter != null + && ConfigProviderBindings.get(this.context) .getBoolean( CallLogAdapter.ENABLE_CALL_LOG_MULTI_SELECT, CallLogAdapter.ENABLE_CALL_LOG_MULTI_SELECT_FLAG)) { primaryActionView.setOnLongClickListener(longPressListener); quickContactView.setOnLongClickListener(longPressListener); quickContactView.setMulitSelectListeners( - mExpandCollapseListener, onActionModeStateChangedListener); + this.expandCollapseListener, onActionModeStateChangedListener); } else { primaryActionView.setOnCreateContextMenuListener(this); } @@ -400,51 +400,50 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder public boolean onMenuItemClick(MenuItem item) { int resId = item.getItemId(); if (resId == R.id.context_menu_copy_to_clipboard) { - ClipboardUtils.copyText(mContext, null, number, true); + ClipboardUtils.copyText(context, null, number, true); return true; } else if (resId == R.id.context_menu_copy_transcript_to_clipboard) { ClipboardUtils.copyText( - mContext, null, phoneCallDetailsViews.voicemailTranscriptionView.getText(), true); + context, null, phoneCallDetailsViews.voicemailTranscriptionView.getText(), true); return true; } else if (resId == R.id.context_menu_edit_before_call) { final Intent intent = new Intent(Intent.ACTION_DIAL, CallUtil.getCallUri(number)); - intent.setClass(mContext, DialtactsActivity.class); - DialerUtils.startActivityWithErrorToast(mContext, intent); + intent.setClass(context, DialtactsActivity.class); + DialerUtils.startActivityWithErrorToast(context, intent); return true; } else if (resId == R.id.context_menu_block_report_spam) { - Logger.get(mContext) + Logger.get(context) .logImpression(DialerImpression.Type.CALL_LOG_CONTEXT_MENU_BLOCK_REPORT_SPAM); maybeShowBlockNumberMigrationDialog( new BlockedNumbersMigrator.Listener() { @Override public void onComplete() { - mBlockReportListener.onBlockReportSpam( + blockReportListener.onBlockReportSpam( displayNumber, number, countryIso, callType, info.sourceType); } }); } else if (resId == R.id.context_menu_block) { - Logger.get(mContext).logImpression(DialerImpression.Type.CALL_LOG_CONTEXT_MENU_BLOCK_NUMBER); + Logger.get(context).logImpression(DialerImpression.Type.CALL_LOG_CONTEXT_MENU_BLOCK_NUMBER); maybeShowBlockNumberMigrationDialog( new BlockedNumbersMigrator.Listener() { @Override public void onComplete() { - mBlockReportListener.onBlock( + blockReportListener.onBlock( displayNumber, number, countryIso, callType, info.sourceType); } }); } else if (resId == R.id.context_menu_unblock) { - Logger.get(mContext) - .logImpression(DialerImpression.Type.CALL_LOG_CONTEXT_MENU_UNBLOCK_NUMBER); - mBlockReportListener.onUnblock( + Logger.get(context).logImpression(DialerImpression.Type.CALL_LOG_CONTEXT_MENU_UNBLOCK_NUMBER); + blockReportListener.onUnblock( displayNumber, number, countryIso, callType, info.sourceType, isSpam, blockId); } else if (resId == R.id.context_menu_report_not_spam) { - Logger.get(mContext) + Logger.get(context) .logImpression(DialerImpression.Type.CALL_LOG_CONTEXT_MENU_REPORT_AS_NOT_SPAM); - mBlockReportListener.onReportNotSpam( + blockReportListener.onReportNotSpam( displayNumber, number, countryIso, callType, info.sourceType); } else if (resId == R.id.context_menu_delete) { AsyncTaskExecutors.createAsyncTaskExecutor() - .submit(TASK_DELETE, new DeleteCallTask(mContext, callIds)); + .submit(TASK_DELETE, new DeleteCallTask(context, callIds)); } return false; } @@ -526,7 +525,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder primaryActionButtonView.setImageResource(R.drawable.quantum_ic_play_arrow_white_24); primaryActionButtonView.setContentDescription( TextUtils.expandTemplate( - mContext.getString(R.string.description_voicemail_action), validNameOrNumber)); + context.getString(R.string.description_voicemail_action), validNameOrNumber)); primaryActionButtonView.setVisibility(View.VISIBLE); } else { primaryActionButtonView.setVisibility(View.GONE); @@ -547,7 +546,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder IntentProvider.getReturnVideoCallIntentProvider(number, accountHandle)); primaryActionButtonView.setContentDescription( TextUtils.expandTemplate( - mContext.getString(R.string.description_video_call_action), validNameOrNumber)); + context.getString(R.string.description_video_call_action), validNameOrNumber)); primaryActionButtonView.setImageResource(R.drawable.quantum_ic_videocam_vd_theme_24); primaryActionButtonView.setVisibility(View.VISIBLE); break; @@ -560,20 +559,20 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } primaryActionButtonView.setContentDescription( TextUtils.expandTemplate( - mContext.getString(R.string.description_video_call_action), validNameOrNumber)); + context.getString(R.string.description_video_call_action), validNameOrNumber)); primaryActionButtonView.setImageResource(R.drawable.quantum_ic_videocam_vd_theme_24); primaryActionButtonView.setVisibility(View.VISIBLE); break; case CallbackAction.VOICE: - if (mCallLogCache.isVoicemailNumber(accountHandle, number)) { + if (callLogCache.isVoicemailNumber(accountHandle, number)) { // Call to generic voicemail number, in case there are multiple accounts primaryActionButtonView.setTag(IntentProvider.getReturnVoicemailCallIntentProvider(null)); } else if (canSupportAssistedDialing()) { primaryActionButtonView.setTag( IntentProvider.getAssistedDialIntentProvider( number + postDialDigits, - mContext, - mContext.getSystemService(TelephonyManager.class))); + context, + context.getSystemService(TelephonyManager.class))); } else { primaryActionButtonView.setTag( IntentProvider.getReturnCallIntentProvider(number + postDialDigits)); @@ -581,7 +580,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder primaryActionButtonView.setContentDescription( TextUtils.expandTemplate( - mContext.getString(R.string.description_call_action), validNameOrNumber)); + context.getString(R.string.description_call_action), validNameOrNumber)); primaryActionButtonView.setImageResource(R.drawable.quantum_ic_call_vd_theme_24); primaryActionButtonView.setVisibility(View.VISIBLE); break; @@ -622,14 +621,14 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder voicemailPlaybackView.setVisibility(View.VISIBLE); Uri uri = Uri.parse(voicemailUri); - mVoicemailPlaybackPresenter.setPlaybackView( + voicemailPlaybackPresenter.setPlaybackView( voicemailPlaybackView, rowId, uri, - mVoicemailPrimaryActionButtonClicked, + voicemailPrimaryActionButtonClicked, sendVoicemailButtonView); - mVoicemailPrimaryActionButtonClicked = false; - CallLogAsyncTaskUtil.markVoicemailAsRead(mContext, uri); + voicemailPrimaryActionButtonClicked = false; + CallLogAsyncTaskUtil.markVoicemailAsRead(context, uri); return; } @@ -640,7 +639,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder if (canSupportAssistedDialing()) { callButtonView.setTag( IntentProvider.getAssistedDialIntentProvider( - number, mContext, mContext.getSystemService(TelephonyManager.class))); + number, context, context.getSystemService(TelephonyManager.class))); } else { callButtonView.setTag(IntentProvider.getReturnCallIntentProvider(number)); } @@ -651,7 +650,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder ((TextView) callButtonView.findViewById(R.id.call_action_text)) .setText( TextUtils.expandTemplate( - mContext.getString(R.string.call_log_action_call), + context.getString(R.string.call_log_action_call), nameOrNumber == null ? "" : nameOrNumber)); if (callType == Calls.VOICEMAIL_TYPE && !TextUtils.isEmpty(callTypeOrLocation)) { @@ -661,7 +660,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder callButtonView.setVisibility(View.VISIBLE); } - boolean isVoicemailNumber = mCallLogCache.isVoicemailNumber(accountHandle, number); + boolean isVoicemailNumber = callLogCache.isVoicemailNumber(accountHandle, number); switch (callbackAction) { case CallbackAction.IMS_VIDEO: @@ -672,10 +671,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder videoCallButtonView.setVisibility(View.GONE); break; case CallbackAction.VOICE: - Duo duo = DuoComponent.get(mContext).getDuo(); + Duo duo = DuoComponent.get(context).getDuo(); // For a voice call, set the secondary callback action to be an IMS video call if it is // available. Otherwise try to set it as a Duo call. - if (CallUtil.isVideoEnabled(mContext) + if (CallUtil.isVideoEnabled(context) && (hasPlacedCarrierVideoCall() || canSupportCarrierVideoCall())) { videoCallButtonView.setTag(IntentProvider.getReturnVideoCallIntentProvider(number)); videoCallButtonView.setVisibility(View.VISIBLE); @@ -687,24 +686,24 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } boolean identifiedSpamCall = isSpamFeatureEnabled && isSpam; - if (duo.isReachable(mContext, number)) { + if (duo.isReachable(context, number)) { videoCallButtonView.setTag(IntentProvider.getDuoVideoIntentProvider(number)); videoCallButtonView.setVisibility(View.VISIBLE); - } else if (duo.isActivated(mContext) && !identifiedSpamCall) { - if (ConfigProviderBindings.get(mContext) + } else if (duo.isActivated(context) && !identifiedSpamCall) { + if (ConfigProviderBindings.get(context) .getBoolean("enable_call_log_duo_invite_button", false)) { inviteVideoButtonView.setTag(IntentProvider.getDuoInviteIntentProvider(number)); inviteVideoButtonView.setVisibility(View.VISIBLE); } - } else if (duo.isEnabled(mContext) && !identifiedSpamCall) { - if (!duo.isInstalled(mContext)) { - if (ConfigProviderBindings.get(mContext) + } else if (duo.isEnabled(context) && !identifiedSpamCall) { + if (!duo.isInstalled(context)) { + if (ConfigProviderBindings.get(context) .getBoolean("enable_call_log_install_duo_button", false)) { setUpVideoButtonView.setTag(IntentProvider.getInstallDuoIntentProvider()); setUpVideoButtonView.setVisibility(View.VISIBLE); } } else { - if (ConfigProviderBindings.get(mContext) + if (ConfigProviderBindings.get(context) .getBoolean("enable_call_log_activate_duo_button", false)) { setUpVideoButtonView.setTag(IntentProvider.getSetUpDuoIntentProvider()); setUpVideoButtonView.setVisibility(View.VISIBLE); @@ -719,19 +718,19 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder // For voicemail calls, show the voicemail playback layout; hide otherwise. if (callType == Calls.VOICEMAIL_TYPE - && mVoicemailPlaybackPresenter != null + && voicemailPlaybackPresenter != null && !TextUtils.isEmpty(voicemailUri)) { voicemailPlaybackView.setVisibility(View.VISIBLE); Uri uri = Uri.parse(voicemailUri); - mVoicemailPlaybackPresenter.setPlaybackView( + voicemailPlaybackPresenter.setPlaybackView( voicemailPlaybackView, rowId, uri, - mVoicemailPrimaryActionButtonClicked, + voicemailPrimaryActionButtonClicked, sendVoicemailButtonView); - mVoicemailPrimaryActionButtonClicked = false; - CallLogAsyncTaskUtil.markVoicemailAsRead(mContext, uri); + voicemailPrimaryActionButtonClicked = false; + CallLogAsyncTaskUtil.markVoicemailAsRead(context, uri); } else { voicemailPlaybackView.setVisibility(View.GONE); sendVoicemailButtonView.setVisibility(View.GONE); @@ -742,8 +741,8 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } else { detailsButtonView.setVisibility(View.VISIBLE); boolean canReportCallerId = - mCachedNumberLookupService != null - && mCachedNumberLookupService.canReportAsInvalid(info.sourceType, info.objectId); + cachedNumberLookupService != null + && cachedNumberLookupService.canReportAsInvalid(info.sourceType, info.objectId); detailsButtonView.setTag( IntentProvider.getCallDetailIntentProvider( callDetailsEntries, buildContact(), canReportCallerId, canSupportAssistedDialing())); @@ -773,9 +772,9 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder sendMessageView.setVisibility(View.GONE); } - mCallLogListItemHelper.setActionContentDescriptions(this); + callLogListItemHelper.setActionContentDescriptions(this); - boolean supportsCallSubject = mCallLogCache.doesAccountSupportCallSubject(accountHandle); + boolean supportsCallSubject = callLogCache.doesAccountSupportCallSubject(accountHandle); callWithNoteButtonView.setVisibility( supportsCallSubject && !isVoicemailNumber && info != null ? View.VISIBLE : View.GONE); @@ -796,7 +795,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder private boolean showDuoPrimaryButton() { return accountHandle != null && accountHandle.getComponentName().equals(DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME) - && DuoComponent.get(mContext).getDuo().isReachable(mContext, number); + && DuoComponent.get(context).getDuo().isReachable(context, number); } private static boolean hasDialableChar(CharSequence number) { @@ -818,10 +817,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder if (accountHandle == null) { return false; } - if (mDefaultPhoneAccountHandle == null) { + if (defaultPhoneAccountHandle == null) { return false; } - return accountHandle.getComponentName().equals(mDefaultPhoneAccountHandle.getComponentName()); + return accountHandle.getComponentName().equals(defaultPhoneAccountHandle.getComponentName()); } private boolean canSupportAssistedDialing() { @@ -829,7 +828,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } private boolean canSupportCarrierVideoCall() { - return mCallLogCache.canRelyOnVideoPresence() + return callLogCache.canRelyOnVideoPresence() && info != null && (info.carrierPresence & Phone.CARRIER_PRESENCE_VT_CAPABLE) != 0; } @@ -907,12 +906,12 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder quickContactView.assignContactUri(info.lookupUri); if (isSpamFeatureEnabled && isSpam) { - quickContactView.setImageDrawable(mContext.getDrawable(R.drawable.blocked_contact)); + quickContactView.setImageDrawable(context.getDrawable(R.drawable.blocked_contact)); return; } final String displayName = TextUtils.isEmpty(info.name) ? displayNumber : info.name; - ContactPhotoManager.getInstance(mContext) + ContactPhotoManager.getInstance(context) .loadDialerThumbnailOrPhoto( quickContactView, info.lookupUri, @@ -924,10 +923,9 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder private @ContactType int getContactType() { return LetterTileDrawable.getContactTypeFromPrimitives( - mCallLogCache.isVoicemailNumber(accountHandle, number), + callLogCache.isVoicemailNumber(accountHandle, number), isSpam, - mCachedNumberLookupService != null - && mCachedNumberLookupService.isBusiness(info.sourceType), + cachedNumberLookupService != null && cachedNumberLookupService.isBusiness(info.sourceType), numberPresentation, false); } @@ -935,19 +933,19 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder @Override public void onClick(View view) { if (view.getId() == R.id.primary_action_button) { - CallLogAsyncTaskUtil.markCallAsRead(mContext, callIds); + CallLogAsyncTaskUtil.markCallAsRead(context, callIds); } if (view.getId() == R.id.primary_action_button && !TextUtils.isEmpty(voicemailUri)) { - Logger.get(mContext).logImpression(DialerImpression.Type.VOICEMAIL_PLAY_AUDIO_DIRECTLY); - mVoicemailPrimaryActionButtonClicked = true; - mExpandCollapseListener.onClick(primaryActionView); + Logger.get(context).logImpression(DialerImpression.Type.VOICEMAIL_PLAY_AUDIO_DIRECTLY); + voicemailPrimaryActionButtonClicked = true; + expandCollapseListener.onClick(primaryActionView); return; } if (view.getId() == R.id.call_with_note_action) { CallSubjectDialog.start( - (Activity) mContext, + (Activity) context, info.photoId, info.photoUri, info.lookupUri, @@ -962,12 +960,12 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } if (view.getId() == R.id.block_report_action) { - Logger.get(mContext).logImpression(DialerImpression.Type.CALL_LOG_BLOCK_REPORT_SPAM); + Logger.get(context).logImpression(DialerImpression.Type.CALL_LOG_BLOCK_REPORT_SPAM); maybeShowBlockNumberMigrationDialog( new BlockedNumbersMigrator.Listener() { @Override public void onComplete() { - mBlockReportListener.onBlockReportSpam( + blockReportListener.onBlockReportSpam( displayNumber, number, countryIso, callType, info.sourceType); } }); @@ -975,12 +973,12 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } if (view.getId() == R.id.block_action) { - Logger.get(mContext).logImpression(DialerImpression.Type.CALL_LOG_BLOCK_NUMBER); + Logger.get(context).logImpression(DialerImpression.Type.CALL_LOG_BLOCK_NUMBER); maybeShowBlockNumberMigrationDialog( new BlockedNumbersMigrator.Listener() { @Override public void onComplete() { - mBlockReportListener.onBlock( + blockReportListener.onBlock( displayNumber, number, countryIso, callType, info.sourceType); } }); @@ -988,23 +986,23 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } if (view.getId() == R.id.unblock_action) { - Logger.get(mContext).logImpression(DialerImpression.Type.CALL_LOG_UNBLOCK_NUMBER); - mBlockReportListener.onUnblock( + Logger.get(context).logImpression(DialerImpression.Type.CALL_LOG_UNBLOCK_NUMBER); + blockReportListener.onUnblock( displayNumber, number, countryIso, callType, info.sourceType, isSpam, blockId); return; } if (view.getId() == R.id.report_not_spam_action) { - Logger.get(mContext).logImpression(DialerImpression.Type.CALL_LOG_REPORT_AS_NOT_SPAM); - mBlockReportListener.onReportNotSpam( + Logger.get(context).logImpression(DialerImpression.Type.CALL_LOG_REPORT_AS_NOT_SPAM); + blockReportListener.onReportNotSpam( displayNumber, number, countryIso, callType, info.sourceType); return; } if (view.getId() == R.id.call_compose_action) { LogUtil.i("CallLogListItemViewHolder.onClick", "share and call pressed"); - Logger.get(mContext).logImpression(DialerImpression.Type.CALL_LOG_SHARE_AND_CALL); - Activity activity = (Activity) mContext; + Logger.get(context).logImpression(DialerImpression.Type.CALL_LOG_SHARE_AND_CALL); + Activity activity = (Activity) context; activity.startActivityForResult( CallComposerActivity.newIntent(activity, buildContact()), ActivityRequestCodes.DIALTACTS_CALL_COMPOSER); @@ -1012,8 +1010,8 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } if (view.getId() == R.id.share_voicemail) { - Logger.get(mContext).logImpression(DialerImpression.Type.VVM_SHARE_PRESSED); - mVoicemailPlaybackPresenter.shareVoicemail(); + Logger.get(context).logImpression(DialerImpression.Type.VVM_SHARE_PRESSED); + voicemailPlaybackPresenter.shareVoicemail(); return; } @@ -1024,7 +1022,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder return; } - final Intent intent = intentProvider.getIntent(mContext); + final Intent intent = intentProvider.getIntent(context); // See IntentProvider.getCallDetailIntentProvider() for why this may be null. if (intent == null) { return; @@ -1037,19 +1035,19 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder startDuoActivity(intent); } else if (CallDetailsActivity.isLaunchIntent(intent)) { PerformanceReport.recordClick(UiAction.Type.OPEN_CALL_DETAIL); - ((Activity) mContext) + ((Activity) context) .startActivityForResult(intent, ActivityRequestCodes.DIALTACTS_CALL_DETAILS); } else { if (Intent.ACTION_CALL.equals(intent.getAction()) && intent.getIntExtra(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE, -1) == VideoProfile.STATE_BIDIRECTIONAL) { - Logger.get(mContext).logImpression(DialerImpression.Type.IMS_VIDEO_REQUESTED_FROM_CALL_LOG); + Logger.get(context).logImpression(DialerImpression.Type.IMS_VIDEO_REQUESTED_FROM_CALL_LOG); } else if (intent.getDataString() != null && intent.getDataString().contains(DuoConstants.PACKAGE_NAME)) { - Logger.get(mContext).logImpression(DialerImpression.Type.DUO_CALL_LOG_SET_UP_INSTALL); + Logger.get(context).logImpression(DialerImpression.Type.DUO_CALL_LOG_SET_UP_INSTALL); } - DialerUtils.startActivityWithErrorToast(mContext, intent); + DialerUtils.startActivityWithErrorToast(context, intent); } } @@ -1062,14 +1060,14 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder private void startDuoActivity(Intent intent) { if (DuoConstants.DUO_ACTIVATE_ACTION.equals(intent.getAction())) { - Logger.get(mContext).logImpression(DialerImpression.Type.DUO_CALL_LOG_SET_UP_ACTIVATE); + Logger.get(context).logImpression(DialerImpression.Type.DUO_CALL_LOG_SET_UP_ACTIVATE); } else if (DuoConstants.DUO_INVITE_ACTION.equals(intent.getAction())) { - Logger.get(mContext).logImpression(DialerImpression.Type.DUO_CALL_LOG_INVITE); + Logger.get(context).logImpression(DialerImpression.Type.DUO_CALL_LOG_INVITE); } else if (DuoConstants.DUO_CALL_ACTION.equals(intent.getAction())) { - Logger.get(mContext) + Logger.get(context) .logImpression(DialerImpression.Type.LIGHTBRINGER_VIDEO_REQUESTED_FROM_CALL_LOG); if (isNonContactEntry(info)) { - Logger.get(mContext) + Logger.get(context) .logImpression( DialerImpression.Type.LIGHTBRINGER_NON_CONTACT_VIDEO_REQUESTED_FROM_CALL_LOG); } @@ -1079,10 +1077,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } try { - Activity activity = (Activity) mContext; + Activity activity = (Activity) context; activity.startActivityForResult(intent, ActivityRequestCodes.DIALTACTS_DUO); } catch (ActivityNotFoundException e) { - Toast.makeText(mContext, R.string.activity_not_available, Toast.LENGTH_SHORT).show(); + Toast.makeText(context, R.string.activity_not_available, Toast.LENGTH_SHORT).show(); } } @@ -1115,10 +1113,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder contact.setNumberLabel(numberType); /* third line of contact view. */ - String accountLabel = mCallLogCache.getAccountLabel(accountHandle); + String accountLabel = callLogCache.getAccountLabel(accountHandle); if (!TextUtils.isEmpty(accountLabel)) { SimDetails.Builder simDetails = SimDetails.newBuilder().setNetwork(accountLabel); - simDetails.setColor(mCallLogCache.getAccountColor(accountHandle)); + simDetails.setColor(callLogCache.getAccountColor(accountHandle)); contact.setSimDetails(simDetails.build()); } return contact.build(); @@ -1126,36 +1124,35 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder private void logCallLogAction(int id) { if (id == R.id.send_message_action) { - Logger.get(mContext).logImpression(DialerImpression.Type.CALL_LOG_SEND_MESSAGE); + Logger.get(context).logImpression(DialerImpression.Type.CALL_LOG_SEND_MESSAGE); } else if (id == R.id.add_to_existing_contact_action) { - Logger.get(mContext).logImpression(DialerImpression.Type.CALL_LOG_ADD_TO_CONTACT); + Logger.get(context).logImpression(DialerImpression.Type.CALL_LOG_ADD_TO_CONTACT); switch (hostUi) { case HostUi.CALL_HISTORY: - Logger.get(mContext) + Logger.get(context) .logImpression(DialerImpression.Type.ADD_TO_A_CONTACT_FROM_CALL_HISTORY); break; case HostUi.CALL_LOG: - Logger.get(mContext).logImpression(DialerImpression.Type.ADD_TO_A_CONTACT_FROM_CALL_LOG); + Logger.get(context).logImpression(DialerImpression.Type.ADD_TO_A_CONTACT_FROM_CALL_LOG); break; case HostUi.VOICEMAIL: - Logger.get(mContext).logImpression(DialerImpression.Type.ADD_TO_A_CONTACT_FROM_VOICEMAIL); + Logger.get(context).logImpression(DialerImpression.Type.ADD_TO_A_CONTACT_FROM_VOICEMAIL); break; default: throw Assert.createIllegalStateFailException(); } } else if (id == R.id.create_new_contact_action) { - Logger.get(mContext).logImpression(DialerImpression.Type.CALL_LOG_CREATE_NEW_CONTACT); + Logger.get(context).logImpression(DialerImpression.Type.CALL_LOG_CREATE_NEW_CONTACT); switch (hostUi) { case HostUi.CALL_HISTORY: - Logger.get(mContext) + Logger.get(context) .logImpression(DialerImpression.Type.CREATE_NEW_CONTACT_FROM_CALL_HISTORY); break; case HostUi.CALL_LOG: - Logger.get(mContext) - .logImpression(DialerImpression.Type.CREATE_NEW_CONTACT_FROM_CALL_LOG); + Logger.get(context).logImpression(DialerImpression.Type.CREATE_NEW_CONTACT_FROM_CALL_LOG); break; case HostUi.VOICEMAIL: - Logger.get(mContext) + Logger.get(context) .logImpression(DialerImpression.Type.CREATE_NEW_CONTACT_FROM_VOICEMAIL); break; default: @@ -1166,7 +1163,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder private void maybeShowBlockNumberMigrationDialog(BlockedNumbersMigrator.Listener listener) { if (!FilteredNumberCompat.maybeShowBlockNumberMigrationDialog( - mContext, ((Activity) mContext).getFragmentManager(), listener)) { + context, ((Activity) context).getFragmentManager(), listener)) { listener.onComplete(); } } @@ -1179,8 +1176,8 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder reportNotSpamView.setVisibility(View.GONE); String e164Number = PhoneNumberUtils.formatNumberToE164(number, countryIso); if (isVoicemailNumber - || !FilteredNumbersUtil.canBlockNumber(mContext, e164Number, number) - || !FilteredNumberCompat.canAttemptBlockOperations(mContext)) { + || !FilteredNumbersUtil.canBlockNumber(context, e164Number, number) + || !FilteredNumberCompat.canAttemptBlockOperations(context)) { return; } boolean isBlocked = blockId != null; @@ -1217,7 +1214,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } if (callType == CallLog.Calls.VOICEMAIL_TYPE) { - menu.setHeaderTitle(mContext.getResources().getText(R.string.voicemail)); + menu.setHeaderTitle(context.getResources().getText(R.string.voicemail)); } else { menu.setHeaderTitle( PhoneNumberUtilsCompat.createTtsSpannable( @@ -1237,7 +1234,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder // 3) Number is a SIP address if (PhoneNumberHelper.canPlaceCallsTo(number, numberPresentation) - && !mCallLogCache.isVoicemailNumber(accountHandle, number) + && !callLogCache.isVoicemailNumber(accountHandle, number) && !PhoneNumberHelper.isSipNumber(number)) { menu.add( ContextMenu.NONE, @@ -1258,10 +1255,10 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder } String e164Number = PhoneNumberUtils.formatNumberToE164(number, countryIso); - boolean isVoicemailNumber = mCallLogCache.isVoicemailNumber(accountHandle, number); + boolean isVoicemailNumber = callLogCache.isVoicemailNumber(accountHandle, number); if (!isVoicemailNumber - && FilteredNumbersUtil.canBlockNumber(mContext, e164Number, number) - && FilteredNumberCompat.canAttemptBlockOperations(mContext)) { + && FilteredNumbersUtil.canBlockNumber(context, e164Number, number) + && FilteredNumberCompat.canAttemptBlockOperations(context)) { boolean isBlocked = blockId != null; if (isBlocked) { menu.add( @@ -1309,7 +1306,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder .setOnMenuItemClickListener(this); } - Logger.get(mContext).logScreenView(ScreenEvent.Type.CALL_LOG_CONTEXT_MENU, (Activity) mContext); + Logger.get(context).logScreenView(ScreenEvent.Type.CALL_LOG_CONTEXT_MENU, (Activity) context); } /** Specifies where the view holder belongs. */ |