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

Commit ca3665d6 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

Change-Id: If29f09a5f025b0db5d42e2951881063801083d01
parents 03931c62 c1144f4f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -487,6 +487,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);
        }