Search in sources :

Example 1 with LatencyReport

use of com.android.incallui.latencyreport.LatencyReport in project android_packages_apps_Dialer by LineageOS.

the class ExternalCallNotifier method showNotifcation.

/**
 * Shows a notification for a new external call. Performs a contact cache lookup to find any
 * associated photo and information for the call.
 */
private void showNotifcation(final NotificationInfo info) {
    // We make a call to the contact info cache to query for supplemental data to what the
    // call provides.  This includes the contact name and photo.
    // This callback will always get called immediately and synchronously with whatever data
    // it has available, and may make a subsequent call later (same thread) if it had to
    // call into the contacts provider for more data.
    DialerCall dialerCall = new DialerCall(mContext, new DialerCallDelegateStub(), info.getCall(), new LatencyReport(), false);
    mContactInfoCache.findInfo(dialerCall, false, /* isIncoming */
    new ContactInfoCache.ContactInfoCacheCallback() {

        @Override
        public void onContactInfoComplete(String callId, ContactInfoCache.ContactCacheEntry entry) {
            // removed during async contact info lookup.
            if (mNotifications.containsKey(info.getCall())) {
                saveContactInfo(info, entry);
            }
        }

        @Override
        public void onImageLoadComplete(String callId, ContactInfoCache.ContactCacheEntry entry) {
            // removed during async contact info lookup.
            if (mNotifications.containsKey(info.getCall())) {
                savePhoto(info, entry);
            }
        }
    });
}
Also used : DialerCall(com.android.incallui.call.DialerCall) LatencyReport(com.android.incallui.latencyreport.LatencyReport)

Example 2 with LatencyReport

use of com.android.incallui.latencyreport.LatencyReport in project android_packages_apps_Dialer by LineageOS.

the class InCallPresenter method onCallAdded.

public void onCallAdded(final android.telecom.Call call) {
    LatencyReport latencyReport = new LatencyReport(call);
    if (shouldAttemptBlocking(call)) {
        maybeBlockCall(call, latencyReport);
    } else {
        if (call.getDetails().hasProperty(CallCompat.Details.PROPERTY_IS_EXTERNAL_CALL)) {
            mExternalCallList.onCallAdded(call);
        } else {
            latencyReport.onCallBlockingDone();
            mCallList.onCallAdded(mContext, call, latencyReport);
        }
    }
    // Since a call has been added we are no longer waiting for Telecom to send us a call.
    setBoundAndWaitingForOutgoingCall(false, null);
    call.registerCallback(mCallCallback);
}
Also used : LatencyReport(com.android.incallui.latencyreport.LatencyReport)

Aggregations

LatencyReport (com.android.incallui.latencyreport.LatencyReport)2 DialerCall (com.android.incallui.call.DialerCall)1