FileDocCategorySizeDatePackage
EthernetConfigStore.javaAPI DocAndroid 5.1 API2185Thu Mar 12 22:22:52 GMT 2015com.android.server.ethernet

EthernetConfigStore

public class EthernetConfigStore extends com.android.server.net.IpConfigStore
This class provides an API to store and manage Ethernet network configuration.

Fields Summary
private static final String
TAG
private static final String
ipConfigFile
Constructors Summary
public EthernetConfigStore()


      
    
Methods Summary
public android.net.IpConfigurationreadIpAndProxyConfigurations()

        SparseArray<IpConfiguration> networks = readIpAndProxyConfigurations(ipConfigFile);

        if (networks.size() == 0) {
            Log.w(TAG, "No Ethernet configuration found. Using default.");
            return new IpConfiguration(IpAssignment.DHCP, ProxySettings.NONE, null, null);
        }

        if (networks.size() > 1) {
            // Currently we only support a single Ethernet interface.
            Log.w(TAG, "Multiple Ethernet configurations detected. Only reading first one.");
        }

        return networks.valueAt(0);
    
public voidwriteIpAndProxyConfigurations(android.net.IpConfiguration config)

        SparseArray<IpConfiguration> networks = new SparseArray<IpConfiguration>();
        networks.put(0, config);
        writeIpAndProxyConfigurations(ipConfigFile, networks);