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

Commit 7d64fae5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Proper handling of roaming override case"

parents eef3bbab 2dc3018f
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2055,14 +2055,16 @@ public class ServiceStateTracker extends Handler {
             * agreements and MVNO's.
             */
            boolean roaming = (mGsmRoaming || mDataRoaming);

            // Save the data roaming state reported by modem registration before resource overlay or
            // carrier config possibly overrides it.
            mNewSS.setDataRoamingFromRegistration(roaming);

            if (mGsmRoaming && !isOperatorConsideredRoaming(mNewSS) &&
                    (isSameNamedOperators(mNewSS) || isOperatorConsideredNonRoaming(mNewSS))) {
                roaming = false;
            }

            // Save the roaming state before carrier config possibly overrides it.
            mNewSS.setDataRoamingFromRegistration(roaming);

            CarrierConfigManager configLoader = (CarrierConfigManager)
                    mPhone.getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);

+12 −3
Original line number Diff line number Diff line
@@ -467,9 +467,18 @@ public class DataConnection extends StateMachine {

        DataProfile dp = new DataProfile(mApnSetting, cp.mProfileId);

        mPhone.mCi.setupDataCall(cp.mRilRat, dp,
                mPhone.getServiceState().getDataRoamingFromRegistration(),
                mPhone.getDataRoamingEnabled(), msg);
        // We need to use the actual modem roaming state instead of the framework roaming state
        // here. This flag is only passed down to ril_service for picking the correct protocol (for
        // old modem backward compatibility).
        boolean isModemRoaming = mPhone.getServiceState().getDataRoamingFromRegistration();

        // Set this flag to true if the user turns on data roaming. Or if we override the roaming
        // state in framework, we should set this flag to true as well so the modem will not reject
        // the data call setup (because the modem actually thinks the device is roaming).
        boolean allowRoaming = mPhone.getDataRoamingEnabled()
                || (isModemRoaming && !mPhone.getServiceState().getDataRoaming());

        mPhone.mCi.setupDataCall(cp.mRilRat, dp, isModemRoaming, allowRoaming, msg);
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -2115,7 +2115,7 @@ public class DcTracker extends Handler {
            if (DBG) log("setInitialAttachApn: X selected Apn=" + initialAttachApnSetting);

            mPhone.mCi.setInitialAttachApn(new DataProfile(initialAttachApnSetting),
                    mPhone.getServiceState().getDataRoaming(), null);
                    mPhone.getServiceState().getDataRoamingFromRegistration(), null);
        }
    }

@@ -3324,7 +3324,7 @@ public class DcTracker extends Handler {
            }
            if (dps.size() > 0) {
                mPhone.mCi.setDataProfile(dps.toArray(new DataProfile[0]),
                        mPhone.getServiceState().getDataRoaming(), null);
                        mPhone.getServiceState().getDataRoamingFromRegistration(), null);
            }
        }
    }