FileDocCategorySizeDatePackage
CDMAPhone.javaAPI DocAndroid 5.1 API64844Thu Mar 12 22:22:54 GMT 2015com.android.internal.telephony.cdma

CDMAPhone

public class CDMAPhone extends com.android.internal.telephony.PhoneBase
{@hide}

Fields Summary
static final String
LOG_TAG
private static final boolean
DBG
private static final boolean
VDBG
private static final int
DEFAULT_ECM_EXIT_TIMER_VALUE
private static final String
VM_NUMBER_CDMA
private String
mVmNumber
static final int
RESTART_ECM_TIMER
static final int
CANCEL_ECM_TIMER
CdmaCallTracker
mCT
CdmaServiceStateTracker
mSST
CdmaSubscriptionSourceManager
mCdmaSSM
ArrayList
mPendingMmis
RuimPhoneBookInterfaceManager
mRuimPhoneBookInterfaceManager
int
mCdmaSubscriptionSource
com.android.internal.telephony.PhoneSubInfo
mSubInfo
EriManager
mEriManager
android.os.PowerManager.WakeLock
mWakeLock
private final android.os.RegistrantList
mEriFileLoadedRegistrants
private final android.os.RegistrantList
mEcmTimerResetRegistrants
protected boolean
mIsPhoneInEcmState
private android.os.Registrant
mEcmExitRespRegistrant
protected String
mImei
protected String
mImeiSv
private String
mEsn
private String
mMeid
protected String
mCarrierOtaSpNumSchema
private Runnable
mExitEcmRunnable
android.os.Registrant
mPostDialHandler
static String
PROPERTY_CDMA_HOME_OPERATOR_NUMERIC
private static final String
IS683A_FEATURE_CODE
private static final int
IS683A_FEATURE_CODE_NUM_DIGITS
private static final int
IS683A_SYS_SEL_CODE_NUM_DIGITS
private static final int
IS683A_SYS_SEL_CODE_OFFSET
private static final int
IS683_CONST_800MHZ_A_BAND
private static final int
IS683_CONST_800MHZ_B_BAND
private static final int
IS683_CONST_1900MHZ_A_BLOCK
private static final int
IS683_CONST_1900MHZ_B_BLOCK
private static final int
IS683_CONST_1900MHZ_C_BLOCK
private static final int
IS683_CONST_1900MHZ_D_BLOCK
private static final int
IS683_CONST_1900MHZ_E_BLOCK
private static final int
IS683_CONST_1900MHZ_F_BLOCK
private static final int
INVALID_SYSTEM_SELECTION_CODE
private static Pattern
pOtaSpNumSchema
Constructors Summary
public CDMAPhone(android.content.Context context, com.android.internal.telephony.CommandsInterface ci, com.android.internal.telephony.PhoneNotifier notifier, int phoneId)


          
              
        super("CDMA", notifier, context, ci, false, phoneId);
        initSstIcc();
        init(context, notifier);
    
Methods Summary
public voidacceptCall(int videoState)

        ImsPhone imsPhone = mImsPhone;
        if ( imsPhone != null && imsPhone.getRingingCall().isRinging() ) {
            imsPhone.acceptCall(videoState);
        } else {
            mCT.acceptCall();
        }
    
public voidactivateCellBroadcastSms(int activate, android.os.Message response)
Activate or deactivate cell broadcast SMS.

param
activate 0 = activate, 1 = deactivate
param
response Callback message is empty on completion

        Rlog.e(LOG_TAG, "[CDMAPhone] activateCellBroadcastSms() is obsolete; use SmsManager");
        response.sendToTarget();
    
public booleancanConference()

        if (mImsPhone != null && mImsPhone.canConference()) {
            return true;
        }
        Rlog.e(LOG_TAG, "canConference: not possible in CDMA");
        return false;
    
public booleancanTransfer()

        Rlog.e(LOG_TAG, "canTransfer: not possible in CDMA");
        return false;
    
private static booleancheckOtaSpNumBasedOnSysSelCode(int sysSelCodeInt, java.lang.String[] sch)
This function checks if the system selection code extracted from the dial string "sysSelCodeInt' is the system selection code specified in the carrier ota sp number schema "sch".

        boolean isOtaSpNum = false;
        try {
            // Get how many number of system selection code ranges
            int selRc = Integer.parseInt(sch[1]);
            for (int i = 0; i < selRc; i++) {
                if (!TextUtils.isEmpty(sch[i+2]) && !TextUtils.isEmpty(sch[i+3])) {
                    int selMin = Integer.parseInt(sch[i+2]);
                    int selMax = Integer.parseInt(sch[i+3]);
                    // Check if the selection code extracted from the dial string falls
                    // within any of the range pairs specified in the schema.
                    if ((sysSelCodeInt >= selMin) && (sysSelCodeInt <= selMax)) {
                        isOtaSpNum = true;
                        break;
                    }
                }
            }
        } catch (NumberFormatException ex) {
            // If the carrier ota sp number schema is not correct, we still allow dial
            // and only log the error:
            Rlog.e(LOG_TAG, "checkOtaSpNumBasedOnSysSelCode, error", ex);
        }
        return isOtaSpNum;
    
public voidclearDisconnected()

        mCT.clearDisconnected();
    
public voidconference()

        if (mImsPhone != null && mImsPhone.canConference()) {
            log("conference() - delegated to IMS phone");
            mImsPhone.conference();
            return;
        }
        // three way calls in CDMA will be handled by feature codes
        Rlog.e(LOG_TAG, "conference: not possible in CDMA");
    
public com.android.internal.telephony.Connectiondial(java.lang.String dialString, int videoState)

        ImsPhone imsPhone = mImsPhone;

        boolean imsUseEnabled =
                ImsManager.isVolteEnabledByPlatform(mContext) &&
                ImsManager.isEnhanced4gLteModeSettingEnabledByUser(mContext) &&
                ImsManager.isNonTtyOrTtyOnVolteEnabled(mContext);
        if (!imsUseEnabled) {
            Rlog.w(LOG_TAG, "IMS is disabled: forced to CS");
        }

        if (DBG) {
            Rlog.d(LOG_TAG, "imsUseEnabled=" + imsUseEnabled + ", imsPhone=" + imsPhone
                    + ", imsPhone.isVolteEnabled()="
                    + ((imsPhone != null) ? imsPhone.isVolteEnabled() : "N/A")
                    + ", imsPhone.getServiceState().getState()="
                    + ((imsPhone != null) ? imsPhone.getServiceState().getState() : "N/A"));
        }

        if (imsUseEnabled && imsPhone != null && imsPhone.isVolteEnabled()
                && ((imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE
                && !PhoneNumberUtils.isEmergencyNumber(dialString))
                || (PhoneNumberUtils.isEmergencyNumber(dialString)
                && mContext.getResources().getBoolean(
                        com.android.internal.R.bool.useImsAlwaysForEmergencyCall))) ) {
            try {
                if (DBG) Rlog.d(LOG_TAG, "Trying IMS PS call");
                return imsPhone.dial(dialString, videoState);
            } catch (CallStateException e) {
                if (DBG) Rlog.d(LOG_TAG, "IMS PS call exception " + e +
                        "imsUseEnabled =" + imsUseEnabled + ", imsPhone =" + imsPhone);
                if (!ImsPhone.CS_FALLBACK.equals(e.getMessage())) {
                    CallStateException ce = new CallStateException(e.getMessage());
                    ce.setStackTrace(e.getStackTrace());
                    throw ce;
                }
            }
        }

        if (DBG) Rlog.d(LOG_TAG, "Trying (non-IMS) CS call");
        return dialInternal(dialString, null, videoState);
    
