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

Commit 59adfca6 authored by Wink Saville's avatar Wink Saville Committed by Android Git Automerger
Browse files

am 33283a97: am dce52cdb: DO NOT MERGE: MDST is not ready until connected to DcTracker.

* commit '33283a97':
  DO NOT MERGE: MDST is not ready until connected to DcTracker.
parents 4e6e1749 33283a97
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -375,6 +375,13 @@ public class MobileDataStateTracker implements NetworkStateTracker {
        return (setEnableApn(mApnType, false) != PhoneConstants.APN_REQUEST_FAILED);
    }

    /**
     * @return true if this is ready to operate
     */
    public boolean isReady() {
        return mDataConnectionTrackerAc != null;
    }

    @Override
    public void captivePortalCheckComplete() {
        // not implemented
+23 −5
Original line number Diff line number Diff line
@@ -3572,6 +3572,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
                         enabled));
    }

    private boolean isMobileDataStateTrackerReady() {
        MobileDataStateTracker mdst =
                (MobileDataStateTracker) mNetTrackers[ConnectivityManager.TYPE_MOBILE];
        return (mdst != null) && (mdst.isReady());
    }

    @Override
    public int checkMobileProvisioning(boolean sendNotification, int suggestedTimeOutMs,
            final ResultReceiver resultReceiver) {
@@ -3739,13 +3745,25 @@ public class ConnectivityService extends IConnectivityManager.Stub {
            }

            try {
                // Continue trying to connect until time has run out
                long endTime = SystemClock.elapsedRealtime() + params.mTimeOutMs;

                if (!mCs.isMobileDataStateTrackerReady()) {
                    // Wait for MobileDataStateTracker to be ready.
                    if (DBG) log("isMobileOk: mdst is not ready");
                    while(SystemClock.elapsedRealtime() < endTime) {
                        if (mCs.isMobileDataStateTrackerReady()) {
                            // Enable fail fast as we'll do retries here and use a
                            // hipri connection so the default connection stays active.
                log("isMobileOk: start hipri url=" + params.mUrl);
                            if (DBG) log("isMobileOk: mdst ready, enable fail fast of mobile data");
                            mCs.setEnableFailFastMobileData(DctConstants.ENABLED);
                            break;
                        }
                        sleep(1);
                    }
                }

                // Continue trying to connect until time has run out
                long endTime = SystemClock.elapsedRealtime() + params.mTimeOutMs;
                log("isMobileOk: start hipri url=" + params.mUrl);

                // First wait until we can start using hipri
                Binder binder = new Binder();