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

Commit 200861da authored by Omkar Kolangade's avatar Omkar Kolangade Committed by Linux Build Service Account
Browse files

IMS: Dial API Modifications to Support Call Extras

Adding framework support to allow OEMs to send
extra information with the Dial Intent all the
way to the IMS Service layer and beyond.

Change-Id: I551e63840b6a63e0cbd97919d4b03d2a68334dbd
parent 40df49d1
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.internal.telephony;
import android.content.Context;
import android.net.LinkProperties;
import android.net.NetworkCapabilities;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.telephony.CellInfo;
@@ -32,7 +33,6 @@ import com.android.internal.telephony.test.SimulatedRadioControl;
import com.android.internal.telephony.uicc.IsimRecords;
import com.android.internal.telephony.uicc.UiccCard;
import com.android.internal.telephony.uicc.UsimServiceTable;

import com.android.internal.telephony.PhoneConstants.*; // ????

import java.util.List;
@@ -833,6 +833,25 @@ public interface Phone {
     */
    Connection dial(String dialString, int videoState) throws CallStateException;

    /**
     * Initiate a new voice connection. This happens asynchronously, so you
     * cannot assume the audio path is connected (or a call index has been
     * assigned) until PhoneStateChanged notification has occurred.
     *
     * @param dialString The dial string.
     * @param videoState The desired video state for the connection.
     * @param extras Additional (meta) call information.
     *        OEMs can pass call extras (additional call info) Bundle
     *        in the following format:
     *        1) All values in the Bundle must be of type String
     *        2) Keys for the values are defined in ImsCallProfile.java
     * @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.
     */
    Connection dial(String dialString, int videoState, Bundle extras) throws CallStateException;

    /**
     * Initiate a new voice connection with supplementary User to User
     * Information. This happens asynchronously, so you cannot assume the audio
+7 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.Intent;
import android.net.LinkProperties;
import android.net.NetworkCapabilities;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.SystemProperties;
@@ -1440,4 +1441,10 @@ public class PhoneProxy extends Handler implements Phone {
    public void setLocalCallHold(int lchStatus) {
        mActivePhone.setLocalCallHold(lchStatus);
    }

    @Override
    public Connection dial(String dialString, int videoState, Bundle extras)
            throws CallStateException {
        return mActivePhone.dial(dialString, videoState, extras);
    }
}
+15 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.SharedPreferences;
import android.database.SQLException;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
@@ -416,6 +417,12 @@ public class CDMAPhone extends PhoneBase {
    @Override
    public Connection
    dial (String dialString, int videoState) throws CallStateException {
        return (dial(dialString, videoState, null));
    }

    @Override
    public Connection
    dial (String dialString, int videoState, Bundle extras) throws CallStateException {
        ImsPhone imsPhone = mImsPhone;

        boolean imsUseEnabled =
@@ -433,7 +440,7 @@ public class CDMAPhone extends PhoneBase {
                        com.android.internal.R.bool.useImsAlwaysForEmergencyCall))) ) {
            try {
                if (DBG) Rlog.d(LOG_TAG, "Trying IMS PS call");
                return imsPhone.dial(dialString, videoState);
                return imsPhone.dial(dialString, videoState, extras);
            } catch (CallStateException e) {
                if (DBG) Rlog.d(LOG_TAG, "IMS PS call exception " + e);
                if (!ImsPhone.CS_FALLBACK.equals(e.getMessage())) {
@@ -458,6 +465,12 @@ public class CDMAPhone extends PhoneBase {
        return mCT.dial(newDialString);
    }

    Connection
    dial(String dialString, UUSInfo uusInfo, int videoState, Bundle extras)
            throws CallStateException {
        return dial(dialString, uusInfo, videoState, null);
    }

    @Override
    public Connection dial(String dialString, UUSInfo uusInfo, int videoState)
            throws CallStateException {
@@ -1891,4 +1904,5 @@ public class CDMAPhone extends PhoneBase {
        }
        return status;
    }

}
+15 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.content.SharedPreferences;
import android.database.SQLException;
import android.net.Uri;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Registrant;
@@ -817,15 +818,27 @@ public class GSMPhone extends PhoneBase {
                ringingCallState.isAlive());
    }

    @Override
    public Connection
    dial(String dialString, int videoState, Bundle extras) throws CallStateException {
        return dial(dialString, null, videoState, extras);
    }

    @Override
    public Connection
    dial(String dialString, int videoState) throws CallStateException {
        return dial(dialString, null, videoState);
        return dial(dialString, null, videoState, null);
    }

    @Override
    public Connection
    dial (String dialString, UUSInfo uusInfo, int videoState) throws CallStateException {
        return dial(dialString, uusInfo, videoState, null);
    }

    public Connection
    dial (String dialString, UUSInfo uusInfo, int videoState, Bundle extras)
            throws CallStateException {
        ImsPhone imsPhone = mImsPhone;

        boolean imsUseEnabled =
@@ -843,7 +856,7 @@ public class GSMPhone extends PhoneBase {
                        com.android.internal.R.bool.useImsAlwaysForEmergencyCall))) ) {
            try {
                if (LOCAL_DEBUG) Rlog.d(LOG_TAG, "Trying IMS PS call");
                return imsPhone.dial(dialString, videoState);
                return imsPhone.dial(dialString, videoState, extras);
            } catch (CallStateException e) {
                if (LOCAL_DEBUG) Rlog.d(LOG_TAG, "IMS PS call exception " + e);
                if (!ImsPhone.CS_FALLBACK.equals(e.getMessage())) {
+10 −6
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.app.ActivityManagerNative;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
@@ -28,7 +29,6 @@ import android.os.RegistrantList;
import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.os.UserHandle;

import android.telephony.PhoneNumberUtils;
import android.telephony.ServiceState;
import android.telephony.Rlog;
@@ -52,7 +52,6 @@ import static com.android.internal.telephony.CommandsInterface.CB_FACILITY_BAICr
import static com.android.internal.telephony.CommandsInterface.CB_FACILITY_BA_ALL;
import static com.android.internal.telephony.CommandsInterface.CB_FACILITY_BA_MO;
import static com.android.internal.telephony.CommandsInterface.CB_FACILITY_BA_MT;

import static com.android.internal.telephony.CommandsInterface.CF_ACTION_DISABLE;
import static com.android.internal.telephony.CommandsInterface.CF_ACTION_ENABLE;
import static com.android.internal.telephony.CommandsInterface.CF_ACTION_ERASURE;
@@ -469,14 +468,19 @@ public class ImsPhone extends ImsPhoneBase {
        mDefaultPhone.notifyNewRingingConnectionP(c);
    }

    @Override
    public Connection
    dial(String dialString, int videoState, Bundle extras) throws CallStateException {
        return dialInternal(dialString, videoState, extras);
    }

    @Override
    public Connection
    dial(String dialString, int videoState) throws CallStateException {
        return dialInternal(dialString, videoState);
        return dialInternal(dialString, videoState, null);
    }

    protected Connection dialInternal(String dialString, int videoState)
    protected Connection dialInternal(String dialString, int videoState, Bundle extras)
            throws CallStateException {
        boolean isConferenceUri = false;
        boolean isSkipSchemaParsing = false;
@@ -509,9 +513,9 @@ public class ImsPhone extends ImsPhoneBase {
                "dialing w/ mmi '" + mmi + "'...");

        if (mmi == null) {
            return mCT.dial(dialString, videoState);
            return mCT.dial(dialString, videoState, extras);
        } else if (mmi.isTemporaryModeCLIR()) {
            return mCT.dial(mmi.getDialingNumber(), mmi.getCLIRMode(), videoState);
            return mCT.dial(mmi.getDialingNumber(), mmi.getCLIRMode(), videoState, extras);
        } else if (!mmi.isSupportedOverImsPhone()) {
            // If the mmi is not supported by IMS service,
            // try to initiate dialing with default phone
Loading