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

Commit 3119b960 authored by Wink Saville's avatar Wink Saville
Browse files

Non-default link should be cleaned up on telephony db change.

Fixed onApnChanged method to handle multiple APN scenario.
Non-default links also needs to be cleaned up once telephony db
is updated.

Bug: 5333303
Change-Id: I6d8d2b4e2f5b07ebf0e22669c910e4ebaddfe392
parent dc1269b5
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1025,10 +1025,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
     * Handles changes to the APN database.
     */
    private void onApnChanged() {
        // TODO: How to handle when multiple APNs are active?

        ApnContext defaultApnContext = mApnContexts.get(Phone.APN_TYPE_DEFAULT);
        boolean defaultApnIsDisconnected = defaultApnContext.isDisconnected();
        State overallState = getOverallState();
        boolean isDisconnected = (overallState == State.IDLE || overallState == State.FAILED);

        if (mPhone instanceof GSMPhone) {
            // The "current" may no longer be valid.  MMS depends on this to send properly. TBD
@@ -1039,8 +1037,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
        // match the current operator.
        if (DBG) log("onApnChanged: createAllApnList and cleanUpAllConnections");
        createAllApnList();
        cleanUpAllConnections(!defaultApnIsDisconnected, Phone.REASON_APN_CHANGED);
        if (defaultApnIsDisconnected) {
        cleanUpAllConnections(!isDisconnected, Phone.REASON_APN_CHANGED);
        if (isDisconnected) {
            setupDataOnReadyApns(Phone.REASON_APN_CHANGED);
        }
    }