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

Commit b0c1d7d5 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: I6c8cdf1726b3b523f8781e2897987216bb26928c
(cherry picked from commit 7dd5e2762ceffca04a97aab88c68cc23a0d2aa18)
(cherry picked from commit 30fdcb7655afa524a439d23c292fc5eb378d6695)
parent b2e58017
Loading
Loading
Loading
Loading
+77 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import com.android.internal.telephony.uicc.UsimServiceTable;
import com.android.internal.telephony.PhoneConstants.*; // ???? 

import java.util.List;
import java.util.Map;

/**
 * Internal interface used to control the phone; SDK developers cannot
@@ -1861,4 +1862,80 @@ public interface Phone {
     * @return, true if radio state = RADIO_ON, false otherwise
     */
    boolean isRadioOn();

    /**
     * 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;

}
+48 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;


@@ -221,6 +222,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;
@@ -1498,4 +1502,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);
    }

}
+38 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import com.android.internal.telephony.uicc.UsimServiceTable;
import com.android.internal.telephony.CallManager;

import java.util.List;
import java.util.Map;

public class PhoneProxy extends Handler implements Phone {
    public final static Object lockForRadioTechnologyChange = new Object();
@@ -607,6 +608,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);
@@ -1233,4 +1252,23 @@ public class PhoneProxy extends Handler implements Phone {
    public boolean isRadioOn() {
        return mCommandsInterface.getRadioState().isOn();
    }

    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);
    }

}