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

Commit a38ffa63 authored by Suchand Ghosh's avatar Suchand Ghosh Committed by Linux Build Service Account
Browse files

IMS: Conference URI support.

Add code not to parse dialString in case of
Conference URI and set EXTRAS_IS_CONFERENCE_URI
to ImsCallProfile.

IMS:Null check before retrieving extra from bundle
Add null check before retrieving extras from bundle
to avoid NullPointerException and crash.

IMS: Allow placeCall with complete uri
Add code to dial with complete uri if dial intent contains
extra "org.codeaurora.extra.SKIP_SCHEMA_PARSING" set to true

IMS: Add participant support.
Add ImsPhone's addParticipant() and
ImsPhoneCallTracker's addParticipant()
APIs and send add participant request
with ImsCall

Change-Id: I6ef44cbe50f13e9eeb7ee642111c7d100e164062
parent f8a101fc
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -894,6 +894,19 @@ public interface Phone {
    Connection dial(String dialString, UUSInfo uusInfo, int videoState, Bundle intentExtras)
            throws CallStateException;

    /**
     * Initiate to add a participant in an IMS call.
     * This happens asynchronously, so you cannot assume the audio path is
     * connected (or a call index has been assigned) until PhoneStateChanged
     * notification has occurred.
     *
     * @exception CallStateException if a new outgoing call is not currently
     *                possible because no more call slots exist or a call exists
     *                that is dialing, alerting, ringing, or waiting. Other
     *                errors are handled asynchronously.
     */
    public void addParticipant(String dialString) throws CallStateException;

    /**
     * Handles PIN MMI commands (PIN/PIN2/PUK/PUK2), which are initiated
     * without SEND (so <code>dial</code> is not appropriate).
+6 −0
Original line number Diff line number Diff line
@@ -2605,4 +2605,10 @@ public abstract class PhoneBase extends Handler implements Phone {
    public void setLocalCallHold(boolean lchStatus) {
        mCi.setLocalCallHold(lchStatus);
    }

    @Override
    public void addParticipant(String dialString) throws CallStateException {
        throw new CallStateException("addParticipant is not supported in this phone "
                + this);
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -770,6 +770,11 @@ public class PhoneProxy extends Handler implements Phone {
        return mActivePhone.dial(dialString, uusInfo, videoState, intentExtras);
    }

    @Override
    public void addParticipant(String dialString) throws CallStateException {
        mActivePhone.addParticipant(dialString);
    }

    @Override
    public boolean handlePinMmi(String dialString) {
        return mActivePhone.handlePinMmi(dialString);
+21 −0
Original line number Diff line number Diff line
@@ -895,6 +895,27 @@ public class GSMPhone extends PhoneBase {
        }
    }

    @Override
    public void addParticipant(String dialString) throws CallStateException {
        ImsPhone imsPhone = mImsPhone;
        boolean imsUseEnabled =
                ImsManager.isVolteEnabledByPlatform(mContext) &&
                ImsManager.isEnhanced4gLteModeSettingEnabledByUser(mContext);

        if (imsUseEnabled && imsPhone != null
                && imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE
                ) {
            try {
                if (LOCAL_DEBUG) Rlog.d(LOG_TAG, "Trying to add participant in IMS call");
                imsPhone.addParticipant(dialString);
            } catch (CallStateException e) {
                if (LOCAL_DEBUG) Rlog.d(LOG_TAG, "IMS PS call exception " + e);
            }
        } else {
            Rlog.e(LOG_TAG, "IMS is disabled so unable to add participant with IMS call");
        }
    }

    @Override
    public boolean handlePinMmi(String dialString) {
        GsmMmiCode mmi = GsmMmiCode.newFromDialString(dialString, this, mUiccApplication.get());
+17 −1
Original line number Diff line number Diff line
@@ -561,8 +561,19 @@ public class ImsPhone extends ImsPhoneBase {

    protected Connection dialInternal(String dialString, int videoState, Bundle intentExtras)
            throws CallStateException {
        boolean isConferenceUri = false;
        boolean isSkipSchemaParsing = false;
        if (intentExtras != null) {
            isConferenceUri = intentExtras.getBoolean(
                    TelephonyProperties.EXTRA_DIAL_CONFERENCE_URI, false);
            isSkipSchemaParsing = intentExtras.getBoolean(
                    TelephonyProperties.EXTRA_SKIP_SCHEMA_PARSING, false);
        }
        String newDialString = dialString;
        // Need to make sure dialString gets parsed properly
        String newDialString = PhoneNumberUtils.stripSeparators(dialString);
        if (!isConferenceUri && !isSkipSchemaParsing) {
            newDialString = PhoneNumberUtils.stripSeparators(dialString);
        }

        // handle in-call MMI first if applicable
        if (handleInCallMmiCommands(newDialString)) {
@@ -597,6 +608,11 @@ public class ImsPhone extends ImsPhoneBase {
        }
    }

    @Override
    public void addParticipant(String dialString) throws CallStateException {
        mCT.addParticipant(dialString);
    }

    @Override
    public void
    sendDtmf(char c) {
Loading