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

Commit 7e80da90 authored by Ling Ma's avatar Ling Ma Committed by Android (Google) Code Review
Browse files

Merge "Use res overlay to exempt auto data switch ping test" into udc-dev

parents 8fcb7178 a0302591
Loading
Loading
Loading
Loading
+6 −17
Original line number Diff line number Diff line
@@ -301,8 +301,6 @@ public class DataConfigManager extends Handler {
    private @NonNull final List<HandoverRule> mHandoverRuleList = new ArrayList<>();
    /** {@code True} keep IMS network in case of moving to non VOPS area; {@code false} otherwise.*/
    private boolean mShouldKeepNetworkUpInNonVops = false;
    /** {@code True} requires ping test before switching preferred modem; {@code false} otherwise.*/
    private boolean mPingTestBeforeDataSwitch = true;

    /**
     * Constructor
@@ -450,7 +448,6 @@ public class DataConfigManager extends Handler {
        updateMeteredApnTypes();
        updateSingleDataNetworkTypeAndCapabilityExemption();
        updateVopsConfig();
        updateDataSwitchConfig();
        updateUnmeteredNetworkTypes();
        updateBandwidths();
        updateTcpBuffers();
@@ -671,16 +668,6 @@ public class DataConfigManager extends Handler {
        }
    }

    /**
     * Update preferred modem switch(opportunistic network or visible subscription) carrier config.
     */
    private void updateDataSwitchConfig() {
        synchronized (this) {
            mPingTestBeforeDataSwitch = mCarrierConfig.getBoolean(CarrierConfigManager
                    .KEY_PING_TEST_BEFORE_DATA_SWITCH_BOOL, true);
        }
    }

    /**
     * @return The list of {@link NetworkType} that only supports single data networks
     */
@@ -701,9 +688,10 @@ public class DataConfigManager extends Handler {
        return mShouldKeepNetworkUpInNonVops;
    }

    /** {@code True} keep IMS network in case of moving to non VOPS area; {@code false} otherwise.*/
    public boolean requirePingTestBeforeDataSwitch() {
        return mPingTestBeforeDataSwitch;
    /** {@code True} requires ping test to pass on the target slot before switching to it.*/
    public boolean isPingTestBeforeAutoDataSwitchRequired() {
        return mResources.getBoolean(com.android.internal.R.bool
                .auto_data_switch_ping_test_before_switch);
    }

    /**
@@ -1340,7 +1328,8 @@ public class DataConfigManager extends Handler {
                .stream().map(DataUtils::networkCapabilityToString)
                .collect(Collectors.joining(",")));
        pw.println("mShouldKeepNetworkUpInNoVops=" + mShouldKeepNetworkUpInNonVops);
        pw.println("mPingTestBeforeDataSwitch=" + mPingTestBeforeDataSwitch);
        pw.println("isPingTestBeforeAutoDataSwitchRequired="
                + isPingTestBeforeAutoDataSwitchRequired());
        pw.println("Unmetered network types=" + String.join(",", mUnmeteredNetworkTypes));
        pw.println("Roaming unmetered network types="
                + String.join(",", mRoamingUnmeteredNetworkTypes));
+1 −1
Original line number Diff line number Diff line
@@ -953,7 +953,7 @@ public class PhoneSwitcher extends Handler {
        Phone phone = getPhoneBySubId(mPrimaryDataSubId);
        if (phone != null) {
            DataConfigManager dataConfig = phone.getDataNetworkController().getDataConfigManager();
            mRequirePingTestBeforeDataSwitch = dataConfig.requirePingTestBeforeDataSwitch();
            mRequirePingTestBeforeDataSwitch = dataConfig.isPingTestBeforeAutoDataSwitchRequired();
            mAutoDataSwitchAvailabilityStabilityTimeThreshold =
                    dataConfig.getAutoDataSwitchAvailabilityStabilityTimeThreshold();
            mAutoDataSwitchValidationMaxRetry =
+2 −2
Original line number Diff line number Diff line
@@ -647,7 +647,7 @@ public class PhoneSwitcherTest extends TelephonyTest {
        setSlotIndexToSubId(1, 2);
        setDefaultDataSubId(1);

        doReturn(false).when(mDataConfigManager).requirePingTestBeforeDataSwitch();
        doReturn(false).when(mDataConfigManager).isPingTestBeforeAutoDataSwitchRequired();
        mDataConfigManagerCallback.onCarrierConfigChanged();

        //1. Attempting to switch to nDDS, switch even if validation failed
@@ -2047,7 +2047,7 @@ public class PhoneSwitcherTest extends TelephonyTest {
        doReturn(1000L).when(mDataConfigManager)
                .getAutoDataSwitchAvailabilityStabilityTimeThreshold();
        doReturn(7).when(mDataConfigManager).getAutoDataSwitchValidationMaxRetry();
        doReturn(true).when(mDataConfigManager).requirePingTestBeforeDataSwitch();
        doReturn(true).when(mDataConfigManager).isPingTestBeforeAutoDataSwitchRequired();

        mDataConfigManagerCallback.onCarrierConfigChanged();
        mDataConfigManagerCallback.onDeviceConfigChanged();