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

Commit 8e2607c4 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "IMS: Explicit Call transfer APIS." am: bea4fa51 am: bc30ec33

Change-Id: I156ef92de57b4b717d4b5f1baaa90433c4bfa2dd
parents 929b176f bc30ec33
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -664,6 +664,17 @@ public abstract class Connection {
     */
    public abstract void deflect(String number) throws CallStateException;

    /**
     * Transfer individual Connection
     */
    public abstract void transfer(String number, boolean isConfirmationRequired)
            throws CallStateException;

    /**
     * Transfer individual Connection for consultative transfer
     */
    public abstract void consultativeTransfer(Connection other) throws CallStateException;

    /**
     * Hangup individual Connection
     */
+12 −0
Original line number Diff line number Diff line
@@ -365,6 +365,18 @@ public class GsmCdmaConnection extends Connection {
        throw new CallStateException ("deflect is not supported for CS");
    }

    @Override
    public void transfer(String number, boolean isConfirmationRequired) throws CallStateException {
        // Transfer is not supported.
        throw new CallStateException("Transfer is not supported for CS");
    }

    @Override
    public void consultativeTransfer(Connection other) throws CallStateException {
        // Transfer is not supported.
        throw new CallStateException("Transfer is not supported for CS");
    }

    @Override
    public void separate() throws CallStateException {
        if (!mDisconnected) {
+12 −0
Original line number Diff line number Diff line
@@ -132,6 +132,18 @@ public class ImsExternalConnection extends Connection {
        throw new CallStateException ("Deflect is not supported for external calls");
    }

    @Override
    public void transfer(String number, boolean isConfirmationRequired) throws CallStateException {
        // Transfer is not supported for external calls.
        throw new CallStateException("Transfer is not supported for external calls");
    }

    @Override
    public void consultativeTransfer(Connection other) throws CallStateException {
        // Transfer is not supported for external calls.
        throw new CallStateException("Transfer is not supported for external calls");
    }

    @Override
    public void separate() throws CallStateException {
        // No-op - Separate is not supported for external calls.
+10 −0
Original line number Diff line number Diff line
@@ -3462,6 +3462,16 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            }
        }

        @Override
        public void onCallSessionTransferred(ImsCall imsCall) {
            if (DBG) log("onCallSessionTransferred success");
        }

        @Override
        public void onCallSessionTransferFailed(ImsCall imsCall, ImsReasonInfo reasonInfo) {
            if (DBG) log("onCallSessionTransferFailed reasonInfo=" + reasonInfo);
        }

        /**
         * Handles a change to the multiparty state for an {@code ImsCall}.  Notifies the associated
         * {@link ImsPhoneConnection} of the change.
+26 −0
Original line number Diff line number Diff line
@@ -413,6 +413,32 @@ public class ImsPhoneConnection extends Connection implements
        }
    }

    @Override
    public void transfer(String number, boolean isConfirmationRequired) throws CallStateException {
        try {
            if (mImsCall != null) {
                mImsCall.transfer(number, isConfirmationRequired);
            } else {
                throw new CallStateException("no valid ims call to transfer");
            }
        } catch (ImsException e) {
            throw new CallStateException("cannot transfer call");
        }
    }

    @Override
    public void consultativeTransfer(Connection other) throws CallStateException {
        try {
            if (mImsCall != null) {
                mImsCall.consultativeTransfer(((ImsPhoneConnection) other).getImsCall());
            } else {
                throw new CallStateException("no valid ims call to transfer");
            }
        } catch (ImsException e) {
            throw new CallStateException("cannot transfer call");
        }
    }

    @Override
    public void hangup() throws CallStateException {
        if (!mDisconnected) {
Loading