public com.android.internal.telephony.Connectiondial(java.lang.String dialString, com.android.internal.telephony.UUSInfo uusInfo, int videoState)

        throw new CallStateException("Sending UUS information NOT supported in CDMA!");
    
protected com.android.internal.telephony.ConnectiondialInternal(java.lang.String dialString, com.android.internal.telephony.UUSInfo uusInfo, int videoState)

        // Need to make sure dialString gets parsed properly
        String newDialString = PhoneNumberUtils.stripSeparators(dialString);
        return mCT.dial(newDialString);
    
public voiddisableLocationUpdates()

        mSST.disableLocationUpdates();
    
public voiddispose()

        synchronized(PhoneProxy.lockForRadioTechnologyChange) {
            super.dispose();
            log("dispose");

            //Unregister from all former registered events
            unregisterForRuimRecordEvents();
            mCi.unregisterForAvailable(this); //EVENT_RADIO_AVAILABLE
            mCi.unregisterForOffOrNotAvailable(this); //EVENT_RADIO_OFF_OR_NOT_AVAILABLE
            mCi.unregisterForOn(this); //EVENT_RADIO_ON
            mSST.unregisterForNetworkAttached(this); //EVENT_REGISTERED_TO_NETWORK
            mCi.unSetOnSuppServiceNotification(this);
            mCi.unregisterForExitEmergencyCallbackMode(this);
            removeCallbacks(mExitEcmRunnable);

            mPendingMmis.clear();

            //Force all referenced classes to unregister their former registered events
            mCT.dispose();
            mDcTracker.dispose();
            mSST.dispose();
            mCdmaSSM.dispose(this);
            mRuimPhoneBookInterfaceManager.dispose();
            mSubInfo.dispose();
            mEriManager.dispose();
        }
    
public voiddump(java.io.FileDescriptor fd, java.io.PrintWriter pw, java.lang.String[] args)

        pw.println("CDMAPhone extends:");
        super.dump(fd, pw, args);
        pw.println(" mVmNumber=" + mVmNumber);
        pw.println(" mCT=" + mCT);
        pw.println(" mSST=" + mSST);
        pw.println(" mCdmaSSM=" + mCdmaSSM);
        pw.println(" mPendingMmis=" + mPendingMmis);
        pw.println(" mRuimPhoneBookInterfaceManager=" + mRuimPhoneBookInterfaceManager);
        pw.println(" mCdmaSubscriptionSource=" + mCdmaSubscriptionSource);
        pw.println(" mSubInfo=" + mSubInfo);
        pw.println(" mEriManager=" + mEriManager);
        pw.println(" mWakeLock=" + mWakeLock);
        pw.println(" mIsPhoneInEcmState=" + mIsPhoneInEcmState);
        if (VDBG) pw.println(" mImei=" + mImei);
        if (VDBG) pw.println(" mImeiSv=" + mImeiSv);
        if (VDBG) pw.println(" mEsn=" + mEsn);
        if (VDBG) pw.println(" mMeid=" + mMeid);
        pw.println(" mCarrierOtaSpNumSchema=" + mCarrierOtaSpNumSchema);
        pw.println(" getCdmaEriIconIndex()=" + getCdmaEriIconIndex());
        pw.println(" getCdmaEriIconMode()=" + getCdmaEriIconMode());
        pw.println(" getCdmaEriText()=" + getCdmaEriText());
        pw.println(" isMinInfoReady()=" + isMinInfoReady());
        pw.println(" isCspPlmnEnabled()=" + isCspPlmnEnabled());
    
public voidenableEnhancedVoicePrivacy(boolean enable, android.os.Message onComplete)

        mCi.setPreferredVoicePrivacy(enable, onComplete);
    
public voidenableLocationUpdates()

        mSST.enableLocationUpdates();
    
public voidexitEmergencyCallbackMode()

        if (mWakeLock.isHeld()) {
            mWakeLock.release();
        }
        // Send a message which will invoke handleExitEmergencyCallbackMode
        mCi.exitEmergencyCallbackMode(obtainMessage(EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE));
    
public voidexplicitCallTransfer()

        Rlog.e(LOG_TAG, "explicitCallTransfer: not possible in CDMA");
    
private static intextractSelCodeFromOtaSpNum(java.lang.String dialStr)
This function extracts the system selection code from the dial string.

        int dialStrLen = dialStr.length();
        int sysSelCodeInt = INVALID_SYSTEM_SELECTION_CODE;

        if ((dialStr.regionMatches(0, IS683A_FEATURE_CODE,
                                   0, IS683A_FEATURE_CODE_NUM_DIGITS)) &&
            (dialStrLen >= (IS683A_FEATURE_CODE_NUM_DIGITS +
                            IS683A_SYS_SEL_CODE_NUM_DIGITS))) {
                // Since we checked the condition above, the system selection code
                // extracted from dialStr will not cause any exception
                sysSelCodeInt = Integer.parseInt (
                                dialStr.substring (IS683A_FEATURE_CODE_NUM_DIGITS,
                                IS683A_FEATURE_CODE_NUM_DIGITS + IS683A_SYS_SEL_CODE_NUM_DIGITS));
        }
        if (DBG) Rlog.d(LOG_TAG, "extractSelCodeFromOtaSpNum " + sysSelCodeInt);
        return sysSelCodeInt;
    
protected voidfinalize()

        if(DBG) Rlog.d(LOG_TAG, "CDMAPhone finalized");
        if (mWakeLock.isHeld()) {
            Rlog.e(LOG_TAG, "UNEXPECTED; mWakeLock is held when finalizing.");
            mWakeLock.release();
        }
    
public voidgetAvailableNetworks(android.os.Message response)

        Rlog.e(LOG_TAG, "getAvailableNetworks: not possible in CDMA");
    
public CdmaCallgetBackgroundCall()

        return mCT.mBackgroundCall;
    
public booleangetCallForwardingIndicator()

        Rlog.e(LOG_TAG, "getCallForwardingIndicator: not possible in CDMA");
        return false;
    
public voidgetCallForwardingOption(int commandInterfaceCFReason, android.os.Message onComplete)

        Rlog.e(LOG_TAG, "getCallForwardingOption: not possible in CDMA");
    
public com.android.internal.telephony.CallTrackergetCallTracker()

        return mCT;
    
public voidgetCallWaiting(android.os.Message onComplete)

        mCi.queryCallWaiting(CommandsInterface.SERVICE_CLASS_VOICE, onComplete);
    
public intgetCdmaEriIconIndex()

        return getServiceState().getCdmaEriIconIndex();
    
public intgetCdmaEriIconMode()
Returns the CDMA ERI icon mode, 0 - ON 1 - FLASHING

        return getServiceState().getCdmaEriIconMode();
    
public java.lang.StringgetCdmaEriText()
Returns the CDMA ERI text,

        int roamInd = getServiceState().getCdmaRoamingIndicator();
        int defRoamInd = getServiceState().getCdmaDefaultRoamingIndicator();
        return mEriManager.getCdmaEriText(roamInd, defRoamInd);
    
