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

Commit 64bd356c authored by Pooja Jain's avatar Pooja Jain Committed by android-build-merger
Browse files

Merge "IMS: Add support for call deflection feature" am: c1144f4f am: ca3665d6

am: 35792b9f

Change-Id: Ia7bd78a433907fbb29186493ebc03f87a2a8601d
parents 41a43563 35792b9f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -493,6 +493,11 @@ public abstract class Connection {
        mUserData = userdata;
    }

    /**
     * Deflect individual Connection
     */
    public abstract void deflect(String number) throws CallStateException;

    /**
     * Hangup individual Connection
     */
+6 −0
Original line number Diff line number Diff line
@@ -356,6 +356,12 @@ public class GsmCdmaConnection extends Connection {
        }
    }

    @Override
    public void deflect(String number) throws CallStateException {
        // Deflect is not supported.
        throw new CallStateException ("deflect is not supported for CS");
    }

    @Override
    public void separate() throws CallStateException {
        if (!mDisconnected) {
+6 −0
Original line number Diff line number Diff line
@@ -126,6 +126,12 @@ public class ImsExternalConnection extends Connection {
        // No-op - Hangup is not supported for external calls.
    }

    @Override
    public void deflect(String number) throws CallStateException {
        // Deflect is not supported for external calls.
        throw new CallStateException ("Deflect is not supported for external calls");
    }

    @Override
    public void separate() throws CallStateException {
        // No-op - Separate is not supported for external calls.
+17 −0
Original line number Diff line number Diff line
@@ -342,6 +342,23 @@ public class ImsPhoneConnection extends Connection implements
        }
    }

    @Override
    public void deflect(String number) throws CallStateException {
        if (mParent.getState().isRinging()) {
            try {
                if (mImsCall != null) {
                    mImsCall.deflect(number);
                } else {
                    throw new CallStateException("no valid ims call to deflect");
                }
            } catch (ImsException e) {
                throw new CallStateException("cannot deflect call");
            }
        } else {
            throw new CallStateException("phone not ringing");
        }
    }

    @Override
    public void hangup() throws CallStateException {
        if (!mDisconnected) {
+6 −0
Original line number Diff line number Diff line
@@ -1006,6 +1006,12 @@ public class SipPhone extends SipPhoneBase {
            }
        }

        @Override
        public void deflect(String number) throws CallStateException {
            //Deflect is not supported.
            throw new CallStateException ("deflect is not supported for SipPhone");
        }

        private void log(String s) {
            Rlog.d(SCN_TAG, s);
        }