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

Commit 627929ab authored by Hunsuk Choi's avatar Hunsuk Choi Committed by Android (Google) Code Review
Browse files

Merge "Implement apis to support SRVCC"

parents 1692786d 31437bdf
Loading
Loading
Loading
Loading
+56 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import android.telephony.ims.ImsService;
import android.telephony.ims.ProvisioningManager;
import android.telephony.ims.RegistrationManager;
import android.telephony.ims.RtpHeaderExtensionType;
import android.telephony.ims.SrvccCall;
import android.telephony.ims.aidl.IImsCapabilityCallback;
import android.telephony.ims.aidl.IImsConfig;
import android.telephony.ims.aidl.IImsConfigCallback;
@@ -60,6 +61,7 @@ import android.telephony.ims.aidl.IImsRegistration;
import android.telephony.ims.aidl.IImsRegistrationCallback;
import android.telephony.ims.aidl.IImsSmsListener;
import android.telephony.ims.aidl.ISipTransport;
import android.telephony.ims.aidl.ISrvccStartedCallback;
import android.telephony.ims.feature.CapabilityChangeRequest;
import android.telephony.ims.feature.ImsFeature;
import android.telephony.ims.feature.MmTelFeature;
@@ -2727,6 +2729,60 @@ public class ImsManager implements FeatureUpdates {
        }
    }

    /**
     * Notifies SRVCC started.
     * @param cb The callback to receive the list of {@link SrvccCall}.
     */
    public void notifySrvccStarted(ISrvccStartedCallback cb)
            throws ImsException {
        MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable();
        try {
            c.notifySrvccStarted(cb);
        } catch (RemoteException e) {
            throw new ImsException("notifySrvccStarted", e,
                    ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
        }
    }

    /**
     * Notifies SRVCC is completed, IMS service will hang up all calls.
     */
    public void notifySrvccCompleted() throws ImsException {
        MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable();
        try {
            c.notifySrvccCompleted();
        } catch (RemoteException e) {
            throw new ImsException("notifySrvccCompleted", e,
                    ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
        }
    }

    /**
     * Notifies SRVCC failed. IMS service will recover and continue calls over IMS.
     */
    public void notifySrvccFailed() throws ImsException {
        MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable();
        try {
            c.notifySrvccFailed();
        } catch (RemoteException e) {
            throw new ImsException("notifySrvccFailed", e,
                    ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
        }
    }

    /**
     * Notifies SRVCC is canceled. IMS service will recover and continue calls over IMS.
     */
    public void notifySrvccCanceled() throws ImsException {
        MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable();
        try {
            c.notifySrvccCanceled();
        } catch (RemoteException e) {
            throw new ImsException("notifySrvccCanceled", e,
                    ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN);
        }
    }

    public int getImsServiceState() throws ImsException {
        MmTelFeatureConnection c = getOrThrowExceptionIfServiceUnavailable();
        return c.getFeatureState();
+30 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.telephony.ims.aidl.IImsRegistration;
import android.telephony.ims.aidl.IImsRegistrationCallback;
import android.telephony.ims.aidl.IImsSmsListener;
import android.telephony.ims.aidl.ISipTransport;
import android.telephony.ims.aidl.ISrvccStartedCallback;
import android.telephony.ims.feature.CapabilityChangeRequest;
import android.telephony.ims.feature.MmTelFeature;
import android.telephony.ims.stub.ImsEcbmImplBase;
@@ -541,6 +542,35 @@ public class MmTelFeatureConnection extends FeatureConnection {
        }
    }

    public void notifySrvccStarted(ISrvccStartedCallback cb)
            throws RemoteException {
        synchronized (mLock) {
            checkServiceIsReady();
            getServiceInterface(mBinder).notifySrvccStarted(cb);
        }
    }

    public void notifySrvccCompleted() throws RemoteException {
        synchronized (mLock) {
            checkServiceIsReady();
            getServiceInterface(mBinder).notifySrvccCompleted();
        }
    }

    public void notifySrvccFailed() throws RemoteException {
        synchronized (mLock) {
            checkServiceIsReady();
            getServiceInterface(mBinder).notifySrvccFailed();
        }
    }

    public void notifySrvccCanceled() throws RemoteException {
        synchronized (mLock) {
            checkServiceIsReady();
            getServiceInterface(mBinder).notifySrvccCanceled();
        }
    }

    public @MmTelFeature.ProcessCallResult int shouldProcessCall(boolean isEmergency,
            String[] numbers) throws RemoteException {
        if (isEmergency && !isEmergencyMmTelAvailable()) {