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

Commit 59a05216 authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android Git Automerger
Browse files

am 9cbd33d7: Merge "Fix connect during retry." into mnc-dr-dev

* commit '9cbd33d7':
  Fix connect during retry.
parents f7d65829 9cbd33d7
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1045,9 +1045,10 @@ public final class DataConnection extends StateMachine {
        mConnectionParams = cp;
        mConnectionParams.mTag = mTag;

        if (!mApnContexts.containsKey(apnContext)) {
        // always update the ConnectionParams with the latest or the
        // connectionGeneration gets stale
        mApnContexts.put(apnContext, cp);
        }

        configureRetry(mApnSetting.canHandleType(PhoneConstants.APN_TYPE_DEFAULT));
        mRetryManager.setRetryCount(0);
        mRetryManager.setCurMaxRetryCount(mConnectionParams.mInitialMaxRetry);
+16 −8
Original line number Diff line number Diff line
@@ -1044,12 +1044,13 @@ public final class DcTracker extends DcTrackerBase {
                                disconnectAll = true;
                            }
                        }
                        str = "cleanUpConnection: tearing down" + (disconnectAll ? " all" : "");
                        final int generation = apnContext.getConnectionGeneration();
                        str = "cleanUpConnection: tearing down" + (disconnectAll ? " all" : "") +
                                " using gen#" + generation;
                        if (DBG) log(str + "apnContext=" + apnContext);
                        apnContext.requestLog(str);
                        Pair<ApnContext, Integer> pair =
                                new Pair<ApnContext, Integer>(apnContext,
                                apnContext.getConnectionGeneration());
                                new Pair<ApnContext, Integer>(apnContext, generation);
                        Message msg = obtainMessage(DctConstants.EVENT_DISCONNECT_DONE, pair);
                        if (disconnectAll) {
                            apnContext.getDcAc().tearDownAll(apnContext.getReason(), msg);
@@ -1307,19 +1308,21 @@ public final class DcTracker extends DcTrackerBase {
                return false;
            }
        }
        if (DBG) log("setupData: dcac=" + dcac + " apnSetting=" + apnSetting);
        final int generation = apnContext.incAndGetConnectionGeneration();
        if (DBG) {
            log("setupData: dcac=" + dcac + " apnSetting=" + apnSetting + " gen#=" + generation);
        }

        apnContext.setDataConnectionAc(dcac);
        apnContext.setApnSetting(apnSetting);
        int connectionGeneration = apnContext.incAndGetConnectionGeneration();
        apnContext.setState(DctConstants.State.CONNECTING);
        mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());

        Message msg = obtainMessage();
        msg.what = DctConstants.EVENT_DATA_SETUP_COMPLETE;
        msg.obj = new Pair<ApnContext, Integer>(apnContext, connectionGeneration);
        msg.obj = new Pair<ApnContext, Integer>(apnContext, generation);
        dcac.bringUp(apnContext, getInitialMaxRetry(), profileId, radioTech,
                mAutoAttachOnCreation.get(), msg, connectionGeneration);
                mAutoAttachOnCreation.get(), msg, generation);

        if (DBG) log("setupData: initing!");
        return true;
@@ -2015,7 +2018,12 @@ public final class DcTracker extends DcTrackerBase {
            Pair<ApnContext, Integer>pair = (Pair<ApnContext, Integer>)ar.userObj;
            ApnContext apnContext = pair.first;
            if (apnContext != null) {
                if (apnContext.getConnectionGeneration() == pair.second) {
                final int generation = apnContext.getConnectionGeneration();
                if (DBG) {
                    log("getValidApnContext (" + logString + ") on " + apnContext + " got " +
                            generation + " vs " + pair.second);
                }
                if (generation == pair.second) {
                    return apnContext;
                } else {
                    log("ignoring obsolete " + logString);