use of com.android.dialer.callintent.CallIntentBuilder in project android_packages_apps_Dialer by LineageOS.
the class PhoneNumberInteraction method performAction.
private static void performAction(Context context, String phoneNumber, int interactionType, boolean isVideoCall, CallSpecificAppData callSpecificAppData) {
Intent intent;
switch(interactionType) {
case ContactDisplayUtils.INTERACTION_SMS:
intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("sms", phoneNumber, null));
break;
default:
intent = new CallIntentBuilder(phoneNumber, callSpecificAppData).setIsVideoCall(isVideoCall).build();
break;
}
DialerUtils.startActivityWithErrorToast(context, intent);
}
use of com.android.dialer.callintent.CallIntentBuilder in project android_packages_apps_Dialer by LineageOS.
the class VideoCallNotAvailablePrompt method makeVoiceCall.
private void makeVoiceCall(Context context, String number, PhoneAccountHandle accountHandle) {
LogUtil.enterBlock("VideoCallNotAvailablePrompt.makeVoiceCall");
Intent intent = new CallIntentBuilder(number, CallInitiationType.Type.IMS_VIDEO_BLOCKED_FALLBACK_TO_VOICE).setPhoneAccountHandle(accountHandle).build();
DialerUtils.startActivityWithErrorToast(context, intent);
}
use of com.android.dialer.callintent.CallIntentBuilder in project android_packages_apps_Dialer by LineageOS.
the class DialpadFragment method newFlashIntent.
private Intent newFlashIntent() {
Intent intent = new CallIntentBuilder(EMPTY_NUMBER, CallInitiationType.Type.DIALPAD).build();
intent.putExtra(EXTRA_SEND_EMPTY_FLASH, true);
return intent;
}
use of com.android.dialer.callintent.CallIntentBuilder in project android_packages_apps_Dialer by LineageOS.
the class DialpadFragment method handleDialButtonPressed.
/**
* In most cases, when the dial button is pressed, there is a number in digits area. Pack it in
* the intent, start the outgoing call broadcast as a separate task and finish this activity.
*
* <p>When there is no digit and the phone is CDMA and off hook, we're sending a blank flash for
* CDMA. CDMA networks use Flash messages when special processing needs to be done, mainly for
* 3-way or call waiting scenarios. Presumably, here we're in a special 3-way scenario where the
* network needs a blank flash before being able to add the new participant. (This is not the case
* with all 3-way calls, just certain CDMA infrastructures.)
*
* <p>Otherwise, there is no digit, display the last dialed number. Don't finish since the user
* may want to edit it. The user needs to press the dial button again, to dial it (general case
* described above).
*/
private void handleDialButtonPressed() {
if (isDigitsEmpty()) {
// No number entered.
// No real call made, so treat it as a click
PerformanceReport.recordClick(UiAction.Type.PRESS_CALL_BUTTON_WITHOUT_CALLING);
handleDialButtonClickWithEmptyDigits();
} else {
final String number = mDigits.getText().toString();
// TODO: clean it up.
if (number != null && !TextUtils.isEmpty(mProhibitedPhoneNumberRegexp) && number.matches(mProhibitedPhoneNumberRegexp)) {
PerformanceReport.recordClick(UiAction.Type.PRESS_CALL_BUTTON_WITHOUT_CALLING);
LogUtil.i("DialpadFragment.handleDialButtonPressed", "The phone number is prohibited explicitly by a rule.");
if (getActivity() != null) {
DialogFragment dialogFragment = ErrorDialogFragment.newInstance(R.string.dialog_phone_call_prohibited_message);
dialogFragment.show(getFragmentManager(), "phone_prohibited_dialog");
}
// Clear the digits just in case.
clearDialpad();
} else {
final Intent intent = new CallIntentBuilder(number, CallInitiationType.Type.DIALPAD).build();
DialerUtils.startActivityWithErrorToast(getActivity(), intent);
hideAndClearDialpad(false);
}
}
}
use of com.android.dialer.callintent.CallIntentBuilder in project android_packages_apps_Dialer by LineageOS.
the class DialtactsActivity method onPickPhoneNumber.
@Override
public void onPickPhoneNumber(String phoneNumber, boolean isVideoCall, CallSpecificAppData callSpecificAppData) {
if (phoneNumber == null) {
// Invalid phone number, but let the call go through so that InCallUI can show
// an error message.
phoneNumber = "";
}
Intent intent = new CallIntentBuilder(phoneNumber, callSpecificAppData).setIsVideoCall(isVideoCall).build();
DialerUtils.startActivityWithErrorToast(this, intent);
mClearSearchOnPause = true;
}
Aggregations