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

Commit bed368e3 authored by cken's avatar cken
Browse files

Remove 'hasDns' parameter

Netd use this parameter to determine which network it should use for
DNS query when VPN is enabled. But it is no more reliable when we have
seamless vpn handover, since the parameter does not make update to
netd if we have DNS configuration change. Netd should call resolver
API to get latest DNS information rather than this one.

Bug: 116539103
Test: runtest frameworks-net passes
Change-Id: I6491114ab6de0ff66322f1da69056e6f3c999b5a
parent 9a9dbf05
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ interface INetworkManagementService
    /**
     * Setup a new VPN.
     */
    void createVirtualNetwork(int netId, boolean hasDNS, boolean secure);
    void createVirtualNetwork(int netId, boolean secure);

    /**
     * Remove a network.
+0 −1
Original line number Diff line number Diff line
@@ -5676,7 +5676,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
                // This should never fail.  Specifying an already in use NetID will cause failure.
                if (networkAgent.isVPN()) {
                    mNMS.createVirtualNetwork(networkAgent.network.netId,
                            !networkAgent.linkProperties.getDnsServers().isEmpty(),
                            (networkAgent.networkMisc == null ||
                                !networkAgent.networkMisc.allowBypass));
                } else {
+2 −2
Original line number Diff line number Diff line
@@ -2325,11 +2325,11 @@ public class NetworkManagementService extends INetworkManagementService.Stub
    }

    @Override
    public void createVirtualNetwork(int netId, boolean hasDNS, boolean secure) {
    public void createVirtualNetwork(int netId, boolean secure) {
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);

        try {
            mNetdService.networkCreateVpn(netId, hasDNS, secure);
            mNetdService.networkCreateVpn(netId, secure);
        } catch (RemoteException | ServiceSpecificException e) {
            throw new IllegalStateException(e);
        }