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

Commit 2e34e488 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

DcTracker: wait for default apn to disconnect before setting up new

Including the removal of a previous attempt to fix this issue:

Revert "Frameworks : Make sure a reply is sent when not provisioning default apn"

This reverts commit 8733a2d2.

Revert "DcTrackerBase: Dont provision APN if default is disconnecting"

This reverts commit cf13f20b.

Change-Id: I8181dca843eb3de4be68c5b2be6aac9d81732558
parent c771a338
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -516,12 +516,19 @@ public class DcTracker extends DcTrackerBase {
    @Override
    public synchronized int enableApnType(String apnType) {
        ApnContext apnContext = mApnContexts.get(apnType);
        ApnContext apnContextDefault = mApnContexts.get(PhoneConstants.APN_TYPE_DEFAULT);

        if (apnContext == null || (!TextUtils.equals(apnType, PhoneConstants.APN_TYPE_DEFAULT)
                && !isApnTypeAvailable(apnType))) {
            if (DBG) log("enableApnType: " + apnType + " is type not available");
            return PhoneConstants.APN_TYPE_NOT_AVAILABLE;
        }

        if ((apnType != PhoneConstants.APN_TYPE_DEFAULT) && (apnContextDefault.getState() == DctConstants.State.DISCONNECTING)) {
            if (DBG) log("enableApnType: Cancel setup of apn " + apnType + " while apn DEFAULT is disconnecting");
            return PhoneConstants.APN_REQUEST_FAILED;
       }

        // If already active, return
        if (DBG) log("enableApnType: " + apnType + " mState(" + apnContext.getState() + ")");

+0 −9
Original line number Diff line number Diff line
@@ -947,15 +947,6 @@ public abstract class DcTrackerBase extends Handler {
            }
            case DctConstants.CMD_IS_PROVISIONING_APN: {
                if (DBG) log("CMD_IS_PROVISIONING_APN");

                ApnContext apnContext = mApnContexts.get(PhoneConstants.APN_TYPE_DEFAULT);
                if (apnContext.getState() == State.DISCONNECTING) {
                      log("CMD_IS_PROVISIONING_APN: APN default is DISCONNECTING");
                      mReplyAc.replyToMessage(msg, DctConstants.CMD_IS_PROVISIONING_APN,
                              DctConstants.DISABLED);
                      break;
                }

                boolean isProvApn;
                try {
                    String apnType = null;