Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe9ab6a6 authored by Daniel Bright's avatar Daniel Bright Committed by Automerger Merge Worker
Browse files

Add callSessionIntiating am: cffdd669 am: 2dc38a33 am: 63aae68c

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/net/ims/+/1520753

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifd63a9a989206225a356c6e46e6488c153765530
parents d7328eed 63aae68c
Loading
Loading
Loading
Loading
+41 −4
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.telephony.ims.ImsCallProfile;
import android.telephony.ims.ImsCallSession;
import android.telephony.ims.ImsCallSessionListener;
import android.telephony.ims.ImsConferenceState;
import android.telephony.ims.ImsReasonInfo;
import android.telephony.ims.ImsStreamMediaProfile;
@@ -94,11 +95,21 @@ public class ImsCall implements ICall {
     */
    public static class Listener {
        /**
         * Called when a request is sent out to initiate a new call
         * and 1xx response is received from the network.
         * Called after the network first begins to establish the call session and is now connecting
         * to the remote party.
         * The default implementation calls {@link #onCallStateChanged}.
         *
         * @param call the call object that carries out the IMS call
         * <p/>
         * see: {@link ImsCallSessionListener#callSessionInitiating}
         */
        public void onCallInitiating(ImsCall call) {
            onCallStateChanged(call);
        }

        /**
         * Called after the network has contacted the remote party.
         * The default implementation calls {@link #onCallStateChanged}.
         * <p/>
         * see: {@link ImsCallSessionListener#callSessionProgressing}
         */
        public void onCallProgressing(ImsCall call) {
            onCallStateChanged(call);
@@ -2435,6 +2446,32 @@ public class ImsCall implements ICall {

    @VisibleForTesting
    public class ImsCallSessionListenerProxy extends ImsCallSession.Listener {
        @Override
        public void callSessionInitiating(ImsCallSession session, ImsCallProfile profile) {
            logi("callSessionInitiating :: session=" + session + " profile=" + profile);
            if (isTransientConferenceSession(session)) {
                // If it is a transient (conference) session, there is no action for this signal.
                logi("callSessionInitiating :: not supported for transient conference session=" +
                        session);
                return;
            }

            ImsCall.Listener listener;

            synchronized(ImsCall.this) {
                listener = mListener;
                setCallProfile(profile);
            }

            if (listener != null) {
                try {
                    listener.onCallInitiating(ImsCall.this);
                } catch (Throwable t) {
                    loge("callSessionInitiating :: ", t);
                }
            }
        }

        @Override
        public void callSessionProgressing(ImsCallSession session, ImsStreamMediaProfile profile) {
            logi("callSessionProgressing :: session=" + session + " profile=" + profile);