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

Commit 910e8047 authored by Ramesh Sudini's avatar Ramesh Sudini Committed by Wink Saville
Browse files

Disconnect ApnContexts in INITING state when error.

When DCT tears down a link due to error, the ApnContexts which are in INITING state are
not torndown. Due to this the DC refCount does not hit 0, and the Data Link is not torndown.

Bug: 4973894
Change-Id: If1263f360d55f6874220235fede294909db4837e
parent 848aa3ab
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -1055,13 +1055,19 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
                    }
                }
                if (!found) {
                    // ApnContext does not have dcan reorted in data call list.
                    // ApnContext does not have dcac reported in data call list.
                    // Fetch all the ApnContexts that map to this dcac which are in
                    // INITING state too.
                    if (DBG) log("onDataStateChanged(ar): Connected apn not found in the list (" +
                                 apnContext.toString() + ")");
                    if (apnContext.getDataConnectionAc() != null) {
                        list.addAll(apnContext.getDataConnectionAc().getApnListSync());
                    } else {
                        list.add(apnContext);
                    }
                }
            }
        }
        return list;
    }

@@ -1110,10 +1116,12 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {

            Collection<ApnContext> apns = dcac.getApnListSync();

            // filter out ApnContext with "Connected" state.
            // filter out ApnContext with "Connected/Connecting" state.
            ArrayList<ApnContext> connectedApns = new ArrayList<ApnContext>();
            for (ApnContext apnContext : apns) {
                if (apnContext.getState() == State.CONNECTED) {
                if (apnContext.getState() == State.CONNECTED ||
                       apnContext.getState() == State.CONNECTING ||
                       apnContext.getState() == State.INITING) {
                    connectedApns.add(apnContext);
                }
            }