Search in sources :

Example 6 with CallIntentBuilder

use of com.android.dialer.callintent.CallIntentBuilder in project android_packages_apps_Dialer by LineageOS.

the class MissedCallNotifier method callBackFromMissedCall.

/**
 * Trigger an intent to make a call from a missed call number.
 */
@WorkerThread
public void callBackFromMissedCall(String number, Uri callUri) {
    closeSystemDialogs(context);
    CallLogNotificationsQueryHelper.markSingleMissedCallInCallLogAsRead(context, callUri);
    cancelSingleMissedCallNotification(context, callUri);
    DialerUtils.startActivityWithErrorToast(context, new CallIntentBuilder(number, CallInitiationType.Type.MISSED_CALL_NOTIFICATION).build().setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
Also used : CallIntentBuilder(com.android.dialer.callintent.CallIntentBuilder) WorkerThread(android.support.annotation.WorkerThread)

Example 7 with CallIntentBuilder

use of com.android.dialer.callintent.CallIntentBuilder in project android_packages_apps_Dialer by LineageOS.

the class CallComposerActivity method placeRCSCall.

private void placeRCSCall(MultimediaData.Builder builder) {
    MultimediaData data = builder.build();
    LogUtil.i("CallComposerActivity.placeRCSCall", "placing enriched call, data: " + data);
    Logger.get(this).logImpression(DialerImpression.Type.CALL_COMPOSER_ACTIVITY_PLACE_RCS_CALL);
    getEnrichedCallManager().sendCallComposerData(sessionId, data);
    TelecomUtil.placeCall(this, new CallIntentBuilder(contact.getNumber(), CallInitiationType.Type.CALL_COMPOSER).build());
    setResult(RESULT_OK);
    SharedPreferences preferences = DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(this);
    // Show a toast for privacy purposes if this is the first time a user uses call composer.
    if (preferences.getBoolean(KEY_IS_FIRST_CALL_COMPOSE, true)) {
        int privacyMessage = data.hasImageData() ? R.string.image_sent_messages : R.string.message_sent_messages;
        Toast toast = Toast.makeText(this, privacyMessage, Toast.LENGTH_LONG);
        int yOffset = getResources().getDimensionPixelOffset(R.dimen.privacy_toast_y_offset);
        toast.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 0, yOffset);
        toast.show();
        preferences.edit().putBoolean(KEY_IS_FIRST_CALL_COMPOSE, false).apply();
    }
    finish();
}
Also used : MultimediaData(com.android.dialer.multimedia.MultimediaData) CallIntentBuilder(com.android.dialer.callintent.CallIntentBuilder) Toast(android.widget.Toast) SharedPreferences(android.content.SharedPreferences)

Aggregations

CallIntentBuilder (com.android.dialer.callintent.CallIntentBuilder)7 Intent (android.content.Intent)5 DialogFragment (android.app.DialogFragment)1 SharedPreferences (android.content.SharedPreferences)1 RecognizerIntent (android.speech.RecognizerIntent)1 WorkerThread (android.support.annotation.WorkerThread)1 Toast (android.widget.Toast)1 MultimediaData (com.android.dialer.multimedia.MultimediaData)1