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

Commit 20c5ce50 authored by Amit Mahajan's avatar Amit Mahajan Committed by John Huang
Browse files

Handle provisioning APN by turning off/on radio.

The change is specific to AT&T as they want no signaling from device during provisioning.
I've tested following cases:
- expired AT&T SIM to make sure provisioning flow works as expected.
- airplane mode on/off with both active and expired AT&T SIM.
- wifi <-> mobile transitions work okay.
- LTE with Verizon SIM (basic sanity).

bug: 13190133

Change-Id: I215963174ae6000ae71d1dda693f95413f3d6e81
parent 5cde33a6
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -4145,7 +4145,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                                mIsProvisioningNetwork.set(true);
                                MobileDataStateTracker mdst = (MobileDataStateTracker)
                                        mNetTrackers[ConnectivityManager.TYPE_MOBILE];
                                mdst.setInternalDataEnable(false);

                                // Disable radio until user starts provisioning
                                mdst.setRadio(false);
                            } else {
                                if (DBG) log("CheckMp.onComplete: warm (no dns/tcp), no url");
                            }
@@ -4651,17 +4653,24 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        // Mark notification as not visible
        setProvNotificationVisible(false, ConnectivityManager.TYPE_MOBILE_HIPRI, null, null);

        // If provisioning network handle as a special case,
        // Check airplane mode
        boolean isAirplaneModeOn = Settings.System.getInt(mContext.getContentResolver(),
                Settings.Global.AIRPLANE_MODE_ON, 0) == 1;
        // If provisioning network and not in airplane mode handle as a special case,
        // otherwise launch browser with the intent directly.
        if (mIsProvisioningNetwork.get()) {
        if (mIsProvisioningNetwork.get() && !isAirplaneModeOn) {
            if (DBG) log("handleMobileProvisioningAction: on prov network enable then launch");
            mIsProvisioningNetwork.set(false);
            mIsStartingProvisioning.set(true);
            MobileDataStateTracker mdst = (MobileDataStateTracker)
                    mNetTrackers[ConnectivityManager.TYPE_MOBILE];
            // Radio was disabled on CMP_RESULT_CODE_PROVISIONING_NETWORK, enable it here
            mdst.setRadio(true);
            mdst.setEnableFailFastMobileData(DctConstants.ENABLED);
            mdst.enableMobileProvisioning(url);
        } else {
            if (DBG) log("handleMobileProvisioningAction: not prov network, launch browser directly");
            mIsProvisioningNetwork.set(false);
            Intent newIntent = Intent.makeMainSelectorActivity(Intent.ACTION_MAIN,
                    Intent.CATEGORY_APP_BROWSER);
            newIntent.setData(Uri.parse(url));