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

Commit c7b5d1fd authored by Anju Mathapati's avatar Anju Mathapati Committed by Linux Build Service Account
Browse files

IMS-VT: Upgrade,Downgrade,AVPF changes

- Implement call upgrade/downgrade for VT
- Support to send AVP upgrade error notification to user

Change-Id: I97819c39837be272a54d6de3ea9e4ec2c5fcc8a6
parent a1500b84
Loading
Loading
Loading
Loading
+75 −0
Original line number Diff line number Diff line
@@ -1817,4 +1817,79 @@ public interface Phone {
     */
    void removeReferences();

    /**
     * When the remote party in an IMS Call wants to upgrade or downgrade a
     * call, a CallModifyRequest message is received. This function registers
     * for that indication and sends a message to the handler when such an
     * indication occurs. A response to the request can be sent with
     * {@link Phone#acceptConnectionTypeChange(Map)} to accept the proposal, or
     * {@link Phone#rejectConnectionTypeChange()}
     *
     * @param h The handler that will receive the message
     * @param what The message to send
     * @param obj User object to send with the message
     */
    public void registerForModifyCallRequest(Handler h, int what, Object obj)
            throws CallStateException;

    public void unregisterForModifyCallRequest(Handler h) throws CallStateException;

    /**
     * When upgrade to video call and remote party does not support AVPF, IMS
     * Phone retries upgrade request and this function registers for the failure
     * indication
     * @param h The handler that will receive the message
     * @param what The message to send
     * @param obj User object to send with the message
     * @throws CallStateException
     */
    public void registerForAvpUpgradeFailure(Handler h, int what, Object obj)
            throws CallStateException;

    public void unregisterForAvpUpgradeFailure(Handler h) throws CallStateException;

    /**
     * Request a modification to a current connection This will send an
     * indication to the remote party with new call details, which the remote
     * party can agree to or reject. Used to upgrade/downgrade IMS call.
     * @param msg A message to be returned with the result of the action.
     * @param conn The connection to modify
     * @param newCallType The new call type
     * @param extras A map containing extra parameters
     */
    public void changeConnectionType(Message msg, Connection conn,
            int newCallType, Map<String, String> newExtras) throws CallStateException;

    /**
     * Approve a request to change the call type. Optionally, provide new extra
     * values.
     *
     * @param newExtras
     * @throws CallStateException
     */
    public void acceptConnectionTypeChange(Connection conn, Map<String, String> newExtras)
            throws CallStateException;

    /**
     * Reject a previously received request to change the call type.
     *
     * @throws CallStateException
     */
    public void rejectConnectionTypeChange(Connection conn) throws CallStateException;

    /**
     * When a remote user requests to change the type of the connection (e.g. to
     * upgrade from voice to video), it will be possible to query the proposed
     * type with this method. After receiving an indication of a request (see
     * {@link CallManager#registerForConnectionTypeChangeRequest(Handler, int, Object)}
     * ). If no request has been received, this function returns the current
     * type. The proposed type is cleared after calling
     * {@link #acceptConnectionTypeChange(Map)} or
     * {@link #rejectConnectionTypeChange()}.
     *
     * @return The proposed connection type or the current connectionType if no
     *         request exists.
     */
    public int getProposedConnectionType(Connection conn) throws CallStateException;

}
+47 −0
Original line number Diff line number Diff line
@@ -231,6 +231,9 @@ public abstract class PhoneBase extends Handler implements Phone {
    protected final RegistrantList mCallModifyRegistrants
            = new RegistrantList();

    protected final RegistrantList mAvpUpgradeFailureRegistrants
            = new RegistrantList();

    protected Looper mLooper; /* to insure registrants are in correct thread*/

    protected final Context mContext;
@@ -1440,4 +1443,48 @@ public abstract class PhoneBase extends Handler implements Phone {
                + this);
    }

    public void registerForModifyCallRequest(Handler h, int what, Object obj)
            throws CallStateException {
        throw new CallStateException("registerForModifyCallRequest is not supported in this phone "
                + this);
    }

    public void unregisterForModifyCallRequest(Handler h) throws CallStateException {
        throw new CallStateException(
                "unregisterForModifyCallRequest is not supported in this phone " + this);
    }

    public void registerForAvpUpgradeFailure(Handler h, int what, Object obj)
            throws CallStateException {
        throw new CallStateException("registerForAvpUpgradeFailure is not supported in this phone "
                + this);
    }

    public void unregisterForAvpUpgradeFailure(Handler h) throws CallStateException {
        throw new CallStateException(
                "unregisterForAvpUpgradeFailure is not supported in this phone "
                        + this);
    }

    public void changeConnectionType(Message msg, Connection conn,
            int newCallType, Map<String, String> newExtras) throws CallStateException {
        throw new CallStateException("changeConnectionType is not supported in this phone " + this);
    }

    public void acceptConnectionTypeChange(Connection conn, Map<String, String> newExtras)
            throws CallStateException {
        throw new CallStateException("acceptConnectionTypeChange is not supported in this phone "
                + this);
    }

    public void rejectConnectionTypeChange(Connection conn) throws CallStateException {
        throw new CallStateException("rejectConnectionTypeChange is not supported in this phone "
                + this);
    }

    public int getProposedConnectionType(Connection conn) throws CallStateException {
        throw new CallStateException("getProposedConnectionType is not supported in this phone "
                + this);
    }

}
+36 −0
Original line number Diff line number Diff line
@@ -591,6 +591,24 @@ public class PhoneProxy extends Handler implements Phone {
        mActivePhone.conference();
    }

    public void changeConnectionType(Message msg, Connection conn,
            int newCallType, Map<String, String> newExtras) throws CallStateException {
        mActivePhone.changeConnectionType(msg, conn, newCallType, newExtras);
    }

    public void acceptConnectionTypeChange(Connection conn, Map<String, String> newExtras)
            throws CallStateException {
        mActivePhone.acceptConnectionTypeChange(conn, newExtras);
    }

    public void rejectConnectionTypeChange(Connection conn) throws CallStateException {
        mActivePhone.rejectConnectionTypeChange(conn);
    }

    public int getProposedConnectionType(Connection conn) throws CallStateException {
        return mActivePhone.getProposedConnectionType(conn);
    }

    @Override
    public void enableEnhancedVoicePrivacy(boolean enable, Message onComplete) {
        mActivePhone.enableEnhancedVoicePrivacy(enable, onComplete);
@@ -1191,4 +1209,22 @@ public class PhoneProxy extends Handler implements Phone {
        mCommandsInterface = null;
    }

    public void registerForModifyCallRequest(Handler h, int what, Object obj)
            throws CallStateException {
        mActivePhone.registerForModifyCallRequest(h, what, obj);
    }

    public void unregisterForModifyCallRequest(Handler h) throws CallStateException {
        mActivePhone.unregisterForModifyCallRequest(h);
    }

    public void registerForAvpUpgradeFailure(Handler h, int what, Object obj)
            throws CallStateException {
        mActivePhone.registerForAvpUpgradeFailure(h, what, obj);
    }

    public void unregisterForAvpUpgradeFailure(Handler h) throws CallStateException {
        mActivePhone.unregisterForAvpUpgradeFailure(h);
    }

}