public CallIntentBuilder(String number) { this(CallUtil.getCallUri(number)); }
/** * A variant of {@link #getCallIntent} for starting a video call. */ public static Intent getVideoCallIntent(String number, String callOrigin) { final Intent intent = new Intent(Intent.ACTION_CALL, getCallUri(number)); intent.putExtra(TelecomManager.EXTRA_START_CALL_WITH_VIDEO_STATE, VideoProfile.STATE_BIDIRECTIONAL); if (!TextUtils.isEmpty(callOrigin)) { intent.putExtra(PhoneConstants.EXTRA_CALL_ORIGIN, callOrigin); } return intent; }
/** * Return an Intent for making a phone call. Scheme (e.g. tel, sip) will be determined * automatically. */ public static Intent getCallIntent(String number) { return getCallIntent(getCallUri(number)); }
/** * Return an Intent for making a phone call. Scheme (e.g. tel, sip) will be determined * automatically. */ public static Intent getCallWithSubjectIntent(String number, PhoneAccountHandle phoneAccountHandle, String callSubject) { final Intent intent = getCallIntent(getCallUri(number)); intent.putExtra(TelecomManager.EXTRA_CALL_SUBJECT, callSubject); if (phoneAccountHandle != null) { intent.putExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE, phoneAccountHandle); } return intent; }
@Override public boolean onMenuItemClick(MenuItem item) { int resId = item.getItemId(); if (resId == R.id.context_menu_block_number) { FilteredNumberCompat .showBlockNumberDialogFlow(mContext.getContentResolver(), blockId, number, countryIso, displayNumber, R.id.floating_action_button_container, ((Activity) mContext).getFragmentManager(), mFilteredNumberDialogCallback); return true; } else if (resId == R.id.context_menu_copy_to_clipboard) { ClipboardUtils.copyText(mContext, null, number, true); return true; } else if (resId == R.id.context_menu_copy_transcript_to_clipboard) { ClipboardUtils.copyText(mContext, 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); return true; } return false; }
@Override public void onClick(View view) { int resId = view.getId(); if (resId == R.id.call_detail_action_block) { FilteredNumberCompat .showBlockNumberDialogFlow(mContext.getContentResolver(), mBlockedNumberId, mNumber, mDetails.countryIso, mDisplayNumber, R.id.call_detail, getFragmentManager(), this); } else if (resId == R.id.call_detail_action_copy) { ClipboardUtils.copyText(mContext, null, mNumber, true); } else if (resId == R.id.call_detail_action_edit_before_call) { Intent dialIntent = new Intent(Intent.ACTION_DIAL, CallUtil.getCallUri(getDialableNumber())); DialerUtils.startActivityWithErrorToast(mContext, dialIntent); } else { Log.wtf(TAG, "Unexpected onClick event from " + view); } }