diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2011-02-15 13:50:21 -0800 |
---|---|---|
committer | Robert Greenwalt <rgreenwalt@google.com> | 2011-02-15 13:50:21 -0800 |
commit | 19f8ca846b5234278d3001782077b90aad61a85c (patch) | |
tree | a67f7075b0275cbf04bc01dbb449dcea6f13349c /core/jni/android_net_wifi_Wifi.cpp | |
parent | 302b9884b3f0ecc96cc618643835d415e474cac3 (diff) | |
download | frameworks_base-19f8ca846b5234278d3001782077b90aad61a85c.zip frameworks_base-19f8ca846b5234278d3001782077b90aad61a85c.tar.gz frameworks_base-19f8ca846b5234278d3001782077b90aad61a85c.tar.bz2 |
Remove some unused wifi dhcp code.
Change-Id: I114b3772b334a41936c6ed4bb8304f6914481ef1
Diffstat (limited to 'core/jni/android_net_wifi_Wifi.cpp')
-rw-r--r-- | core/jni/android_net_wifi_Wifi.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/core/jni/android_net_wifi_Wifi.cpp b/core/jni/android_net_wifi_Wifi.cpp index 58b5686..fc806a5 100644 --- a/core/jni/android_net_wifi_Wifi.cpp +++ b/core/jni/android_net_wifi_Wifi.cpp @@ -31,25 +31,6 @@ namespace android { static jboolean sScanModeActive = false; -//TODO: check general errors in addition to overflow on snprintf - -/* - * The following remembers the jfieldID's of the fields - * of the DhcpInfo Java object, so that we don't have - * to look them up every time. - */ -static struct fieldIds { - jclass dhcpInfoClass; - jmethodID constructorId; - jfieldID ipaddress; - jfieldID gateway; - jfieldID netmask; - jfieldID dns1; - jfieldID dns2; - jfieldID serverAddress; - jfieldID leaseDuration; -} dhcpInfoFieldIds; - static int doCommand(const char *cmd, char *replybuf, int replybuflen) { size_t reply_len = replybuflen - 1; @@ -575,29 +556,6 @@ static jboolean android_net_wifi_setSuspendOptimizationsCommand(JNIEnv* env, job return doBooleanCommand(cmdstr, "OK"); } - -static jboolean android_net_wifi_doDhcpRequest(JNIEnv* env, jobject clazz, jobject info) -{ - jint ipaddr, gateway, mask, dns1, dns2, server, lease; - jboolean succeeded = ((jboolean)::do_dhcp_request(&ipaddr, &gateway, &mask, - &dns1, &dns2, &server, &lease) == 0); - if (succeeded && dhcpInfoFieldIds.dhcpInfoClass != NULL) { - env->SetIntField(info, dhcpInfoFieldIds.ipaddress, ipaddr); - env->SetIntField(info, dhcpInfoFieldIds.gateway, gateway); - env->SetIntField(info, dhcpInfoFieldIds.netmask, mask); - env->SetIntField(info, dhcpInfoFieldIds.dns1, dns1); - env->SetIntField(info, dhcpInfoFieldIds.dns2, dns2); - env->SetIntField(info, dhcpInfoFieldIds.serverAddress, server); - env->SetIntField(info, dhcpInfoFieldIds.leaseDuration, lease); - } - return succeeded; -} - -static jstring android_net_wifi_getDhcpError(JNIEnv* env, jobject clazz) -{ - return env->NewStringUTF(::get_dhcp_error_string()); -} - // ---------------------------------------------------------------------------- /* @@ -665,8 +623,6 @@ static JNINativeMethod gWifiMethods[] = { (void*) android_net_wifi_setSuspendOptimizationsCommand}, { "setCountryCodeCommand", "(Ljava/lang/String;)Z", (void*) android_net_wifi_setCountryCodeCommand}, - { "doDhcpRequest", "(Landroid/net/DhcpInfo;)Z", (void*) android_net_wifi_doDhcpRequest }, - { "getDhcpError", "()Ljava/lang/String;", (void*) android_net_wifi_getDhcpError }, }; int register_android_net_wifi_WifiManager(JNIEnv* env) @@ -674,18 +630,6 @@ int register_android_net_wifi_WifiManager(JNIEnv* env) jclass wifi = env->FindClass(WIFI_PKG_NAME); LOG_FATAL_IF(wifi == NULL, "Unable to find class " WIFI_PKG_NAME); - dhcpInfoFieldIds.dhcpInfoClass = env->FindClass("android/net/DhcpInfo"); - if (dhcpInfoFieldIds.dhcpInfoClass != NULL) { - dhcpInfoFieldIds.constructorId = env->GetMethodID(dhcpInfoFieldIds.dhcpInfoClass, "<init>", "()V"); - dhcpInfoFieldIds.ipaddress = env->GetFieldID(dhcpInfoFieldIds.dhcpInfoClass, "ipAddress", "I"); - dhcpInfoFieldIds.gateway = env->GetFieldID(dhcpInfoFieldIds.dhcpInfoClass, "gateway", "I"); - dhcpInfoFieldIds.netmask = env->GetFieldID(dhcpInfoFieldIds.dhcpInfoClass, "netmask", "I"); - dhcpInfoFieldIds.dns1 = env->GetFieldID(dhcpInfoFieldIds.dhcpInfoClass, "dns1", "I"); - dhcpInfoFieldIds.dns2 = env->GetFieldID(dhcpInfoFieldIds.dhcpInfoClass, "dns2", "I"); - dhcpInfoFieldIds.serverAddress = env->GetFieldID(dhcpInfoFieldIds.dhcpInfoClass, "serverAddress", "I"); - dhcpInfoFieldIds.leaseDuration = env->GetFieldID(dhcpInfoFieldIds.dhcpInfoClass, "leaseDuration", "I"); - } - return AndroidRuntime::registerNativeMethods(env, WIFI_PKG_NAME, gWifiMethods, NELEM(gWifiMethods)); } |