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

Commit 4750c8c1 authored by Wink Saville's avatar Wink Saville
Browse files

Fix TODO in ApnContext#setDataConnectionAc.

Callers that really need to tearDown should call it directly
rather than as a side effect of setDataConnectionAc. The fixes
a "DcActiveState ERROR no such apnContext=" message caused by
an unnecssary tearDown when disconnecting.

Change-Id: I11321d098444659d99dec97b59041cefebb3285e
parent 1f8e6cac
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -87,11 +87,6 @@ public class ApnContext {
            log("setDataConnectionAc: old dcac=" + mDcAc + " new dcac=" + dcac
                    + " this=" + this);
        }
        if ((dcac == null) && (mDcAc != null)) {
            // TODO: This tearDown should be done by caller, but for now we'll do it
            if (DBG) log("setDataConnection: call tearDown");
            mDcAc.tearDown(this, "", null);
        }
        mDcAc = dcac;
    }

+3 −0
Original line number Diff line number Diff line
@@ -745,6 +745,9 @@ public final class DcTracker extends DcTrackerBase {
                // If apnContext is not enabled anymore, break the linkage to the DCAC/DC.
                apnContext.setState(DctConstants.State.IDLE);
                if (!apnContext.isReady()) {
                    if (dcac != null) {
                        dcac.tearDown(apnContext, "", null);
                    }
                    apnContext.setDataConnectionAc(null);
                }
            } else {
+4 −0
Original line number Diff line number Diff line
@@ -428,6 +428,10 @@ public abstract class DcTrackerBase extends Handler {
                if (DBG) {
                    log("onActionIntentReconnectAlarm: state is FAILED|IDLE, disassociate");
                }
                DcAsyncChannel dcac = apnContext.getDcAc();
                if (dcac != null) {
                    dcac.tearDown(apnContext, "", null);
                }
                apnContext.setDataConnectionAc(null);
                apnContext.setState(DctConstants.State.IDLE);
            } else {