Search in sources :

Example 1 with CallIntentBuilder

use of com.android.dialer.util.IntentUtil.CallIntentBuilder in project android_packages_apps_Dialer by MoKee.

the class DialpadFragment method callVoicemail.

public void callVoicemail() {
    DialerUtils.startActivityWithErrorToast(getActivity(), new CallIntentBuilder(CallUtil.getVoicemailUri()).setCallInitiationType(LogState.INITIATION_DIALPAD).build());
    hideAndClearDialpad(false);
}
Also used : CallIntentBuilder(com.android.dialer.util.IntentUtil.CallIntentBuilder)

Example 2 with CallIntentBuilder

use of com.android.dialer.util.IntentUtil.CallIntentBuilder in project android_packages_apps_Dialer by MoKee.

the class DialpadFragment method newFlashIntent.

private Intent newFlashIntent() {
    final Intent intent = new CallIntentBuilder(EMPTY_NUMBER).build();
    intent.putExtra(EXTRA_SEND_EMPTY_FLASH, true);
    return intent;
}
Also used : CallIntentBuilder(com.android.dialer.util.IntentUtil.CallIntentBuilder) Intent(android.content.Intent)

Example 3 with CallIntentBuilder

use of com.android.dialer.util.IntentUtil.CallIntentBuilder in project android_packages_apps_Dialer by MoKee.

the class CallDetailActivity method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    mContext = this;
    mResources = getResources();
    mContactInfoHelper = new ContactInfoHelper(this, GeoUtil.getCurrentCountryIso(this));
    mContactsPreferences = new ContactsPreferences(mContext);
    mCallTypeHelper = new CallTypeHelper(getResources());
    mFilteredNumberAsyncQueryHandler = new FilteredNumberAsyncQueryHandler(getContentResolver());
    mVoicemailUri = getIntent().getParcelableExtra(EXTRA_VOICEMAIL_URI);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    setContentView(R.layout.call_detail);
    mInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
    mHistoryList = (ListView) findViewById(R.id.history);
    mHistoryList.addHeaderView(mInflater.inflate(R.layout.call_detail_header, null));
    mHistoryList.addFooterView(mInflater.inflate(R.layout.call_detail_footer, null), null, false);
    mQuickContactBadge = (QuickContactBadge) findViewById(R.id.quick_contact_photo);
    mQuickContactBadge.setOverlay(null);
    if (CompatUtils.hasPrioritizedMimeType()) {
        mQuickContactBadge.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE);
    }
    mCallerName = (TextView) findViewById(R.id.caller_name);
    mCallerNumber = (TextView) findViewById(R.id.caller_number);
    mAccountLabel = (TextView) findViewById(R.id.phone_account_label);
    mContactPhotoManager = ContactPhotoManager.getInstance(this);
    mCallButton = findViewById(R.id.call_back_button);
    mCallButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (TextUtils.isEmpty(mNumber)) {
                return;
            }
            Intent dialIntent = new CallIntentBuilder(getDialableNumber()).setCallInitiationType(LogState.INITIATION_CALL_DETAILS).build();
            if (DialerUtils.isConferenceURICallLog(mNumber, mPostDialDigits)) {
                dialIntent.putExtra("org.codeaurora.extra.DIAL_CONFERENCE_URI", true);
            }
            mContext.startActivity(dialIntent);
        }
    });
    mBlockNumberActionItem = (TextView) findViewById(R.id.call_detail_action_block);
    updateBlockActionItemVisibility(View.VISIBLE);
    mBlockNumberActionItem.setOnClickListener(this);
    mEditBeforeCallActionItem = findViewById(R.id.call_detail_action_edit_before_call);
    mEditBeforeCallActionItem.setOnClickListener(this);
    mReportActionItem = findViewById(R.id.call_detail_action_report);
    mReportActionItem.setOnClickListener(this);
    mCopyNumberActionItem = findViewById(R.id.call_detail_action_copy);
    mCopyNumberActionItem.setOnClickListener(this);
    if (getIntent().getBooleanExtra(EXTRA_FROM_NOTIFICATION, false)) {
        closeSystemDialogs();
    }
}
Also used : CallTypeHelper(com.android.dialer.calllog.CallTypeHelper) ContactsPreferences(com.android.contacts.common.preference.ContactsPreferences) ContactInfoHelper(com.android.dialer.calllog.ContactInfoHelper) CallIntentBuilder(com.android.dialer.util.IntentUtil.CallIntentBuilder) FilteredNumberAsyncQueryHandler(com.android.dialer.database.FilteredNumberAsyncQueryHandler) Intent(android.content.Intent) View(android.view.View) TextView(android.widget.TextView) ListView(android.widget.ListView)

Example 4 with CallIntentBuilder

use of com.android.dialer.util.IntentUtil.CallIntentBuilder in project android_packages_apps_Dialer by MoKee.

the class PhoneNumberInteraction method performAction.

private static void performAction(Context context, String phoneNumber, int interactionType, boolean isVideoCall, int callInitiationType) {
    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).setCallInitiationType(callInitiationType).setIsVideoCall(isVideoCall).build();
            break;
    }
    DialerUtils.startActivityWithErrorToast(context, intent);
}
Also used : CallIntentBuilder(com.android.dialer.util.IntentUtil.CallIntentBuilder) Intent(android.content.Intent)

Example 5 with CallIntentBuilder

use of com.android.dialer.util.IntentUtil.CallIntentBuilder in project android_packages_apps_Dialer by MoKee.

the class DialtactsActivity method onPickPhoneNumber.

@Override
public void onPickPhoneNumber(String phoneNumber, boolean isVideoCall, int callInitiationType) {
    if (phoneNumber == null) {
        // Invalid phone number, but let the call go through so that InCallUI can show
        // an error message.
        phoneNumber = "";
    }
    if (getResources().getBoolean(R.bool.config_regional_number_patterns_video_call) && !CallUtil.isVideoCallNumValid(phoneNumber) && isVideoCall && (CallUtil.isVideoEnabled(this))) {
        Toast.makeText(this, R.string.toast_make_video_call_failed, Toast.LENGTH_LONG).show();
        return;
    }
    final Intent intent = new CallIntentBuilder(phoneNumber).setIsVideoCall(isVideoCall).setCallInitiationType(callInitiationType).build();
    DialerUtils.startActivityWithErrorToast(this, intent);
    mClearSearchOnPause = true;
}
Also used : CallIntentBuilder(com.android.dialer.util.IntentUtil.CallIntentBuilder) Intent(android.content.Intent) RecognizerIntent(android.speech.RecognizerIntent)

Aggregations

CallIntentBuilder (com.android.dialer.util.IntentUtil.CallIntentBuilder)6 Intent (android.content.Intent)4 RecognizerIntent (android.speech.RecognizerIntent)1 View (android.view.View)1 ListView (android.widget.ListView)1 TextView (android.widget.TextView)1 ContactsPreferences (com.android.contacts.common.preference.ContactsPreferences)1 CallTypeHelper (com.android.dialer.calllog.CallTypeHelper)1 ContactInfoHelper (com.android.dialer.calllog.ContactInfoHelper)1 FilteredNumberAsyncQueryHandler (com.android.dialer.database.FilteredNumberAsyncQueryHandler)1