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

Commit 560ce2ce authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "IMS-VT: Fix answer VT call with different call types"

parents b8c5a92b 5af99447
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -610,8 +610,27 @@ public class CallManager {
     * @exception CallStateException when call is not ringing or waiting
     */
    public void acceptCall(Call ringingCall) throws CallStateException {
        acceptCall(ringingCall, Phone.CALL_TYPE_VOICE);
    }

    /**
     * Answers a ringing or waiting call, with an option to downgrade a Video
     * call Active call, if any, go on hold. If active call can't be held, i.e.,
     * a background call of the same channel exists, the active call will be
     * hang up. Answering occurs asynchronously, and final notification occurs
     * via
     * {@link #registerForPreciseCallStateChanged(android.os.Handler, int, java.lang.Object)
     * registerForPreciseCallStateChanged()}.
     *
     * @param ringingCall The call to answer
     * @param callType The call type to use to answer the call. Values from
     *            Phone.RIL_CALL_TYPE
     * @exception CallStateException when call is not ringing or waiting
     */
    public void acceptCall(Call ringingCall, int callType) throws CallStateException {
        Phone ringingPhone = ringingCall.getPhone();
        if (VDBG) {
            Rlog.d(LOG_TAG, "acceptCall api with calltype " + callType);
            Rlog.d(LOG_TAG, "acceptCall(" + ringingCall + " from " + ringingCall.getPhone() + ")");
            Rlog.d(LOG_TAG, toString());
        }
@@ -651,7 +670,11 @@ public class CallManager {
            }
        }

        if (ringingPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
            ringingPhone.acceptCall(callType);
        } else {
            ringingPhone.acceptCall();
        }

        if (VDBG) {
            Rlog.d(LOG_TAG, "End acceptCall(" +ringingCall + ")");
+10 −0
Original line number Diff line number Diff line
@@ -709,6 +709,16 @@ public interface Phone {
     */
    void acceptCall() throws CallStateException;

    /**
     * Answers a ringing or waiting call. Active calls, if any, go on hold.
     * Answering occurs asynchronously, and final notification occurs via
     * {@link #registerForPreciseCallStateChanged(android.os.Handler, int,
     * java.lang.Object) registerForPreciseCallStateChanged()}.
     *
     * @exception CallStateException when no call is ringing or waiting
     */
    void acceptCall(int callType) throws CallStateException;

    /**
     * Gets call type for IMS calls.
     *
+5 −0
Original line number Diff line number Diff line
@@ -1500,6 +1500,11 @@ public abstract class PhoneBase extends Handler implements Phone {
        return mCi.getRadioState().isOn();
    }

    // IMS APIs - Implemented only in ImsPhone
    public void acceptCall(int callType) throws CallStateException {
        throw new CallStateException("Accept with CallType is not supported in this phone " + this);
    }

    public int getCallType(Call call) throws CallStateException {
        throw new CallStateException("getCallType is not supported in this phone " + this);
    }
+5 −0
Original line number Diff line number Diff line
@@ -593,6 +593,11 @@ public class PhoneProxy extends Handler implements Phone {
        mActivePhone.acceptCall();
    }

    @Override
    public void acceptCall(int callType) throws CallStateException {
        mActivePhone.acceptCall(callType);
    }

    @Override
    public int getCallType(Call call) throws CallStateException {
        return mActivePhone.getCallType(call);