components/cronet/tools/android_rndis_forwarder.py
def _SetDns(self, iface, dns1, dns2):
    """Overrides device's DNS configuration.

    Args:
      iface: name of the network interface to make default
      dns1, dns2: nameserver IP addresses
    """
    if not iface:
      return  # If there is no route, then nobody cares about DNS.
    # DNS proxy in older versions of Android is configured via properties.
    # TODO(szym): run via su -c if necessary.
    self._device.SetProp('net.dns1', dns1)
    self._device.SetProp('net.dns2', dns2)
    dnschange = self._device.GetProp('net.dnschange')
    if dnschange:
      self._device.SetProp('net.dnschange', str(int(dnschange) + 1))
    # Since commit 8b47b3601f82f299bb8c135af0639b72b67230e6 to frameworks/base
    # the net.dns1 properties have been replaced with explicit commands for netd
    self._device.RunShellCommand(
        ['netd', 'resolver', 'setifdns', iface, dns1, dns2], check_return=True)
    # TODO(szym): if we know the package UID, we could setifaceforuidrange
    self._device.RunShellCommand(
        ['netd', 'resolver', 'setdefaultif', iface], check_return=True)
Overrides device's DNS configuration.

    Args:
      iface: name of the network interface to make default
      dns1, dns2: nameserver IP addresses
    
Overrides device's DNS configuration.
Overrides device ' s DNS configuration .
def _SetDns(self, iface, dns1, dns2):
    if not iface:
      return  
    self._device.SetProp('net.dns1', dns1)
    self._device.SetProp('net.dns2', dns2)
    dnschange = self._device.GetProp('net.dnschange')
    if dnschange:
      self._device.SetProp('net.dnschange', str(int(dnschange) + 1))
    self._device.RunShellCommand(
        ['netd', 'resolver', 'setifdns', iface, dns1, dns2], check_return=True)
    self._device.RunShellCommand(
        ['netd', 'resolver', 'setdefaultif', iface], check_return=True)
def _SetDns ( self , iface , dns1 , dns2 ) : if not iface : return self . _device . SetProp ( 'net.dns1' , dns1 ) self . _device . SetProp ( 'net.dns2' , dns2 ) dnschange = self . _device . GetProp ( 'net.dnschange' ) if dnschange : self . _device . SetProp ( 'net.dnschange' , str ( int ( dnschange ) + 1 ) ) self . _device . RunShellCommand ( [ 'netd' , 'resolver' , 'setifdns' , iface , dns1 , dns2 ] , check_return = True ) self . _device . RunShellCommand ( [ 'netd' , 'resolver' , 'setdefaultif' , iface ] , check_return = True )
Overrides device's DNS configuration.
Overrides device ' s DNS configuration .
"""Overrides device's DNS configuration.

    Args:
      iface: name of the network interface to make default
      dns1, dns2: nameserver IP addresses
    """ # If there is no route, then nobody cares about DNS. # DNS proxy in older versions of Android is configured via properties. # TODO(szym): run via su -c if necessary. # Since commit 8b47b3601f82f299bb8c135af0639b72b67230e6 to frameworks/base # the net.dns1 properties have been replaced with explicit commands for netd # TODO(szym): if we know the package UID, we could setifaceforuidrange
self
iface
name of the network interface to make default
name of the network interface to make default
dns1
dns2
dns1, dns2
nameserver IP addresses
nameserver IP addresses