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

Commit 867e0150 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Do not send unnecessary EVENT_NV_READY to GsmCdmaPhone.

Also changing default CDMA subscription source from NV to RUIM.

Bug: 28639524
Change-Id: I778af7f43f1907f8fcfe5d3a1110fe2fa1fc29b3
parent 54dd4016
Loading
Loading
Loading
Loading
+2 −18
Original line number Diff line number Diff line
@@ -1949,7 +1949,7 @@ public class GsmCdmaPhone extends Phone {
        mCi.getVoiceRadioTechnology(obtainMessage(EVENT_REQUEST_VOICE_RADIO_TECH_DONE));

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

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

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

            case EVENT_REGISTERED_TO_NETWORK:
@@ -2391,22 +2391,6 @@ 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
+1 −3
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ public class CdmaSubscriptionSourceManager extends Handler {
    public static final int SUBSCRIPTION_SOURCE_UNKNOWN = -1;
    public static final int SUBSCRIPTION_FROM_RUIM      = 0; /* CDMA subscription from RUIM */
    public static final int SUBSCRIPTION_FROM_NV        = 1; /* CDMA subscription from NV */
    public static final int PREFERRED_CDMA_SUBSCRIPTION = SUBSCRIPTION_FROM_NV;
    public static final int PREFERRED_CDMA_SUBSCRIPTION = SUBSCRIPTION_FROM_RUIM;

    private static CdmaSubscriptionSourceManager sInstance;
    private static final Object sReferenceCountMonitor = new Object();
@@ -52,7 +52,6 @@ public class CdmaSubscriptionSourceManager extends Handler {

    // ***** Instance Variables
    private CommandsInterface mCi;
    private Context mContext;
    private RegistrantList mCdmaSubscriptionSourceChangedRegistrants = new RegistrantList();

    // Type of CDMA subscription source
@@ -60,7 +59,6 @@ public class CdmaSubscriptionSourceManager extends Handler {

    // Constructor
    private CdmaSubscriptionSourceManager(Context context, CommandsInterface ci) {
        mContext = context;
        mCi = ci;
        mCi.registerForCdmaSubscriptionChanged(this, EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED, null);
        mCi.registerForOn(this, EVENT_RADIO_ON, null);