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

Commit 5a7c4a05 authored by Susheel nyamala's avatar Susheel nyamala
Browse files

Deactivate default APN only on network-agent disconnection

For default apn if ConnectivityService has disabled this network,
stop trying to bring it up, but do not tear it down,
ConnectivityService will do that directly by talking with the DataConnection.

Change-Id: I2573616e7c1ebd5c1285aa1cf5d4e58de0341cc8
CRs-Fixed: 782442
parent ed2f7cec
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -2051,7 +2051,21 @@ public final class DcTracker extends DcTrackerBase {
                }
            } else if (met) {
                apnContext.setReason(Phone.REASON_DATA_DISABLED);

                // If ConnectivityService has disabled this network, stop trying to bring
                // it up, but do not tear it down - ConnectivityService will do that
                // directly by talking with the DataConnection.
                //
                // This doesn't apply to DUN, however.  Those connections have special
                // requirements from carriers and we need stop using them when the dun
                // request goes away.  This applies to both CDMA and GSM because they both
                // can declare the DUN APN sharable by default traffic, thus still satisfying
                // those requests and not torn down organically.
                if ((apnContext.getApnType() == PhoneConstants.APN_TYPE_DUN && teardownForDun()) ||
                        (apnContext.getApnType() == PhoneConstants.APN_TYPE_MMS)) {
                    cleanup = true;
                } else {
                    cleanup = false;
                }
            } else {
                apnContext.setReason(Phone.REASON_DATA_DEPENDENCY_UNMET);
            }