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

Commit 6b3b5b83 authored by Gabriele M's avatar Gabriele M Committed by Gerrit Code Review
Browse files

Send EVENT_NV_READY to GsmCdmaPhone

This will be needed in a follow-up change.

This partially reverts commit 867e0150
("Do not send unnecessary EVENT_NV_READY to GsmCdmaPhone.").

Change-Id: Id4a1ab58a2137573b6f36ef5ae01047f98d38bac
parent 1bcf4b7d
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
@@ -281,7 +281,7 @@ public class GsmCdmaPhone extends Phone {
            tm.setPhoneType(getPhoneId(), PhoneConstants.PHONE_TYPE_GSM);
            mIccCardProxy.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS);
        } else {
            mCdmaSubscriptionSource = mCdmaSSM.getCdmaSubscriptionSource();
            handleCdmaSubscriptionSource(mCdmaSSM.getCdmaSubscriptionSource());
            // This is needed to handle phone process crashes
            String inEcm = SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
            mIsPhoneInEcmState = inEcm.equals("true");
@@ -2014,7 +2014,7 @@ public class GsmCdmaPhone extends Phone {
        mCi.getVoiceRadioTechnology(obtainMessage(EVENT_REQUEST_VOICE_RADIO_TECH_DONE));

        if (!isPhoneTypeGsm()) {
            mCdmaSubscriptionSource = mCdmaSSM.getCdmaSubscriptionSource();
            handleCdmaSubscriptionSource(mCdmaSSM.getCdmaSubscriptionSource());
        }

        // If this is on APM off, SIM may already be loaded. Send setPreferredNetworkType
@@ -2196,7 +2196,7 @@ public class GsmCdmaPhone extends Phone {

            case EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED:
                logd("EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED");
                mCdmaSubscriptionSource = mCdmaSSM.getCdmaSubscriptionSource();
                handleCdmaSubscriptionSource(mCdmaSSM.getCdmaSubscriptionSource());
                break;

            case EVENT_REGISTERED_TO_NETWORK:
@@ -2299,6 +2299,10 @@ public class GsmCdmaPhone extends Phone {
                }
                break;

            case EVENT_NV_READY:
                Rlog.d(LOG_TAG, "Event EVENT_NV_READY Received");
                break;

            case EVENT_SET_VM_NUMBER_DONE:
                ar = (AsyncResult)msg.obj;
                if ((isPhoneTypeGsm() && IccVmNotSupportedException.class.isInstance(ar.exception)) ||
@@ -2503,6 +2507,22 @@ public class GsmCdmaPhone extends Phone {
        }
    }

    //CDMA
    /**
     * Handles the call to get the subscription source
     *
     * @param newSubscriptionSource holds the new CDMA subscription source value
     */
    private void handleCdmaSubscriptionSource(int newSubscriptionSource) {
        if (newSubscriptionSource != mCdmaSubscriptionSource) {
            mCdmaSubscriptionSource = newSubscriptionSource;
            if (newSubscriptionSource == CDMA_SUBSCRIPTION_NV) {
                // NV is ready when subscription source is NV
                sendMessage(obtainMessage(EVENT_NV_READY));
            }
        }
    }

    //CDMA
    /**
     * Sets the "current" field in the telephony provider according to the