public java.lang.StringgetCdmaMin()

        return mSST.getCdmaMin();
    
public java.lang.StringgetCdmaPrlVersion()

        return mSST.getPrlVersion();
    
public voidgetCellBroadcastSmsConfig(android.os.Message response)
Query the current configuration of cdma cell broadcast SMS.

param
response Callback message is empty on completion

        Rlog.e(LOG_TAG, "[CDMAPhone] getCellBroadcastSmsConfig() is obsolete; use SmsManager");
        response.sendToTarget();
    
public android.telephony.CellLocationgetCellLocation()

        CdmaCellLocation loc = mSST.mCellLoc;

        int mode = Settings.Secure.getInt(getContext().getContentResolver(),
                Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
        if (mode == Settings.Secure.LOCATION_MODE_OFF) {
            // clear lat/long values for location privacy
            CdmaCellLocation privateLoc = new CdmaCellLocation();
            privateLoc.setCellLocationData(loc.getBaseStationId(),
                    CdmaCellLocation.INVALID_LAT_LONG,
                    CdmaCellLocation.INVALID_LAT_LONG,
                    loc.getSystemId(), loc.getNetworkId());
            loc = privateLoc;
        }
        return loc;
    
public DataActivityStategetDataActivityState()

        DataActivityState ret = DataActivityState.NONE;

        if (mSST.getCurrentDataConnectionState() == ServiceState.STATE_IN_SERVICE) {

            switch (mDcTracker.getActivity()) {
                case DATAIN:
                    ret = DataActivityState.DATAIN;
                break;

                case DATAOUT:
                    ret = DataActivityState.DATAOUT;
                break;

                case DATAINANDOUT:
                    ret = DataActivityState.DATAINANDOUT;
                break;

                case DORMANT:
                    ret = DataActivityState.DORMANT;
                break;

                default:
                    ret = DataActivityState.NONE;
                break;
            }
        }
        return ret;
    
public voidgetDataCallList(android.os.Message response)

        mCi.getDataCallList(response);
    
public PhoneConstants.DataStategetDataConnectionState(java.lang.String apnType)

        PhoneConstants.DataState ret = PhoneConstants.DataState.DISCONNECTED;

        if (mSST == null) {
             // Radio Technology Change is ongoning, dispose() and removeReferences() have
             // already been called

             ret = PhoneConstants.DataState.DISCONNECTED;
        } else if (mSST.getCurrentDataConnectionState() != ServiceState.STATE_IN_SERVICE) {
            // If we're out of service, open TCP sockets may still work
            // but no data will flow
            ret = PhoneConstants.DataState.DISCONNECTED;
        } else if (mDcTracker.isApnTypeEnabled(apnType) == false ||
                mDcTracker.isApnTypeActive(apnType) == false) {
            ret = PhoneConstants.DataState.DISCONNECTED;
        } else {
            switch (mDcTracker.getState(apnType)) {
                case RETRYING:
                case FAILED:
                case IDLE:
                    ret = PhoneConstants.DataState.DISCONNECTED;
                break;

                case CONNECTED:
                case DISCONNECTING:
                    if ( mCT.mState != PhoneConstants.State.IDLE
                            && !mSST.isConcurrentVoiceAndDataAllowed()) {
                        ret = PhoneConstants.DataState.SUSPENDED;
                    } else {
                        ret = PhoneConstants.DataState.CONNECTED;
                    }
                break;

                case CONNECTING:
                case SCANNING:
                    ret = PhoneConstants.DataState.CONNECTING;
                break;
            }
        }

        log("getDataConnectionState apnType=" + apnType + " ret=" + ret);
        return ret;
    
public booleangetDataEnabled()

        return mDcTracker.getDataEnabled();
    
public booleangetDataRoamingEnabled()

        return mDcTracker.getDataOnRoamingEnabled();
    
public java.lang.StringgetDeviceId()

        String id = getMeid();
        if ((id == null) || id.matches("^0*$")) {
            Rlog.d(LOG_TAG, "getDeviceId(): MEID is not initialized use ESN");
            id = getEsn();
        }
        return id;
    
public java.lang.StringgetDeviceSvn()

        Rlog.d(LOG_TAG, "getDeviceSvn(): return 0");
        return "0";
    
public voidgetEnhancedVoicePrivacy(android.os.Message onComplete)

        mCi.getPreferredVoicePrivacy(onComplete);
    
public java.lang.StringgetEsn()

        return mEsn;
    
public CdmaCallgetForegroundCall()

        return mCT.mForegroundCall;
    
public java.lang.StringgetGroupIdLevel1()

        Rlog.e(LOG_TAG, "GID1 is not available in CDMA");
        return null;
    
public com.android.internal.telephony.IccPhoneBookInterfaceManagergetIccPhoneBookInterfaceManager()
Retrieves the IccPhoneBookInterfaceManager of the CDMAPhone

        return mRuimPhoneBookInterfaceManager;
    
public java.lang.StringgetIccSerialNumber()

        IccRecords r = mIccRecords.get();
        if (r == null) {
            // to get ICCID form SIMRecords because it is on MF.
            r = mUiccController.getIccRecords(mPhoneId, UiccController.APP_FAM_3GPP);
        }
        return (r != null) ? r.getIccId() : null;
    
public java.lang.StringgetImei()

        Rlog.e(LOG_TAG, "getImei() called for CDMAPhone");
        return mImei;
    
public java.lang.StringgetLine1AlphaTag()

        Rlog.e(LOG_TAG, "getLine1AlphaTag: not possible in CDMA");
        return null;
    
public java.lang.StringgetLine1Number()

        return mSST.getMdnNumber();
    
public java.lang.StringgetMeid()

        return mMeid;
    
public booleangetMute()

        return mCT.getMute();
    
public java.lang.StringgetNai()

        IccRecords r = mIccRecords.get();
        if (Log.isLoggable(LOG_TAG, Log.VERBOSE)) {
            Rlog.v(LOG_TAG, "IccRecords is " + r);
        }
        return (r != null) ? r.getNAI() : null;
    
public voidgetNeighboringCids(android.os.Message response)

        /*
         * This is currently not implemented.  At least as of June
         * 2009, there is no neighbor cell information available for
         * CDMA because some party is resisting making this
         * information readily available.  Consequently, calling this
         * function can have no useful effect.  This situation may
         * (and hopefully will) change in the future.
         */
        if (response != null) {
            CommandException ce = new CommandException(
                    CommandException.Error.REQUEST_NOT_SUPPORTED);
            AsyncResult.forMessage(response).exception = ce;
            response.sendToTarget();
        }
    
public voidgetOutgoingCallerIdDisplay(android.os.Message onComplete)

        Rlog.e(LOG_TAG, "getOutgoingCallerIdDisplay: not possible in CDMA");
    
public java.util.ListgetPendingMmiCodes()

        return mPendingMmis;
    
public com.android.internal.telephony.PhoneSubInfogetPhoneSubInfo()
Retrieves the PhoneSubInfo of the CDMAPhone

        return mSubInfo;
    
public intgetPhoneType()

        return PhoneConstants.PHONE_TYPE_CDMA;
    
public com.android.internal.telephony.CallgetRingingCall()

        ImsPhone imPhone = mImsPhone;
        if ( mCT.mRingingCall != null && mCT.mRingingCall.isRinging() ) {
            return mCT.mRingingCall;
        } else if ( imPhone != null ) {
            return imPhone.getRingingCall();
        }
        return mCT.mRingingCall;
    
public android.telephony.ServiceStategetServiceState()

        if (mSST == null || mSST.mSS.getState() != ServiceState.STATE_IN_SERVICE) {
            if (mImsPhone != null) {
                return ServiceState.mergeServiceStates(
                        (mSST == null) ? new ServiceState() : mSST.mSS,
                        mImsPhone.getServiceState());
            }
        }

        if (mSST != null) {
            return mSST.mSS;
        } else {
            // avoid potential NPE in EmergencyCallHelper during Phone switch
            return new ServiceState();
        }
    
public com.android.internal.telephony.ServiceStateTrackergetServiceStateTracker()

        return mSST;
    
public PhoneConstants.StategetState()

        if (mImsPhone != null) {
            PhoneConstants.State imsState = mImsPhone.getState();
            if (imsState != PhoneConstants.State.IDLE) {
                return imsState;
            }
        }

        return mCT.mState;
    
public java.lang.StringgetSubscriberId()

        return mSST.getImsi();
    
public java.lang.StringgetSystemProperty(java.lang.String property, java.lang.String defValue)
{@inheritDoc}

        return super.getSystemProperty(property, defValue);
    
protected com.android.internal.telephony.uicc.UiccCardApplicationgetUiccCardApplication()

        return  mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP2);
    
