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

Commit 81ea341d authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Get rid of RIL version.

Test: Basic telephony sanity
Bug: 32020264
Change-Id: I61f19621dd86622faecca77c4dadf3ced81e9c21
parent 4db5becf
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -102,8 +102,8 @@ public abstract class BaseCommands implements CommandsInterface {
    protected int mCdmaSubscription;
    // Type of Phone, GSM or CDMA. Set by GsmCdmaPhone.
    protected int mPhoneType;
    // RIL Version
    protected int mRilVersion = -1;
    // RIL connected
    protected boolean mRilConnected = false;

    public BaseCommands(Context context) {
        mContext = context;  // May be null (if so we won't log statistics)
@@ -736,8 +736,8 @@ public abstract class BaseCommands implements CommandsInterface {
    public void registerForRilConnected(Handler h, int what, Object obj) {
        Registrant r = new Registrant (h, what, obj);
        mRilConnectedRegistrants.add(r);
        if (mRilVersion != -1) {
            r.notifyRegistrant(new AsyncResult(null, new Integer(mRilVersion), null));
        if (mRilConnected) {
            r.notifyRegistrant(new AsyncResult(null, null, null));
        }
    }

@@ -836,11 +836,6 @@ public abstract class BaseCommands implements CommandsInterface {
    @Override
    public void testingEmergencyCall() {}

    @Override
    public int getRilVersion() {
        return mRilVersion;
    }

    public void setUiccSubscription(int slotId, int appIndex, int subId, int subStatus,
            Message response) {
    }
+0 −5
Original line number Diff line number Diff line
@@ -1886,11 +1886,6 @@ public interface CommandsInterface {
     */
    void getHardwareConfig (Message result);

    /**
     * @return version of the ril.
     */
    int getRilVersion();

   /**
     * Sets user selected subscription at Modem.
     *
+20 −51
Original line number Diff line number Diff line
@@ -180,7 +180,6 @@ public class GsmCdmaPhone extends Phone {

    private boolean mResetModemOnRadioTechnologyChange = false;

    private int mRilVersion;
    private boolean mBroadcastEmergencyCallStateChanges = false;
    // flag to indicate if emergency call end broadcast should be sent
    boolean mSendEmergencyCallEnd = true;
@@ -257,7 +256,6 @@ public class GsmCdmaPhone extends Phone {
        mResetModemOnRadioTechnologyChange = SystemProperties.getBoolean(
                TelephonyProperties.PROPERTY_RESET_ON_RADIO_TECH_CHANGE, false);

        mCi.registerForRilConnected(this, EVENT_RIL_CONNECTED, null);
        mCi.registerForVoiceRadioTechChanged(this, EVENT_VOICE_RADIO_TECH_CHANGED, null);
        mContext.registerReceiver(mBroadcastReceiver, new IntentFilter(
                CarrierConfigManager.ACTION_CARRIER_CONFIG_CHANGED));
@@ -2067,16 +2065,6 @@ public class GsmCdmaPhone extends Phone {
                handleRadioOn();
                break;

            case EVENT_RIL_CONNECTED:
                ar = (AsyncResult) msg.obj;
                if (ar.exception == null && ar.result != null) {
                    mRilVersion = (Integer) ar.result;
                } else {
                    logd("Unexpected exception on EVENT_RIL_CONNECTED");
                    mRilVersion = -1;
                }
                break;

            case EVENT_VOICE_RADIO_TECH_CHANGED:
            case EVENT_REQUEST_VOICE_RADIO_TECH_DONE:
                String what = (msg.what == EVENT_VOICE_RADIO_TECH_CHANGED) ?
@@ -3061,24 +3049,6 @@ public class GsmCdmaPhone extends Phone {
            }
        }

        if(mRilVersion == 6 && getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE) {
            /*
             * On v6 RIL, when LTE_ON_CDMA is TRUE, always create CDMALTEPhone
             * irrespective of the voice radio tech reported.
             */
            if (getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
                logd("phoneObjectUpdater: LTE ON CDMA property is set. Use CDMA Phone" +
                        " newVoiceRadioTech=" + newVoiceRadioTech +
                        " mActivePhone=" + getPhoneName());
                return;
            } else {
                logd("phoneObjectUpdater: LTE ON CDMA property is set. Switch to CDMALTEPhone" +
                        " newVoiceRadioTech=" + newVoiceRadioTech +
                        " mActivePhone=" + getPhoneName());
                newVoiceRadioTech = ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT;
            }
        } else {

        // If the device is shutting down, then there is no need to switch to the new phone
        // which might send unnecessary attach request to the modem.
        if (isShuttingDown()) {
@@ -3101,7 +3071,6 @@ public class GsmCdmaPhone extends Phone {
                    " doesn't match either CDMA or GSM - error! No phone change");
            return;
        }
        }

        if (newVoiceRadioTech == ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN) {
            // We need some voice phone object to be active always, so never
+0 −1
Original line number Diff line number Diff line
@@ -184,7 +184,6 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    private static final int EVENT_CHECK_FOR_NETWORK_AUTOMATIC      = 38;
    protected static final int EVENT_VOICE_RADIO_TECH_CHANGED       = 39;
    protected static final int EVENT_REQUEST_VOICE_RADIO_TECH_DONE  = 40;
    protected static final int EVENT_RIL_CONNECTED                  = 41;
    protected static final int EVENT_UPDATE_PHONE_OBJECT            = 42;
    protected static final int EVENT_CARRIER_CONFIG_CHANGED         = 43;
    // Carrier's CDMA prefer mode setting
+2 −8
Original line number Diff line number Diff line
@@ -736,9 +736,6 @@ public final class RIL extends BaseCommands implements CommandsInterface {
            }} catch (Throwable tr) {
                Rlog.e(RILJ_LOG_TAG,"Uncaught exception", tr);
            }

            /* We're disconnected so we don't know the ril version */
            notifyRegistrantsRilConnectionChanged(-1);
        }
    }

@@ -4498,14 +4495,11 @@ public final class RIL extends BaseCommands implements CommandsInterface {

    /**
     * Notify all registrants that the ril has connected or disconnected.
     *
     * @param rilVer is the version of the ril or -1 if disconnected.
     */
    void notifyRegistrantsRilConnectionChanged(int rilVer) {
        mRilVersion = rilVer;
    void notifyRegistrantsRilConnected() {
        if (mRilConnectedRegistrants != null) {
            mRilConnectedRegistrants.notifyRegistrants(
                    new AsyncResult(null, new Integer(rilVer), null));
                    new AsyncResult(null, null, null));
        }
    }

Loading