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

Commit 0a42edd8 authored by Daniel Bright's avatar Daniel Bright Committed by Automerger Merge Worker
Browse files

Always allow unmetered APNs when romaing am: f8462eb1

Change-Id: I8d97aca7d81e411e89bccc8519a7c29c94fb8fde
parents 198de875 f8462eb1
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -712,11 +712,26 @@ public class DataConnection extends StateMachine {
        // old modem backward compatibility).
        boolean isModemRoaming = mPhone.getServiceState().getDataRoamingFromRegistration();

        // If the apn is NOT metered, we will allow data roaming regardless of the setting.
        boolean isUnmeteredApnType = !ApnSettingUtils.isMeteredApnType(
                cp.mApnContext.getApnTypeBitmask(), mPhone);

        // 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());
                || (isModemRoaming && (!mPhone.getServiceState().getDataRoaming()
                || isUnmeteredApnType));

        if (DBG) {
            log("allowRoaming=" + allowRoaming
                    + ", mPhone.getDataRoamingEnabled()=" + mPhone.getDataRoamingEnabled()
                    + ", isModemRoaming=" + isModemRoaming
                    + ", mPhone.getServiceState().getDataRoaming()="
                    + mPhone.getServiceState().getDataRoaming()
                    + ", isUnmeteredApnType=" + isUnmeteredApnType
            );
        }

        // Check if this data setup is a handover.
        LinkProperties linkProperties = null;