public java.lang.StringgetVoiceMailAlphaTag()

        // TODO: Where can we get this value has to be clarified with QC.
        String ret = "";//TODO: Remove = "", if we know where to get this value.

        //ret = mSIMRecords.getVoiceMailAlphaTag();

        if (ret == null || ret.length() == 0) {
            return mContext.getText(
                com.android.internal.R.string.defaultVoiceMailAlphaTag).toString();
        }

        return ret;
    
public java.lang.StringgetVoiceMailNumber()

        String number = null;
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());
        number = sp.getString(VM_NUMBER_CDMA + getPhoneId(), null);
        if (TextUtils.isEmpty(number)) {
            String[] listArray = getContext().getResources()
                .getStringArray(com.android.internal.R.array.config_default_vm_number);
            if (listArray != null && listArray.length > 0) {
                for (int i=0; i<listArray.length; i++) {
                    if (!TextUtils.isEmpty(listArray[i])) {
                        String[] defaultVMNumberArray = listArray[i].split(";");
                        if (defaultVMNumberArray != null && defaultVMNumberArray.length > 0) {
                            if (defaultVMNumberArray.length == 1) {
                                number = defaultVMNumberArray[0];
                            } else if (defaultVMNumberArray.length == 2 &&
                                    !TextUtils.isEmpty(defaultVMNumberArray[1]) &&
                                    defaultVMNumberArray[1].equalsIgnoreCase(getGroupIdLevel1())) {
                                number = defaultVMNumberArray[0];
                                break;
                            }
                        }
                    }
                }
            }
        }
        if (TextUtils.isEmpty(number)) {
            // Read platform settings for dynamic voicemail number
            if (getContext().getResources().getBoolean(com.android.internal
                    .R.bool.config_telephony_use_own_number_for_voicemail)) {
                number = getLine1Number();
            } else {
                number = "*86";
            }
        }
        return number;
    
private voidhandleCdmaSubscriptionSource(int newSubscriptionSource)
Handles the call to get the subscription source

param
newSubscriptionSource holds the new CDMA subscription source value

        if (newSubscriptionSource != mCdmaSubscriptionSource) {
             mCdmaSubscriptionSource = newSubscriptionSource;
             if (newSubscriptionSource == CDMA_SUBSCRIPTION_NV) {
                 // NV is ready when subscription source is NV
                 sendMessage(obtainMessage(EVENT_NV_READY));
             }
        }
    
private voidhandleEnterEmergencyCallbackMode(android.os.Message msg)

        if (DBG) {
            Rlog.d(LOG_TAG, "handleEnterEmergencyCallbackMode,mIsPhoneInEcmState= "
                    + mIsPhoneInEcmState);
        }
        // if phone is not in Ecm mode, and it's changed to Ecm mode
        if (mIsPhoneInEcmState == false) {
            mIsPhoneInEcmState = true;
            // notify change
            sendEmergencyCallbackModeChange();
            setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "true");

            // Post this runnable so we will automatically exit
            // if no one invokes exitEmergencyCallbackMode() directly.
            long delayInMillis = SystemProperties.getLong(
                    TelephonyProperties.PROPERTY_ECM_EXIT_TIMER, DEFAULT_ECM_EXIT_TIMER_VALUE);
            postDelayed(mExitEcmRunnable, delayInMillis);
            // We don't want to go to sleep while in Ecm
            mWakeLock.acquire();
        }
    
private voidhandleExitEmergencyCallbackMode(android.os.Message msg)

        AsyncResult ar = (AsyncResult)msg.obj;
        if (DBG) {
            Rlog.d(LOG_TAG, "handleExitEmergencyCallbackMode,ar.exception , mIsPhoneInEcmState "
                    + ar.exception + mIsPhoneInEcmState);
        }
        // Remove pending exit Ecm runnable, if any
        removeCallbacks(mExitEcmRunnable);

        if (mEcmExitRespRegistrant != null) {
            mEcmExitRespRegistrant.notifyRegistrant(ar);
        }
        // if exiting ecm success
        if (ar.exception == null) {
            if (mIsPhoneInEcmState) {
                mIsPhoneInEcmState = false;
                setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "false");
            }
            // send an Intent
            sendEmergencyCallbackModeChange();
            // Re-initiate data connection
            mDcTracker.setInternalDataEnabled(true);
        }
    
public booleanhandleInCallMmiCommands(java.lang.String dialString)

        Rlog.e(LOG_TAG, "method handleInCallMmiCommands is NOT supported in CDMA!");
        return false;
    
