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

Commit c1ccade8 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

QualcommSharedRIL: Fix restoring network mode preference on reboot.

Change-Id Ib9e4bba6da705c127ce1f3aa3c242b9262541cee fixed this in the
master RIL class, and broke the qcom-specific implementation. Fix
it by rescoping the variable.

Change-Id: I70784ee0f8e7b0b74cab8dafdc83610191ba245c
parent 7cd1edc9
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ public class QualcommSharedRIL extends RIL implements CommandsInterface {
    protected IccHandler mIccHandler;
    protected String mAid;
    protected boolean mUSIM = false;
    protected int mSetPreferredNetworkType;
    protected String[] mLastDataIface = new String[20];
    boolean RILJ_LOGV = true;
    boolean RILJ_LOGD = true;
@@ -60,6 +59,7 @@ public class QualcommSharedRIL extends RIL implements CommandsInterface {

    public QualcommSharedRIL(Context context, int networkMode, int cdmaSubscription) {
        super(context, networkMode, cdmaSubscription);
        mSetPreferredNetworkType = -1;
    }

    @Override public void
@@ -334,10 +334,12 @@ public class QualcommSharedRIL extends RIL implements CommandsInterface {
        /**
          * If not using a USIM, ignore LTE mode and go to 3G
          */
        if (!mUSIM && networkType == RILConstants.NETWORK_MODE_LTE_GSM_WCDMA) {
        if (!mUSIM && networkType == RILConstants.NETWORK_MODE_LTE_GSM_WCDMA &&
                 mSetPreferredNetworkType >= RILConstants.NETWORK_MODE_WCDMA_PREF) {
            networkType = RILConstants.NETWORK_MODE_WCDMA_PREF;
        }
        mSetPreferredNetworkType = networkType;

        super.setPreferredNetworkType(networkType, response);
    }

+1 −1
Original line number Diff line number Diff line
@@ -1862,7 +1862,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        if (RILJ_LOGD) riljLog("setCurrentPreferredNetworkType: " + mSetPreferredNetworkType);
        setPreferredNetworkType(mSetPreferredNetworkType, null);
    }
    private int mSetPreferredNetworkType;
    protected int mSetPreferredNetworkType;

    /**
     * {@inheritDoc}