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

Commit 44ddbe73 authored by Muhammed Siju's avatar Muhammed Siju Committed by Linux Build Service Account
Browse files

Allow data call response without DNS address.

If there is no DNS addresses received for data call request,
config_allowDataCallWithoutDns is checked to see whether data call
needs to be torn down or not. Default value is false.

Change-Id: I4cccdd5f029d92aa7ddcd877736f4b8da8a6472d
parent c92f2ec6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -30,5 +30,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<!-- These resources are around just to allow their values to be customized
     for different hardware and product builds.  Do not translate. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

    <!-- config to not tear down data call when NO DNS is received -->
    <bool name="config_allowDataCallWithoutDns">false</bool>
</resources>
+16 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.internal.telephony.dataconnection;

import com.android.internal.telephony.CallTracker;
import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.ConfigResourceUtil;
import com.android.internal.telephony.DctConstants;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneBase;
@@ -116,6 +117,8 @@ public final class DataConnection extends StateMachine {

    protected String[] mPcscfAddr;

    private ConfigResourceUtil mConfigResUtil = new ConfigResourceUtil();

    /**
     * Used internally for saving connecting parameters.
     */
@@ -811,6 +814,19 @@ public final class DataConnection extends StateMachine {
    private boolean isDnsOk(String[] domainNameServers) {
        if (NULL_IP.equals(domainNameServers[0]) && NULL_IP.equals(domainNameServers[1])
                && !mPhone.isDnsCheckDisabled()) {
            boolean allowNoDns = false;
            try {
                allowNoDns = mConfigResUtil.getBooleanValue(mPhone.getContext(),
                        "config_allowDataCallWithoutDns");
            } catch (Exception ex) {
                if (DBG) log("isDnsOk: exception reading config. Ex= " + ex);
            }

            if (allowNoDns) {
                log("isDnsOk: Data call without DNS allowed.");
                return true;
            }

            // Work around a race condition where QMI does not fill in DNS:
            // Deactivate PDP and let DataConnectionTracker retry.
            // Do not apply the race condition workaround for MMS APN