public voidhandleMessage(android.os.Message msg)

        AsyncResult ar;
        Message     onComplete;

        // messages to be handled whether or not the phone is being destroyed
        // should only include messages which are being re-directed and do not use
        // resources of the phone being destroyed
        switch (msg.what) {
            // handle the select network completion callbacks.
            case EVENT_SET_NETWORK_MANUAL_COMPLETE:
            case EVENT_SET_NETWORK_AUTOMATIC_COMPLETE:
                super.handleMessage(msg);
                return;
        }

        if (!mIsTheCurrentActivePhone) {
            Rlog.e(LOG_TAG, "Received message " + msg +
                    "[" + msg.what + "] while being destroyed. Ignoring.");
            return;
        }
        switch(msg.what) {
            case EVENT_RADIO_AVAILABLE: {
                mCi.getBasebandVersion(obtainMessage(EVENT_GET_BASEBAND_VERSION_DONE));

                mCi.getDeviceIdentity(obtainMessage(EVENT_GET_DEVICE_IDENTITY_DONE));
                mCi.getRadioCapability(obtainMessage(EVENT_GET_RADIO_CAPABILITY));
            }
            break;

            case EVENT_GET_BASEBAND_VERSION_DONE:{
                ar = (AsyncResult)msg.obj;

                if (ar.exception != null) {
                    break;
                }

                if (DBG) Rlog.d(LOG_TAG, "Baseband version: " + ar.result);
                TelephonyManager.from(mContext).setBasebandVersionForPhone(getPhoneId(),
                        (String)ar.result);
            }
            break;

            case EVENT_GET_DEVICE_IDENTITY_DONE:{
                ar = (AsyncResult)msg.obj;

                if (ar.exception != null) {
                    break;
                }
                String[] respId = (String[])ar.result;
                mImei = respId[0];
                mImeiSv = respId[1];
                mEsn  =  respId[2];
                mMeid =  respId[3];
            }
            break;

            case EVENT_EMERGENCY_CALLBACK_MODE_ENTER:{
                handleEnterEmergencyCallbackMode(msg);
            }
            break;

            case  EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE:{
                handleExitEmergencyCallbackMode(msg);
            }
            break;

            case EVENT_RUIM_RECORDS_LOADED:{
                Rlog.d(LOG_TAG, "Event EVENT_RUIM_RECORDS_LOADED Received");
                updateCurrentCarrierInProvider();
                // Notify voicemails.
                log("notifyMessageWaitingChanged");
                mNotifier.notifyMessageWaitingChanged(this);
                updateVoiceMail();
            }
            break;

            case EVENT_RADIO_OFF_OR_NOT_AVAILABLE:{
                Rlog.d(LOG_TAG, "Event EVENT_RADIO_OFF_OR_NOT_AVAILABLE Received");
                ImsPhone imsPhone = mImsPhone;
                if (imsPhone != null) {
                    imsPhone.getServiceState().setStateOff();
                }
            }
            break;

            case EVENT_RADIO_ON:{
                Rlog.d(LOG_TAG, "Event EVENT_RADIO_ON Received");
                handleCdmaSubscriptionSource(mCdmaSSM.getCdmaSubscriptionSource());
            }
            break;

            case EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED:{
                Rlog.d(LOG_TAG, "EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED");
                handleCdmaSubscriptionSource(mCdmaSSM.getCdmaSubscriptionSource());
            }
            break;

            case EVENT_SSN:{
                Rlog.d(LOG_TAG, "Event EVENT_SSN Received");
            }
            break;

            case EVENT_REGISTERED_TO_NETWORK:{
                Rlog.d(LOG_TAG, "Event EVENT_REGISTERED_TO_NETWORK Received");
            }
            break;

            case EVENT_NV_READY:{
                Rlog.d(LOG_TAG, "Event EVENT_NV_READY Received");
                prepareEri();
                // Notify voicemails.
                log("notifyMessageWaitingChanged");
                mNotifier.notifyMessageWaitingChanged(this);
                updateVoiceMail();
            }
            break;

            case EVENT_SET_VM_NUMBER_DONE:{
                ar = (AsyncResult)msg.obj;
                if (IccException.class.isInstance(ar.exception)) {
                    storeVoiceMailNumber(mVmNumber);
                    ar.exception = null;
                }
                onComplete = (Message) ar.userObj;
                if (onComplete != null) {
                    AsyncResult.forMessage(onComplete, ar.result, ar.exception);
                    onComplete.sendToTarget();
                }
            }
            break;

            default:{
                super.handleMessage(msg);
            }
        }
    
public booleanhandlePinMmi(java.lang.String dialString)

        CdmaMmiCode mmi = CdmaMmiCode.newFromDialString(dialString, this, mUiccApplication.get());

        if (mmi == null) {
            Rlog.e(LOG_TAG, "Mmi is NULL!");
            return false;
        } else if (mmi.isPinPukCommand()) {
            mPendingMmis.add(mmi);
            mMmiRegistrants.notifyRegistrants(new AsyncResult(null, mmi, null));
            mmi.processCode();
            return true;
        }
        Rlog.e(LOG_TAG, "Unrecognized mmi!");
        return false;
    
voidhandleTimerInEmergencyCallbackMode(int action)
Handle to cancel or restart Ecm timer in emergency call back mode if action is CANCEL_ECM_TIMER, cancel Ecm timer and notify apps the timer is canceled; otherwise, restart Ecm timer and notify apps the timer is restarted.

        switch(action) {
        case CANCEL_ECM_TIMER:
            removeCallbacks(mExitEcmRunnable);
            mEcmTimerResetRegistrants.notifyResult(Boolean.TRUE);
            break;
        case RESTART_ECM_TIMER:
            long delayInMillis = SystemProperties.getLong(
                    TelephonyProperties.PROPERTY_ECM_EXIT_TIMER, DEFAULT_ECM_EXIT_TIMER_VALUE);
            postDelayed(mExitEcmRunnable, delayInMillis);
            mEcmTimerResetRegistrants.notifyResult(Boolean.FALSE);
            break;
        default:
            Rlog.e(LOG_TAG, "handleTimerInEmergencyCallbackMode, unsupported action " + action);
        }
    
protected voidinit(android.content.Context context, com.android.internal.telephony.PhoneNotifier notifier)

        mCi.setPhoneType(PhoneConstants.PHONE_TYPE_CDMA);
        mCT = new CdmaCallTracker(this);
        mCdmaSSM = CdmaSubscriptionSourceManager.getInstance(context, mCi, this,
                EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED, null);
        mDcTracker = new DcTracker(this);
        mRuimPhoneBookInterfaceManager = new RuimPhoneBookInterfaceManager(this);
        mSubInfo = new PhoneSubInfo(this);
        mEriManager = new EriManager(this, context, EriManager.ERI_FROM_XML);

        mCi.registerForAvailable(this, EVENT_RADIO_AVAILABLE, null);
        mCi.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
        mCi.registerForOn(this, EVENT_RADIO_ON, null);
        mCi.setOnSuppServiceNotification(this, EVENT_SSN, null);
        mSST.registerForNetworkAttached(this, EVENT_REGISTERED_TO_NETWORK, null);
        mCi.setEmergencyCallbackMode(this, EVENT_EMERGENCY_CALLBACK_MODE_ENTER, null);
        mCi.registerForExitEmergencyCallbackMode(this, EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE,
                null);

        PowerManager pm
            = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,LOG_TAG);

        TelephonyManager tm = TelephonyManager.from(mContext);
        //Change the system setting
        tm.setPhoneType(getPhoneId(), PhoneConstants.PHONE_TYPE_CDMA);

        // This is needed to handle phone process crashes
        String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
        mIsPhoneInEcmState = inEcm.equals("true");
        if (mIsPhoneInEcmState) {
            // Send a message which will invoke handleExitEmergencyCallbackMode
            mCi.exitEmergencyCallbackMode(obtainMessage(EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE));
        }

        // get the string that specifies the carrier OTA Sp number
        mCarrierOtaSpNumSchema = tm.getOtaSpNumberSchemaForPhone(getPhoneId(), "");

        // Sets operator properties by retrieving from build-time system property
        String operatorAlpha = SystemProperties.get("ro.cdma.home.operator.alpha");
        String operatorNumeric = SystemProperties.get(PROPERTY_CDMA_HOME_OPERATOR_NUMERIC);
        log("init: operatorAlpha='" + operatorAlpha
                + "' operatorNumeric='" + operatorNumeric + "'");
        if (mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP) == null) {
            log("init: APP_FAM_3GPP == NULL");
            if (!TextUtils.isEmpty(operatorAlpha)) {
                log("init: set 'gsm.sim.operator.alpha' to operator='" + operatorAlpha + "'");
                tm.setSimOperatorNameForPhone(mPhoneId, operatorAlpha);
            }
            if (!TextUtils.isEmpty(operatorNumeric)) {
                log("init: set 'gsm.sim.operator.numeric' to operator='" + operatorNumeric + "'");
                log("update icc_operator_numeric=" + operatorNumeric);
                tm.setSimOperatorNumericForPhone(mPhoneId, operatorNumeric);

                SubscriptionController.getInstance().setMccMnc(operatorNumeric, getSubId());
            }
            setIsoCountryProperty(operatorNumeric);
        }

        // Sets current entry in the telephony carrier table
        updateCurrentCarrierInProvider(operatorNumeric);
    
