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

Commit dc388a5f authored by Jack Yu's avatar Jack Yu Committed by android-build-merger
Browse files

Merge "Cleaned up dead code" am: 805b5ca6

am: 25d838b2

Change-Id: I55f9019b65a2689cfc5217b323c3986baf799733
parents 5d520b82 25d838b2
Loading
Loading
Loading
Loading
+11 −28
Original line number Diff line number Diff line
@@ -1108,7 +1108,7 @@ public class DcTracker extends Handler {
        if (mAutoAttachOnCreationConfig) {
            mAutoAttachOnCreation.set(true);
        }
        setupDataOnConnectableApns(Phone.REASON_DATA_ATTACHED);
        setupDataOnConnectableApns(Phone.REASON_DATA_ATTACHED, RetryFailures.ALWAYS);
    }

    /**
@@ -1288,10 +1288,6 @@ public class DcTracker extends Handler {
        ONLY_ON_CHANGE
    };

    private void setupDataOnConnectableApns(String reason) {
        setupDataOnConnectableApns(reason, RetryFailures.ALWAYS);
    }

    private void setupDataOnConnectableApns(String reason, RetryFailures retryFailures) {
        if (VDBG) log("setupDataOnConnectableApns: " + reason);

@@ -1948,7 +1944,7 @@ public class DcTracker extends Handler {

        // FIXME: See bug 17426028 maybe no conditional is needed.
        if (mPhone.getSubId() == SubscriptionManager.getDefaultDataSubscriptionId()) {
            setupDataOnConnectableApns(Phone.REASON_APN_CHANGED);
            setupDataOnConnectableApns(Phone.REASON_APN_CHANGED, RetryFailures.ALWAYS);
        }
    }

@@ -2103,7 +2099,7 @@ public class DcTracker extends Handler {
            if (DBG) log("onRecordsLoadedOrSubIdChanged: notifying data availability");
            notifyOffApnsOfAvailability();
        }
        setupDataOnConnectableApns(Phone.REASON_SIM_LOADED);
        setupDataOnConnectableApns(Phone.REASON_SIM_LOADED, RetryFailures.ALWAYS);
    }

    private void onSimNotReady() {
@@ -2297,22 +2293,10 @@ public class DcTracker extends Handler {
            if(DBG) log("onEnableApn: isOnlySingleDcAllowed true & higher priority APN disabled");
            // If the highest priority APN is disabled and only single
            // data call is allowed, try to setup data call on other connectable APN.
            setupDataOnConnectableApns(Phone.REASON_SINGLE_PDN_ARBITRATION);
            setupDataOnConnectableApns(Phone.REASON_SINGLE_PDN_ARBITRATION, RetryFailures.ALWAYS);
        }
    }

    // TODO: We shouldnt need this.
    private boolean onTrySetupData(String reason) {
        if (DBG) log("onTrySetupData: reason=" + reason);
        setupDataOnConnectableApns(reason);
        return true;
    }

    private boolean onTrySetupData(ApnContext apnContext) {
        if (DBG) log("onTrySetupData: apnContext=" + apnContext);
        return trySetupData(apnContext);
    }

    /**
     * Modify {@link android.provider.Settings.Global#DATA_ROAMING} value for user modification only
     */
@@ -2453,7 +2437,7 @@ public class DcTracker extends Handler {
            // non-roaming, we should try to reestablish the data connection.

            notifyOffApnsOfAvailability();
            setupDataOnConnectableApns(Phone.REASON_ROAMING_OFF);
            setupDataOnConnectableApns(Phone.REASON_ROAMING_OFF, RetryFailures.ALWAYS);
        } else {
            notifyDataConnection();
        }
@@ -2485,7 +2469,7 @@ public class DcTracker extends Handler {

            if (DBG) log("onDataRoamingOnOrSettingsChanged: setup data on roaming");

            setupDataOnConnectableApns(Phone.REASON_ROAMING_ON);
            setupDataOnConnectableApns(Phone.REASON_ROAMING_ON, RetryFailures.ALWAYS);
            notifyDataConnection();
        } else {
            // If the user does not turn on data roaming, when we transit from non-roaming to
@@ -2906,7 +2890,8 @@ public class DcTracker extends Handler {
            apnContext.setDataConnection(null);
            if (isOnlySingleDcAllowed(mPhone.getServiceState().getRilDataRadioTechnology())) {
                if(DBG) log("onDisconnectDone: isOnlySigneDcAllowed true so setup single apn");
                setupDataOnConnectableApns(Phone.REASON_SINGLE_PDN_ARBITRATION);
                setupDataOnConnectableApns(Phone.REASON_SINGLE_PDN_ARBITRATION,
                        RetryFailures.ALWAYS);
            } else {
                if(DBG) log("onDisconnectDone: not retrying");
            }
@@ -2948,7 +2933,7 @@ public class DcTracker extends Handler {
            }
        }
        // reset reconnect timer
        setupDataOnConnectableApns(Phone.REASON_VOICE_CALL_ENDED);
        setupDataOnConnectableApns(Phone.REASON_VOICE_CALL_ENDED, RetryFailures.ALWAYS);
    }

    private boolean isConnected() {
@@ -3413,9 +3398,7 @@ public class DcTracker extends Handler {

            case DctConstants.EVENT_TRY_SETUP_DATA:
                if (msg.obj instanceof ApnContext) {
                    onTrySetupData((ApnContext)msg.obj);
                } else if (msg.obj instanceof String) {
                    onTrySetupData((String)msg.obj);
                    trySetupData((ApnContext) msg.obj);
                } else {
                    loge("EVENT_TRY_SETUP request w/o apnContext or String");
                }
@@ -3755,7 +3738,7 @@ public class DcTracker extends Handler {

        if (enable) {
            reevaluateDataConnections();
            onTrySetupData(Phone.REASON_DATA_ENABLED);
            setupDataOnConnectableApns(Phone.REASON_DATA_ENABLED, RetryFailures.ALWAYS);
        } else {
            String cleanupReason;
            switch (enabledChangedReason) {