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

Commit 9db48844 authored by Sukanya Rajkhowa's avatar Sukanya Rajkhowa Committed by Jack Yu
Browse files

Cleanup connections for APNs that are not connected

- After a network is disabled via releaseNetwork, ConnectivityService
  tears down the data connection
- However, for APNs that are in Connecting, Failed or Retry state,
  ConnectivityService will not do that because the NetworkAgent
  is created only when a DataConnection goes into Active State. As
  a result, even if the client release the network request, the
  corresponding data connection is not torn down
- Take care of this case by explicitly tearing down the data connection

Test: Telephony sanity tests. QC tested with MMS app.
bug: 34756779
Change-Id: I87f286cb8b5fe5c6a33e8c5cf53da7bca8d7aa2b
parent b40f09bc
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2507,7 +2507,12 @@ public class DcTracker extends Handler {
                // 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()) {
                if ((apnContext.getApnType() == PhoneConstants.APN_TYPE_DUN && teardownForDun())
                        || apnContext.getState() != DctConstants.State.CONNECTED) {
                    str = "Clean up the connection. Apn type = " + apnContext.getApnType()
                            + ", state = " + apnContext.getState();
                    if (DBG) log(str);
                    apnContext.requestLog(str);
                    cleanup = true;
                } else {
                    cleanup = false;