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

Commit 26462548 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Integrate ImsCallSessionListener API changes

Integrates the ImsCallSessionListener API changes.
This involves:

1) Moving the ImsCallSessionListener to the
android.telephony.ims namespace.
2) Creating a compat layer between the old
IImsCallSessionListener AIDL and the new one
for vendors using the old implementation.
3) Modify ImsCallSession to only use
setListener to set ImsCallSessionListener
(other method was never used in our code).

Test: Telephony Unit Tests, Manual IMS Tests
Bug: 63987047

Change-Id: I4378c0b1d68ff4f5f21815c81af52c03a66f81c5
parent 29a18c11
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -476,7 +476,7 @@ java_library {
        "telecomm/java/com/android/internal/telecom/RemoteServiceCallback.aidl",
        "telephony/java/android/telephony/data/IDataService.aidl",
        "telephony/java/android/telephony/data/IDataServiceCallback.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsCallSessionListener.aidl",
        "telephony/java/android/telephony/ims/aidl/IImsCallSessionListener.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsCapabilityCallback.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsConfig.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsConfigCallback.aidl",
@@ -485,6 +485,7 @@ java_library {
        "telephony/java/android/telephony/ims/internal/aidl/IImsRcsFeature.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsServiceController.aidl",
        "telephony/java/android/telephony/ims/internal/aidl/IImsServiceControllerListener.aidl",
	    "telephony/java/android/telephony/ims/internal/aidl/IImsSmsListener.aidl",
        "telephony/java/android/telephony/mbms/IMbmsDownloadSessionCallback.aidl",
        "telephony/java/android/telephony/mbms/IMbmsStreamingSessionCallback.aidl",
        "telephony/java/android/telephony/mbms/IDownloadStateCallback.aidl",
+51 −3
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -14,16 +14,17 @@
 * limitations under the License
 */

package android.telephony.ims.internal;
package android.telephony.ims;

import android.os.RemoteException;
import android.telephony.ims.internal.aidl.IImsCallSessionListener;
import android.telephony.ims.aidl.IImsCallSessionListener;

import com.android.ims.ImsCallProfile;
import com.android.ims.ImsConferenceState;
import com.android.ims.ImsReasonInfo;
import com.android.ims.ImsStreamMediaProfile;
import com.android.ims.ImsSuppServiceNotification;
import com.android.ims.internal.IImsCallSession;
import com.android.ims.internal.ImsCallSession;

/**
@@ -137,6 +138,20 @@ public class ImsCallSessionListener {
                profile);
    }

    /**
     * Called when the session merge has been started.  At this point, the {@code newSession}
     * represents the session which has been initiated to the IMS conference server for the
     * new merged conference.
     *
     * @param newSession the session object that is merged with an active & hold session
     *
     * @hide
     */
    public void callSessionMergeStarted(IImsCallSession newSession, ImsCallProfile profile)
            throws RemoteException {
        mListener.callSessionMergeStarted(newSession, profile);
    }

    /**
     * Called when the session merge is successful and the merged session is active.
     *
@@ -146,6 +161,17 @@ public class ImsCallSessionListener {
        mListener.callSessionMergeComplete(newSession != null ? newSession.getSession() : null);
    }

    /**
     * Called when the session merge is successful and the merged session is active.
     *
     * @param newSession the new session object that is used for the conference
     *
     * @hide
     */
    public void callSessionMergeComplete(IImsCallSession newSession) throws RemoteException {
        mListener.callSessionMergeComplete(newSession);
    }

    /**
     * Called when the session merge has failed.
     *
@@ -190,6 +216,18 @@ public class ImsCallSessionListener {
                profile);
    }

    /**
     * Called when the session has been extended to a conference session.
     *
     * @param newSession the session object that is extended to the conference
     *      from the active session
     * @hide
     */
    public void callSessionConferenceExtended(IImsCallSession newSession, ImsCallProfile profile)
            throws RemoteException {
        mListener.callSessionConferenceExtended(newSession, profile);
    }

    /**
     * Called when the conference extension has failed.
     *
@@ -208,6 +246,16 @@ public class ImsCallSessionListener {
                ? newSession.getSession() : null, profile);
    }

    /**
     * Called when the conference extension is received from the remote user.
     *
     * @hide
     */
    public void callSessionConferenceExtendReceived(IImsCallSession newSession,
            ImsCallProfile profile) throws RemoteException {
        mListener.callSessionConferenceExtendReceived(newSession, profile);
    }

    /**
     * Called when the invitation request of the participants is delivered to the conference
     * server.
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package android.telephony.ims.internal.aidl;
package android.telephony.ims.aidl;

import com.android.ims.ImsStreamMediaProfile;
import com.android.ims.ImsCallProfile;
+48 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

package android.telephony.ims.compat.feature;

import com.android.ims.ImsCallProfile;
import com.android.ims.internal.IImsCallSession;
import com.android.ims.internal.IImsCallSessionListener;
import com.android.ims.internal.ImsCallSession;

/**
 * Compatability layer for older implementations of MMTelFeature.
 *
 * @hide
 */

public class MMTelFeature extends android.telephony.ims.feature.MMTelFeature {

    @Override
    public final IImsCallSession createCallSession(int sessionId, ImsCallProfile profile) {
        return createCallSession(sessionId, profile, null /*listener*/);
    }

    /**
     * Creates an {@link ImsCallSession} with the specified call profile.
     *
     * @param sessionId a session id which is obtained from {@link #startSession}
     * @param profile a call profile to make the call
     * @param listener An implementation of IImsCallSessionListener.
     */
    public IImsCallSession createCallSession(int sessionId, ImsCallProfile profile,
            IImsCallSessionListener listener) {
        return null;
    }
}
+276 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

package android.telephony.ims.compat.stub;

import android.os.RemoteException;
import android.telephony.ims.ImsCallSessionListener;

import com.android.ims.ImsCallProfile;
import com.android.ims.ImsConferenceState;
import com.android.ims.ImsReasonInfo;
import com.android.ims.ImsStreamMediaProfile;
import com.android.ims.ImsSuppServiceNotification;
import com.android.ims.internal.IImsCallSession;
import com.android.ims.internal.IImsCallSessionListener;
import com.android.ims.internal.ImsCallSession;

/**
 * Compat implementation of ImsCallSessionImplBase for older implementations.
 *
 * DO NOT remove or change the existing APIs, only add new ones to this Base implementation or you
 * will break other implementations of ImsCallSession maintained by other ImsServices.
 *
 * @hide
 */

public class ImsCallSessionImplBase extends android.telephony.ims.stub.ImsCallSessionImplBase {

    @Override
    public final void setListener(ImsCallSessionListener listener) {
        setListener(new ImsCallSessionListenerConverter(listener));
    }

    /**
     * Sets the listener to listen to the session events. An {@link ImsCallSession}
     * can only hold one listener at a time. Subsequent calls to this method
     * override the previous listener.
     *
     * @param listener to listen to the session events of this object
     */
    public void setListener(IImsCallSessionListener listener) {

    }

    /**
     * There are two different ImsCallSessionListeners that need to reconciled here, we need to
     * convert the "old" version of the com.android.ims.internal.IImsCallSessionListener to the
     * "new" version of the Listener android.telephony.ims.ImsCallSessionListener when calling
     * back to the framework.
     */
    private class ImsCallSessionListenerConverter extends IImsCallSessionListener.Stub {

        private final ImsCallSessionListener mNewListener;

        public ImsCallSessionListenerConverter(ImsCallSessionListener listener) {
            mNewListener = listener;
        }

        @Override
        public void callSessionProgressing(IImsCallSession i,
                ImsStreamMediaProfile imsStreamMediaProfile) throws RemoteException {
            mNewListener.callSessionProgressing(imsStreamMediaProfile);
        }

        @Override
        public void callSessionStarted(IImsCallSession i, ImsCallProfile imsCallProfile)
                throws RemoteException {
            mNewListener.callSessionInitiated(imsCallProfile);
        }

        @Override
        public void callSessionStartFailed(IImsCallSession i, ImsReasonInfo imsReasonInfo)
                throws RemoteException {
            mNewListener.callSessionInitiatedFailed(imsReasonInfo);
        }

        @Override
        public void callSessionTerminated(IImsCallSession i, ImsReasonInfo imsReasonInfo)
                throws RemoteException {
            mNewListener.callSessionTerminated(imsReasonInfo);
        }

        @Override
        public void callSessionHeld(IImsCallSession i, ImsCallProfile imsCallProfile)
                throws RemoteException {
            mNewListener.callSessionHeld(imsCallProfile);
        }

        @Override
        public void callSessionHoldFailed(IImsCallSession i, ImsReasonInfo imsReasonInfo)
                throws RemoteException {
            mNewListener.callSessionHoldFailed(imsReasonInfo);
        }

        @Override
        public void callSessionHoldReceived(IImsCallSession i, ImsCallProfile imsCallProfile)
                throws RemoteException {
            mNewListener.callSessionHoldReceived(imsCallProfile);
        }

        @Override
        public void callSessionResumed(IImsCallSession i, ImsCallProfile imsCallProfile)
                throws RemoteException {
            mNewListener.callSessionResumed(imsCallProfile);
        }

        @Override
        public void callSessionResumeFailed(IImsCallSession i, ImsReasonInfo imsReasonInfo)
                throws RemoteException {
            mNewListener.callSessionResumeFailed(imsReasonInfo);
        }

        @Override
        public void callSessionResumeReceived(IImsCallSession i, ImsCallProfile imsCallProfile)
                throws RemoteException {
            mNewListener.callSessionResumeReceived(imsCallProfile);
        }

        @Override
        public void callSessionMergeStarted(IImsCallSession i, IImsCallSession newSession,
                ImsCallProfile profile)
                throws RemoteException {
            mNewListener.callSessionMergeStarted(newSession, profile);
        }

        @Override
        public void callSessionMergeComplete(IImsCallSession iImsCallSession)
                throws RemoteException {
            mNewListener.callSessionMergeComplete(iImsCallSession);
        }

        @Override
        public void callSessionMergeFailed(IImsCallSession i, ImsReasonInfo imsReasonInfo)
                throws RemoteException {
            mNewListener.callSessionMergeFailed(imsReasonInfo);
        }

        @Override
        public void callSessionUpdated(IImsCallSession i, ImsCallProfile imsCallProfile)
                throws RemoteException {
            mNewListener.callSessionUpdated(imsCallProfile);
        }

        @Override
        public void callSessionUpdateFailed(IImsCallSession i, ImsReasonInfo imsReasonInfo)
                throws RemoteException {
            mNewListener.callSessionUpdateFailed(imsReasonInfo);
        }

        @Override
        public void callSessionUpdateReceived(IImsCallSession i, ImsCallProfile imsCallProfile)
                throws RemoteException {
            mNewListener.callSessionUpdateReceived(imsCallProfile);
        }

        @Override
        public void callSessionConferenceExtended(IImsCallSession i, IImsCallSession newSession,
                ImsCallProfile imsCallProfile) throws RemoteException {
            mNewListener.callSessionConferenceExtended(newSession, imsCallProfile);
        }

        @Override
        public void callSessionConferenceExtendFailed(IImsCallSession i,
                ImsReasonInfo imsReasonInfo) throws RemoteException {
            mNewListener.callSessionConferenceExtendFailed(imsReasonInfo);
        }

        @Override
        public void callSessionConferenceExtendReceived(IImsCallSession i,
                IImsCallSession newSession, ImsCallProfile imsCallProfile)
                throws RemoteException {
            mNewListener.callSessionConferenceExtendReceived(newSession, imsCallProfile);
        }

        @Override
        public void callSessionInviteParticipantsRequestDelivered(IImsCallSession i)
                throws RemoteException {
            mNewListener.callSessionInviteParticipantsRequestDelivered();
        }

        @Override
        public void callSessionInviteParticipantsRequestFailed(IImsCallSession i,
                ImsReasonInfo imsReasonInfo) throws RemoteException {
            mNewListener.callSessionInviteParticipantsRequestFailed(imsReasonInfo);
        }

        @Override
        public void callSessionRemoveParticipantsRequestDelivered(IImsCallSession i)
                throws RemoteException {
            mNewListener.callSessionRemoveParticipantsRequestDelivered();
        }

        @Override
        public void callSessionRemoveParticipantsRequestFailed(IImsCallSession i,
                ImsReasonInfo imsReasonInfo) throws RemoteException {
            mNewListener.callSessionRemoveParticipantsRequestFailed(imsReasonInfo);
        }

        @Override
        public void callSessionConferenceStateUpdated(IImsCallSession i,
                ImsConferenceState imsConferenceState) throws RemoteException {
            mNewListener.callSessionConferenceStateUpdated(imsConferenceState);
        }

        @Override
        public void callSessionUssdMessageReceived(IImsCallSession i, int mode, String message)
                throws RemoteException {
            mNewListener.callSessionUssdMessageReceived(mode, message);
        }

        @Override
        public void callSessionHandover(IImsCallSession i, int srcAccessTech, int targetAccessTech,
                ImsReasonInfo reasonInfo) throws RemoteException {
            mNewListener.callSessionHandover(srcAccessTech, targetAccessTech, reasonInfo);
        }

        @Override
        public void callSessionHandoverFailed(IImsCallSession i, int srcAccessTech,
                int targetAccessTech, ImsReasonInfo reasonInfo) throws RemoteException {
            mNewListener.callSessionHandoverFailed(srcAccessTech, targetAccessTech, reasonInfo);
        }

        @Override
        public void callSessionMayHandover(IImsCallSession i, int srcAccessTech, int targetAccessTech)
                throws RemoteException {
            mNewListener.callSessionMayHandover(srcAccessTech, targetAccessTech);
        }

        @Override
        public void callSessionTtyModeReceived(IImsCallSession iImsCallSession, int mode)
                throws RemoteException {
            mNewListener.callSessionTtyModeReceived(mode);
        }

        @Override
        public void callSessionMultipartyStateChanged(IImsCallSession i, boolean isMultiparty)
                throws RemoteException {
            mNewListener.callSessionMultipartyStateChanged(isMultiparty);
        }

        @Override
        public void callSessionSuppServiceReceived(IImsCallSession i,
                ImsSuppServiceNotification imsSuppServiceNotification) throws RemoteException {
            mNewListener.callSessionSuppServiceReceived(imsSuppServiceNotification);
        }

        @Override
        public void callSessionRttModifyRequestReceived(IImsCallSession i,
                ImsCallProfile imsCallProfile) throws RemoteException {
            mNewListener.callSessionRttModifyRequestReceived(imsCallProfile);
        }

        @Override
        public void callSessionRttModifyResponseReceived(int status) throws RemoteException {
            mNewListener.callSessionRttModifyResponseReceived(status);
        }

        @Override
        public void callSessionRttMessageReceived(String rttMessage) throws RemoteException {
            mNewListener.callSessionRttMessageReceived(rttMessage);
        }
    }
}
Loading