protected voidinitSstIcc()

        mSST = new CdmaServiceStateTracker(this);
    
private booleanisCarrierOtaSpNum(java.lang.String dialStr)
The following function checks if a dial string is a carrier specified OTASP number or not by checking against the OTASP number schema stored in PROPERTY_OTASP_NUM_SCHEMA. Currently, there are 2 schemas for carriers to specify the OTASP number: 1) Use system selection code: The schema is: SELC,the # of code pairs,min1,max1,min2,max2,... e.g "SELC,3,10,20,30,40,60,70" indicates that there are 3 pairs of selection codes, and they are {10,20}, {30,40} and {60,70} respectively. 2) Use feature code: The schema is: "FC,length of feature code,feature code". e.g "FC,2,*2" indicates that the length of the feature code is 2, and the code itself is "*2".


                                                                                                                                       
        
        boolean isOtaSpNum = false;
        int sysSelCodeInt = extractSelCodeFromOtaSpNum(dialStr);
        if (sysSelCodeInt == INVALID_SYSTEM_SELECTION_CODE) {
            return isOtaSpNum;
        }
        // mCarrierOtaSpNumSchema is retrieved from PROPERTY_OTASP_NUM_SCHEMA:
        if (!TextUtils.isEmpty(mCarrierOtaSpNumSchema)) {
            Matcher m = pOtaSpNumSchema.matcher(mCarrierOtaSpNumSchema);
            if (DBG) {
                Rlog.d(LOG_TAG, "isCarrierOtaSpNum,schema" + mCarrierOtaSpNumSchema);
            }

            if (m.find()) {
                String sch[] = pOtaSpNumSchema.split(mCarrierOtaSpNumSchema);
                // If carrier uses system selection code mechanism
                if (!TextUtils.isEmpty(sch[0]) && sch[0].equals("SELC")) {
                    if (sysSelCodeInt!=INVALID_SYSTEM_SELECTION_CODE) {
                        isOtaSpNum=checkOtaSpNumBasedOnSysSelCode(sysSelCodeInt,sch);
                    } else {
                        if (DBG) {
                            Rlog.d(LOG_TAG, "isCarrierOtaSpNum,sysSelCodeInt is invalid");
                        }
                    }
                } else if (!TextUtils.isEmpty(sch[0]) && sch[0].equals("FC")) {
                    int fcLen =  Integer.parseInt(sch[1]);
                    String fc = sch[2];
                    if (dialStr.regionMatches(0,fc,0,fcLen)) {
                        isOtaSpNum = true;
                    } else {
                        if (DBG) Rlog.d(LOG_TAG, "isCarrierOtaSpNum,not otasp number");
                    }
                } else {
                    if (DBG) {
                        Rlog.d(LOG_TAG, "isCarrierOtaSpNum,ota schema not supported" + sch[0]);
                    }
                }
            } else {
                if (DBG) {
                    Rlog.d(LOG_TAG, "isCarrierOtaSpNum,ota schema pattern not right" +
                          mCarrierOtaSpNumSchema);
                }
            }
        } else {
            if (DBG) Rlog.d(LOG_TAG, "isCarrierOtaSpNum,ota schema pattern empty");
        }
        return isOtaSpNum;
    
public booleanisEriFileLoaded()

        return mEriManager.isEriFileLoaded();
    
booleanisInCall()

        CdmaCall.State foregroundCallState = getForegroundCall().getState();
        CdmaCall.State backgroundCallState = getBackgroundCall().getState();
        CdmaCall.State ringingCallState = getRingingCall().getState();

        return (foregroundCallState.isAlive() || backgroundCallState.isAlive() || ringingCallState
                .isAlive());
    
public booleanisInEcm()

        return mIsPhoneInEcmState;
    
public booleanisInEmergencyCall()

        return mCT.isInEmergencyCall();
    
private static booleanisIs683OtaSpDialStr(java.lang.String dialStr)


         
        int sysSelCodeInt;
        boolean isOtaspDialString = false;
        int dialStrLen = dialStr.length();

        if (dialStrLen == IS683A_FEATURE_CODE_NUM_DIGITS) {
            if (dialStr.equals(IS683A_FEATURE_CODE)) {
                isOtaspDialString = true;
            }
        } else {
            sysSelCodeInt = extractSelCodeFromOtaSpNum(dialStr);
            switch (sysSelCodeInt) {
                case IS683_CONST_800MHZ_A_BAND:
                case IS683_CONST_800MHZ_B_BAND:
                case IS683_CONST_1900MHZ_A_BLOCK:
                case IS683_CONST_1900MHZ_B_BLOCK:
                case IS683_CONST_1900MHZ_C_BLOCK:
                case IS683_CONST_1900MHZ_D_BLOCK:
                case IS683_CONST_1900MHZ_E_BLOCK:
                case IS683_CONST_1900MHZ_F_BLOCK:
                    isOtaspDialString = true;
                    break;
                default:
                    break;
            }
        }
        return isOtaspDialString;
    
public booleanisMinInfoReady()

        return mSST.isMinInfoReady();
    
public booleanisOtaSpNumber(java.lang.String dialStr)
isOTASPNumber: checks a given number against the IS-683A OTASP dial string and carrier OTASP dial string.

param
dialStr the number to look up.
return
true if the number is in IS-683A OTASP dial string or carrier OTASP dial string

        boolean isOtaSpNum = false;
        String dialableStr = PhoneNumberUtils.extractNetworkPortionAlt(dialStr);
        if (dialableStr != null) {
            isOtaSpNum = isIs683OtaSpDialStr(dialableStr);
            if (isOtaSpNum == false) {
                isOtaSpNum = isCarrierOtaSpNum(dialableStr);
            }
        }
        if (DBG) Rlog.d(LOG_TAG, "isOtaSpNumber " + isOtaSpNum);
        return isOtaSpNum;
    
protected voidlog(java.lang.String s)

        if (DBG)
            Rlog.d(LOG_TAG, s);
    
protected voidloge(java.lang.String s, java.lang.Exception e)

        if (DBG)
            Rlog.e(LOG_TAG, s, e);
    
public booleanneedsOtaServiceProvisioning()
Returns true if OTA Service Provisioning needs to be performed.

        return mSST.getOtasp() != ServiceStateTracker.OTASP_NOT_NEEDED;
    
voidnotifyDisconnect(com.android.internal.telephony.Connection cn)

        mDisconnectRegistrants.notifyResult(cn);

        mNotifier.notifyDisconnectCause(cn.getDisconnectCause(), cn.getPreciseDisconnectCause());
    
