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

Commit 449cbf85 authored by Wink Saville's avatar Wink Saville
Browse files

if provisioning apn conditionally restart the radio.

Some radios need a swift kick in the butt after provisioning.

Bug: 11673637
Change-Id: Ie758a303fd751d204fd6baa60217e88df6376aae
parent a28a290b
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1810,6 +1810,7 @@ public final class DcTracker extends DcTrackerBase {
        // pending.
        if (isDisconnected()) {
            if (mPhone.getServiceStateTracker().processPendingRadioPowerOffAfterDataOff()) {
                if(DBG) log("onDisconnectDone: radio will be turned off, no retries");
                // Radio will be turned off. No need to retry data setup
                apnContext.setApnSetting(null);
                apnContext.setDataConnectionAc(null);
@@ -1823,12 +1824,23 @@ public final class DcTracker extends DcTrackerBase {
            // Wait a bit before trying the next APN, so that
            // we're not tying up the RIL command channel.
            // This also helps in any external dependency to turn off the context.
            if(DBG) log("onDisconnectDone: attached, ready and retry after disconnect");
            startAlarmForReconnect(getApnDelay(), apnContext);
        } else {
            boolean restartRadioAfterProvisioning = mPhone.getContext().getResources().getBoolean(
                    com.android.internal.R.bool.config_restartRadioAfterProvisioning);

            if (apnContext.isProvisioningApn() && restartRadioAfterProvisioning) {
                log("onDisconnectDone: restartRadio after provisioning");
                restartRadio();
            }
            apnContext.setApnSetting(null);
            apnContext.setDataConnectionAc(null);
            if (isOnlySingleDcAllowed(mPhone.getServiceState().getRilDataRadioTechnology())) {
                if(DBG) log("onDisconnectDone: isOnlySigneDcAllowed true so setup single apn");
                setupDataOnConnectableApns(Phone.REASON_SINGLE_PDN_ARBITRATION);
            } else {
                if(DBG) log("onDisconnectDone: not retrying");
            }
        }
    }