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

Commit caa57d47 authored by dhacker29's avatar dhacker29 Committed by Michael Gernoth
Browse files

CdmaLte: Fix 3G reported as unknown on certain devices

Some older CDMA/LTE RILs only report VoiceRadioTechnology which
results in network Unknown. In these cases return
RilVoiceRadioTechnology for RilDataRadioTechnology.

Set ro.telephony.ril.config=usevoicetechfordata to enable

Change-Id: Icfbc8739993beae1b0f024bf71374751aa200a01
parent a56128c8
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ import java.util.List;
public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
    private CDMALTEPhone mCdmaLtePhone;
    private final CellInfoLte mCellInfoLte;
    protected int mNewRilRadioTechnology = 0;
    private static final int EVENT_ALL_DATA_DISCONNECTED = 1001;

    private CellIdentityLte mNewCellIdentityLte = new CellIdentityLte();
@@ -308,6 +309,19 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {

    @Override
    protected void pollStateDone() {
        // Some older CDMA/LTE RILs only report VoiceRadioTechnology which results in network
        // Unknown. In these cases return RilVoiceRadioTechnology for RilDataRadioTechnology.
        boolean oldRil = mCi.needsOldRilFeature("usevoicetechfordata");
        if (mNewSS.getDataRegState() != ServiceState.STATE_IN_SERVICE && oldRil) {
            // LTE out of service, get CDMA Service State
            mNewRilRadioTechnology = mNewSS.getRilVoiceRadioTechnology();
            mNewSS.setDataRegState(radioTechnologyToDataServiceState(mNewRilRadioTechnology));
            mNewSS.setRilDataRadioTechnology(mNewRilRadioTechnology);
            log("pollStateDone CDMA STATE_IN_SERVICE mNewRilRadioTechnology = " +
                    mNewRilRadioTechnology + " mNewSS.getDataRegState() = " +
                    mNewSS.getDataRegState());
        }

        log("pollStateDone: lte 1 ss=[" + mSS + "] newSS=[" + mNewSS + "]");

        useDataRegStateForDataOnlyDevices();