public voidnotifyEcbmTimerReset(java.lang.Boolean flag)

        mEcmTimerResetRegistrants.notifyResult(flag);
    
voidnotifyLocationChanged()

         mNotifier.notifyCellLocation(this);
     
public voidnotifyNewRingingConnection(com.android.internal.telephony.Connection c)

        super.notifyNewRingingConnectionP(c);
    
voidnotifyPhoneStateChanged()
Notify any interested party of a Phone state change {@link com.android.internal.telephony.PhoneConstants.State}

        mNotifier.notifyPhoneState(this);
    
voidnotifyPreciseCallStateChanged()
Notify registrants of a change in the call state. This notifies changes in {@link com.android.internal.telephony.Call.State}. Use this when changes in the precise call state are needed, else use notifyPhoneStateChanged.

        /* we'd love it if this was package-scoped*/
        super.notifyPreciseCallStateChangedP();
    
voidnotifyServiceStateChanged(android.telephony.ServiceState ss)

         super.notifyServiceStateChangedP(ss);
     
voidnotifyUnknownConnection(com.android.internal.telephony.Connection connection)

        mUnknownConnectionRegistrants.notifyResult(connection);
    
voidonMMIDone(CdmaMmiCode mmi)
Removes the given MMI from the pending list and notifies registrants that it is complete.

param
mmi MMI that is done

        /*
         * Only notify complete if it's on the pending list. Otherwise, it's
         * already been handled (eg, previously canceled).
         */
        if (mPendingMmis.remove(mmi)) {
            mMmiCompleteRegistrants.notifyRegistrants(new AsyncResult(null, mmi, null));
        }
    
protected voidonUpdateIccAvailability()

        if (mUiccController == null ) {
            return;
        }

        UiccCardApplication newUiccApplication = getUiccCardApplication();

        if (newUiccApplication == null) {
            log("can't find 3GPP2 application; trying APP_FAM_3GPP");
            newUiccApplication =
                    mUiccController.getUiccCardApplication(mPhoneId, UiccController.APP_FAM_3GPP);
        }

        UiccCardApplication app = mUiccApplication.get();
        if (app != newUiccApplication) {
            if (app != null) {
                log("Removing stale icc objects.");
                if (mIccRecords.get() != null) {
                    unregisterForRuimRecordEvents();
                }
                mIccRecords.set(null);
                mUiccApplication.set(null);
            }
            if (newUiccApplication != null) {
                log("New Uicc application found");
                mUiccApplication.set(newUiccApplication);
                mIccRecords.set(newUiccApplication.getIccRecords());
                registerForRuimRecordEvents();
            }
        }
    
public voidprepareEri()

        if (mEriManager == null) {
            Rlog.e(LOG_TAG, "PrepareEri: Trying to access stale objects");
            return;
        }
        mEriManager.loadEriFile();
        if(mEriManager.isEriFileLoaded()) {
            // when the ERI file is loaded
            log("ERI read, notify registrants");
            mEriFileLoadedRegistrants.notifyRegistrants();
        }
    
public voidregisterForCallWaiting(android.os.Handler h, int what, java.lang.Object obj)

        mCT.registerForCallWaiting(h, what, obj);
    
public voidregisterForCdmaOtaStatusChange(android.os.Handler h, int what, java.lang.Object obj)

        mCi.registerForCdmaOtaProvision(h, what, obj);
    
public voidregisterForEcmTimerReset(android.os.Handler h, int what, java.lang.Object obj)
Registration point for Ecm timer reset

param
h handler to notify
param
what User-defined message code
param
obj placed in Message.obj

        mEcmTimerResetRegistrants.addUnique(h, what, obj);
    
public voidregisterForEriFileLoaded(android.os.Handler h, int what, java.lang.Object obj)

        Registrant r = new Registrant (h, what, obj);
        mEriFileLoadedRegistrants.add(r);
    
protected voidregisterForRuimRecordEvents()

        IccRecords r = mIccRecords.get();
        if (r == null) {
            return;
        }
        r.registerForRecordsLoaded(this, EVENT_RUIM_RECORDS_LOADED, null);
    
public voidregisterForSubscriptionInfoReady(android.os.Handler h, int what, java.lang.Object obj)

        mSST.registerForSubscriptionInfoReady(h, what, obj);
    
public voidregisterForSuppServiceNotification(android.os.Handler h, int what, java.lang.Object obj)

        Rlog.e(LOG_TAG, "method registerForSuppServiceNotification is NOT supported in CDMA!");
    
public voidrejectCall()

        mCT.rejectCall();
    
public voidremoveReferences()

        log("removeReferences");
        mRuimPhoneBookInterfaceManager = null;
        mSubInfo = null;
        mCT = null;
        mSST = null;
        mEriManager = null;
        mExitEcmRunnable = null;

        super.removeReferences();
    
public voidsendBurstDtmf(java.lang.String dtmfString, int on, int off, android.os.Message onComplete)

        boolean check = true;
        for (int itr = 0;itr < dtmfString.length(); itr++) {
            if (!PhoneNumberUtils.is12Key(dtmfString.charAt(itr))) {
                Rlog.e(LOG_TAG,
                        "sendDtmf called with invalid character '" + dtmfString.charAt(itr)+ "'");
                check = false;
                break;
            }
        }
        if ((mCT.mState ==  PhoneConstants.State.OFFHOOK)&&(check)) {
            mCi.sendBurstDtmf(dtmfString, on, off, onComplete);
        }
     
public voidsendDtmf(char c)

        if (!PhoneNumberUtils.is12Key(c)) {
            Rlog.e(LOG_TAG,
                    "sendDtmf called with invalid character '" + c + "'");
        } else {
            if (mCT.mState ==  PhoneConstants.State.OFFHOOK) {
                mCi.sendDtmf(c, null);
            }
        }
    
voidsendEmergencyCallbackModeChange()

        //Send an Intent
        Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
        intent.putExtra(PhoneConstants.PHONE_IN_ECM_STATE, mIsPhoneInEcmState);
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, getPhoneId());
        ActivityManagerNative.broadcastStickyIntent(intent,null,UserHandle.USER_ALL);
        if (DBG) Rlog.d(LOG_TAG, "sendEmergencyCallbackModeChange");
    
public voidsendUssdResponse(java.lang.String ussdMessge)

        Rlog.e(LOG_TAG, "sendUssdResponse: not possible in CDMA");
    
public voidsetCallForwardingOption(int commandInterfaceCFAction, int commandInterfaceCFReason, java.lang.String dialingNumber, int timerSeconds, android.os.Message onComplete)

        Rlog.e(LOG_TAG, "setCallForwardingOption: not possible in CDMA");
    
public voidsetCallWaiting(boolean enable, android.os.Message onComplete)

        Rlog.e(LOG_TAG, "method setCallWaiting is NOT supported in CDMA!");
    
public voidsetCellBroadcastSmsConfig(int[] configValuesArray, android.os.Message response)
Configure cdma cell broadcast SMS.

param
response Callback message is empty on completion

        Rlog.e(LOG_TAG, "[CDMAPhone] setCellBroadcastSmsConfig() is obsolete; use SmsManager");
        response.sendToTarget();
    
public voidsetDataEnabled(boolean enable)

        mDcTracker.setDataEnabled(enable);
    
