Switch from NetworkUtils to netd for iface config.
Moving more stuff to netd and getting rid of unused NetworkUtils.
Change-Id: Ibb5a11dca58d07291fe33e6d33027553f6158ea7
diff --git a/core/java/android/net/NetworkUtils.java b/core/java/android/net/NetworkUtils.java
index f1bf852..b0c974c 100644
--- a/core/java/android/net/NetworkUtils.java
+++ b/core/java/android/net/NetworkUtils.java
@@ -104,26 +104,6 @@
public native static String getDhcpError();
/**
- * When static IP configuration has been specified, configure the network
- * interface according to the values supplied.
- * @param interfaceName the name of the interface to configure
- * @param ipInfo the IP address, default gateway, and DNS server addresses
- * with which to configure the interface.
- * @return {@code true} for success, {@code false} for failure
- */
- public static boolean configureInterface(String interfaceName, DhcpInfo ipInfo) {
- return configureNative(interfaceName,
- ipInfo.ipAddress,
- ipInfo.netmask,
- ipInfo.gateway,
- ipInfo.dns1,
- ipInfo.dns2);
- }
-
- private native static boolean configureNative(
- String interfaceName, int ipAddress, int netmask, int gateway, int dns1, int dns2);
-
- /**
* Convert a IPv4 address from an integer to an InetAddress.
* @param hostAddress an int corresponding to the IPv4 address in network byte order
*/
diff --git a/core/jni/android_net_NetUtils.cpp b/core/jni/android_net_NetUtils.cpp
index 351f264..f658479 100644
--- a/core/jni/android_net_NetUtils.cpp
+++ b/core/jni/android_net_NetUtils.cpp
@@ -30,7 +30,6 @@
int ifc_get_default_route(const char *ifname);
int ifc_remove_default_route(const char *ifname);
int ifc_reset_connections(const char *ifname);
-int ifc_configure(const char *ifname, in_addr_t ipaddr, in_addr_t netmask, in_addr_t gateway, in_addr_t dns1, in_addr_t dns2);
int dhcp_do_request(const char *ifname,
in_addr_t *ipaddr,
@@ -193,24 +192,6 @@
return env->NewStringUTF(::dhcp_get_errmsg());
}
-static jboolean android_net_utils_configureInterface(JNIEnv* env,
- jobject clazz,
- jstring ifname,
- jint ipaddr,
- jint mask,
- jint gateway,
- jint dns1,
- jint dns2)
-{
- int result;
- uint32_t lease;
-
- const char *nameStr = env->GetStringUTFChars(ifname, NULL);
- result = ::ifc_configure(nameStr, ipaddr, mask, gateway, dns1, dns2);
- env->ReleaseStringUTFChars(ifname, nameStr);
- return (jboolean)(result == 0);
-}
-
// ----------------------------------------------------------------------------
/*
@@ -231,7 +212,6 @@
{ "runDhcp", "(Ljava/lang/String;Landroid/net/DhcpInfo;)Z", (void *)android_net_utils_runDhcp },
{ "stopDhcp", "(Ljava/lang/String;)Z", (void *)android_net_utils_stopDhcp },
{ "releaseDhcpLease", "(Ljava/lang/String;)Z", (void *)android_net_utils_releaseDhcpLease },
- { "configureNative", "(Ljava/lang/String;IIIII)Z", (void *)android_net_utils_configureInterface },
{ "getDhcpError", "()Ljava/lang/String;", (void*) android_net_utils_getDhcpError },
};