Search in sources :

Example 16 with DialerCall

use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.

the class CallCardPresenter method supports2ndCallOnHold.

private boolean supports2ndCallOnHold() {
    DialerCall firstCall = CallList.getInstance().getActiveOrBackgroundCall();
    DialerCall incomingCall = CallList.getInstance().getIncomingCall();
    if (firstCall != null && incomingCall != null && firstCall != incomingCall) {
        return incomingCall.can(Details.CAPABILITY_HOLD);
    }
    return true;
}
Also used : DialerCall(com.android.incallui.call.DialerCall)

Example 17 with DialerCall

use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.

the class InCallVibrationHandler method onStateChange.

@Override
public void onStateChange(InCallState oldState, InCallState newState, CallList callList) {
    DialerCall activeCall = callList.getActiveCall();
    if (activeCall != null && mActiveCall == null) {
        Log.d(this, "Transition to active call " + activeCall);
        if (activeCall.isOutgoing()) {
            handleOutgoingCallVibration(activeCall);
        }
        mActiveCall = activeCall;
    } else if (activeCall != null && callList.getIncomingCall() != null && !callList.getIncomingCall().equals(activeCall)) {
        Log.d(this, "New incoming call" + callList.getIncomingCall());
        handleCallWaitingVibration(activeCall);
    } else if (activeCall == null && mActiveCall != null) {
        Log.d(this, "Transition from active call " + mActiveCall);
        handleCallEnd(mActiveCall);
        mActiveCall = null;
    }
}
Also used : DialerCall(com.android.incallui.call.DialerCall)

Example 18 with DialerCall

use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.

the class NotificationBroadcastReceiver method declineIncomingCall.

private void declineIncomingCall(Context context) {
    CallList callList = InCallPresenter.getInstance().getCallList();
    if (callList == null) {
        StatusBarNotifier.clearAllCallNotifications(context);
        LogUtil.e("NotificationBroadcastReceiver.declineIncomingCall", "call list is empty");
    } else {
        DialerCall call = callList.getIncomingCall();
        if (call != null) {
            call.reject(false, /* rejectWithMessage */
            null);
        }
    }
}
Also used : CallList(com.android.incallui.call.CallList) DialerCall(com.android.incallui.call.DialerCall)

Example 19 with DialerCall

use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.

the class ProximitySensor method onStateChange.

/**
 * Called to keep track of the overall UI state.
 */
@Override
public void onStateChange(InCallState oldState, InCallState newState, CallList callList) {
    // We ignore incoming state because we do not want to enable proximity
    // sensor during incoming call screen. We check hasLiveCall() because a disconnected call
    // can also put the in-call screen in the INCALL state.
    boolean hasOngoingCall = InCallState.INCALL == newState && callList.hasLiveCall();
    boolean isOffhook = (InCallState.OUTGOING == newState) || hasOngoingCall;
    DialerCall activeCall = callList.getActiveCall();
    boolean isVideoCall = activeCall != null && activeCall.isVideoCall();
    if (isOffhook != mIsPhoneOffhook || mIsVideoCall != isVideoCall) {
        mIsPhoneOffhook = isOffhook;
        mIsVideoCall = isVideoCall;
        mOrientation = AccelerometerListener.ORIENTATION_UNKNOWN;
        mAccelerometerListener.enable(mIsPhoneOffhook);
        updateProximitySensorMode();
    }
}
Also used : DialerCall(com.android.incallui.call.DialerCall)

Example 20 with DialerCall

use of com.android.incallui.call.DialerCall in project android_packages_apps_Dialer by LineageOS.

the class NotificationBroadcastReceiver method answerIncomingCall.

private void answerIncomingCall(Context context, int videoState) {
    CallList callList = InCallPresenter.getInstance().getCallList();
    if (callList == null) {
        StatusBarNotifier.clearAllCallNotifications(context);
        LogUtil.e("NotificationBroadcastReceiver.answerIncomingCall", "call list is empty");
    } else {
        DialerCall call = callList.getIncomingCall();
        if (call != null) {
            call.answer(videoState);
            InCallPresenter.getInstance().showInCall(false, /* showDialpad */
            false);
        }
    }
}
Also used : CallList(com.android.incallui.call.CallList) DialerCall(com.android.incallui.call.DialerCall)

Aggregations

DialerCall (com.android.incallui.call.DialerCall)35 CallList (com.android.incallui.call.CallList)6 RequiresPermission (android.support.annotation.RequiresPermission)3 ContactCacheEntry (com.android.incallui.ContactInfoCache.ContactCacheEntry)3 PhoneAccountHandle (android.telecom.PhoneAccountHandle)2 SpannableString (android.text.SpannableString)2 ActivityManager (android.app.ActivityManager)1 AlertDialog (android.app.AlertDialog)1 Dialog (android.app.Dialog)1 Notification (android.app.Notification)1 Context (android.content.Context)1 OnClickListener (android.content.DialogInterface.OnClickListener)1 Intent (android.content.Intent)1 Bitmap (android.graphics.Bitmap)1 Point (android.graphics.Point)1 AudioAttributes (android.media.AudioAttributes)1 Bundle (android.os.Bundle)1 NonNull (android.support.annotation.NonNull)1 ArrayMap (android.support.v4.util.ArrayMap)1 CallAudioState (android.telecom.CallAudioState)1