public voidsetDataRoamingEnabled(boolean enable)

        mDcTracker.setDataOnRoamingEnabled(enable);
    
protected voidsetIsoCountryProperty(java.lang.String operatorNumeric)
Sets PROPERTY_ICC_OPERATOR_ISO_COUNTRY property

        TelephonyManager tm = TelephonyManager.from(mContext);
        if (TextUtils.isEmpty(operatorNumeric)) {
            log("setIsoCountryProperty: clear 'gsm.sim.operator.iso-country'");
            tm.setSimCountryIsoForPhone(mPhoneId, "");
        } else {
            String iso = "";
            try {
                iso = MccTable.countryCodeForMcc(Integer.parseInt(
                        operatorNumeric.substring(0,3)));
            } catch (NumberFormatException ex) {
                loge("setIsoCountryProperty: countryCodeForMcc error", ex);
            } catch (StringIndexOutOfBoundsException ex) {
                loge("setIsoCountryProperty: countryCodeForMcc error", ex);
            }

            log("setIsoCountryProperty: set 'gsm.sim.operator.iso-country' to iso=" + iso);
            tm.setSimCountryIsoForPhone(mPhoneId, iso);
        }
    
public booleansetLine1Number(java.lang.String alphaTag, java.lang.String number, android.os.Message onComplete)

        Rlog.e(LOG_TAG, "setLine1Number: not possible in CDMA");
        return false;
    
public voidsetMute(boolean muted)

        mCT.setMute(muted);
    
public voidsetOnEcbModeExitResponse(android.os.Handler h, int what, java.lang.Object obj)

        mEcmExitRespRegistrant = new Registrant (h, what, obj);
    
public voidsetOnPostDialCharacter(android.os.Handler h, int what, java.lang.Object obj)

        mPostDialHandler = new Registrant(h, what, obj);
    
public booleansetOperatorBrandOverride(java.lang.String brand)

        if (mUiccController == null) {
            return false;
        }

        UiccCard card = mUiccController.getUiccCard(getPhoneId());
        if (card == null) {
            return false;
        }

        boolean status = card.setOperatorBrandOverride(brand);

        // Refresh.
        if (status) {
            IccRecords iccRecords = mIccRecords.get();
            if (iccRecords != null) {
                TelephonyManager.from(mContext).setSimOperatorNameForPhone(
                        mPhoneId, iccRecords.getServiceProviderName());
            }
            if (mSST != null) {
                mSST.pollState();
            }
        }
        return status;
    
public voidsetOutgoingCallerIdDisplay(int commandInterfaceCLIRMode, android.os.Message onComplete)

        Rlog.e(LOG_TAG, "setOutgoingCallerIdDisplay: not possible in CDMA");
    
public voidsetRadioPower(boolean power)

        mSST.setRadioPower(power);
    
public voidsetSystemProperty(java.lang.String property, java.lang.String value)
{@inheritDoc}

        super.setSystemProperty(property, value);
    
public voidsetUiTTYMode(int uiTtyMode, android.os.Message onComplete)

       if (mImsPhone != null) {
           mImsPhone.setUiTTYMode(uiTtyMode, onComplete);
       }
    
public voidsetVoiceMailNumber(java.lang.String alphaTag, java.lang.String voiceMailNumber, android.os.Message onComplete)

        Message resp;
        mVmNumber = voiceMailNumber;
        resp = obtainMessage(EVENT_SET_VM_NUMBER_DONE, 0, 0, onComplete);
        IccRecords r = mIccRecords.get();
        if (r != null) {
            r.setVoiceMailNumber(alphaTag, mVmNumber, resp);
        }
    
public voidsetVoiceMessageWaiting(int line, int countWaiting)
Sets the SIM voice message count

param
line Subscriber Profile Number, one-based. Only '1' is supported
param
countWaiting The number of messages waiting, if known. Use -1 to indicate that an unknown number of messages are waiting This is a wrapper function for setVoiceMessageCount

        setVoiceMessageCount(countWaiting);
    
public voidstartDtmf(char c)

        if (!PhoneNumberUtils.is12Key(c)) {
            Rlog.e(LOG_TAG,
                    "startDtmf called with invalid character '" + c + "'");
        } else {
            mCi.startDtmf(c, null);
        }
    
public voidstopDtmf()

        mCi.stopDtmf(null);
    
private voidstoreVoiceMailNumber(java.lang.String number)
Store the voicemail number in preferences

        // Update the preference value of voicemail number
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getContext());
        SharedPreferences.Editor editor = sp.edit();
        editor.putString(VM_NUMBER_CDMA + getPhoneId(), number);
        editor.apply();
    
public voidswitchHoldingAndActive()

        mCT.switchWaitingOrHoldingAndActive();
    
public voidunregisterForCallWaiting(android.os.Handler h)

        mCT.unregisterForCallWaiting(h);
    
public voidunregisterForCdmaOtaStatusChange(android.os.Handler h)

        mCi.unregisterForCdmaOtaProvision(h);
    
public voidunregisterForEcmTimerReset(android.os.Handler h)

        mEcmTimerResetRegistrants.remove(h);
    
public voidunregisterForEriFileLoaded(android.os.Handler h)

        mEriFileLoadedRegistrants.remove(h);
    
protected voidunregisterForRuimRecordEvents()

        IccRecords r = mIccRecords.get();
        if (r == null) {
            return;
        }
        r.unregisterForRecordsLoaded(this);
    
public voidunregisterForSubscriptionInfoReady(android.os.Handler h)

        mSST.unregisterForSubscriptionInfoReady(h);
    
public voidunregisterForSuppServiceNotification(android.os.Handler h)

        Rlog.e(LOG_TAG, "method unregisterForSuppServiceNotification is NOT supported in CDMA!");
    
public voidunsetOnEcbModeExitResponse(android.os.Handler h)

        mEcmExitRespRegistrant.clear();
    
booleanupdateCurrentCarrierInProvider(java.lang.String operatorNumeric)
Sets the "current" field in the telephony provider according to the build-time operator numeric property

return
true for success; false otherwise.

        log("CDMAPhone: updateCurrentCarrierInProvider called");
        if (!TextUtils.isEmpty(operatorNumeric)) {
            try {
                Uri uri = Uri.withAppendedPath(Telephony.Carriers.CONTENT_URI, "current");
                ContentValues map = new ContentValues();
                map.put(Telephony.Carriers.NUMERIC, operatorNumeric);
                log("updateCurrentCarrierInProvider from system: numeric=" + operatorNumeric);
                getContext().getContentResolver().insert(uri, map);

                // Updates MCC MNC device configuration information
                log("update mccmnc=" + operatorNumeric);
                MccTable.updateMccMncConfiguration(mContext, operatorNumeric, false);

                return true;
            } catch (SQLException e) {
                Rlog.e(LOG_TAG, "Can't store current operator", e);
            }
        }
        return false;
    
booleanupdateCurrentCarrierInProvider()
Sets the "current" field in the telephony provider according to the SIM's operator. Implemented in {@link CDMALTEPhone} for CDMA/LTE devices.

return
true for success; false otherwise.

        return true;
    
public voidupdateServiceLocation()

        mSST.enableSingleLocationUpdate();
    
private voidupdateVoiceMail()

        setVoiceMessageCount(getStoredVoiceMessageCount());