Loading core/java/android/net/ConnectivityManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -222,9 +222,9 @@ public class ConnectivityManager /** {@hide} */ public static final int TYPE_ETHERNET = 9; /** {@hide} TODO: Need to adjust this for WiMAX. */ public static final int MAX_RADIO_TYPE = TYPE_WIFI; public static final int MAX_RADIO_TYPE = TYPE_ETHERNET; /** {@hide} TODO: Need to adjust this for WiMAX. */ public static final int MAX_NETWORK_TYPE = TYPE_MOBILE_HIPRI; public static final int MAX_NETWORK_TYPE = TYPE_ETHERNET; public static final int DEFAULT_NETWORK_PREFERENCE = TYPE_WIFI; Loading core/java/android/net/NetworkUtils.java +12 −0 Original line number Diff line number Diff line Loading @@ -209,4 +209,16 @@ public class NetworkUtils { } return result; } /** * Start the DHCP renew service for wimax, * This call blocks until it obtains a result (either success * or failure) from the daemon. * @param interfaceName the name of the interface to configure * @param ipInfo if the request succeeds, this object is filled in with * the IP address information. * @return {@code true} for success, {@code false} for failure * {@hide} */ public native static boolean runDhcpRenew(String interfaceName, DhcpInfo ipInfo); } core/java/android/net/wimax/WimaxManagerConstants.java 0 → 100644 +85 −0 Original line number Diff line number Diff line package android.net.wimax; /** * {@hide} */ public class WimaxManagerConstants { /** * Used by android.net.wimax.WimaxManager for handling management of * Wimax access. */ public static final String WIMAX_SERVICE="WiMax"; /** * Broadcast intent action indicating that Wimax has been enabled, disabled, * enabling, disabling, or unknown. One extra provides this state as an int. * Another extra provides the previous state, if available. */ public static final String WIMAX_STATUS_CHANGED_ACTION = "android.net.wimax.WIMAX_STATUS_CHANGED"; /** * The lookup key for an int that indicates whether Wimax is enabled, * disabled, enabling, disabling, or unknown. */ public static final String EXTRA_WIMAX_STATUS = "wimax_status"; /** * Broadcast intent action indicating that Wimax data has been recieved, sent. One extra * provides the state as int. */ public static final String WIMAX_DATA_USED_ACTION = "android.net.wimax.WIMAX_DATA_USED"; /** * The lookup key for an int that indicates whether Wimax is data is being recieved or sent, * up indicates data is being sent and down indicates data being recieved. */ public static final String EXTRA_UP_DOWN_DATA = "upDownData"; /** * Indicatates Wimax is disabled. */ public static final int WIMAX_STATUS_DISABLED = 1; /** * Indicatates Wimax is enabled. */ public static final int WIMAX_STATUS_ENABLED = 3; /** * Indicatates Wimax status is known. */ public static final int WIMAX_STATUS_UNKNOWN = 4; /** * Indicatates Wimax is in idle state. */ public static final int WIMAX_IDLE = 6; /** * Indicatates Wimax is being deregistered. */ public static final int WIMAX_DEREGISTRATION = 8; /** * Indicatates no data on wimax. */ public static final int NO_DATA = 0; /** * Indicatates data is being sent. */ public static final int UP_DATA = 1; /** * Indicatates dats is being revieved. */ public static final int DOWN_DATA = 2; /** * Indicatates data is being recieved and sent simultaneously. */ public static final int UP_DOWN_DATA = 3; } core/java/android/provider/Settings.java +6 −0 Original line number Diff line number Diff line Loading @@ -1100,6 +1100,12 @@ public final class Settings { */ public static final String RADIO_CELL = "cell"; /** * Constant for use in AIRPLANE_MODE_RADIOS to specify WiMAX radio. * @hide */ public static final String RADIO_WIMAX = "wimax"; /** * A comma separated list of radios that need to be disabled when airplane mode * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are Loading core/jni/android_net_NetUtils.cpp +32 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,15 @@ int dhcp_do_request(const char *ifname, int dhcp_stop(const char *ifname); int dhcp_release_lease(const char *ifname); char *dhcp_get_errmsg(); int dhcp_do_request_renew(const char *ifname, in_addr_t *ipaddr, in_addr_t *gateway, in_addr_t *mask, in_addr_t *dns1, in_addr_t *dns2, in_addr_t *server, uint32_t *lease); } #define NETUTILS_PKG_NAME "android/net/NetworkUtils" Loading Loading @@ -211,6 +220,28 @@ static jboolean android_net_utils_configureInterface(JNIEnv* env, return (jboolean)(result == 0); } static jboolean android_net_utils_runDhcpRenew(JNIEnv* env, jobject clazz, jstring ifname, jobject info) { int result = -1; in_addr_t ipaddr, gateway, mask, dns1, dns2, server; uint32_t lease; const char *nameStr = env->GetStringUTFChars(ifname, NULL); result = ::dhcp_do_request_renew(nameStr, &ipaddr, &gateway, &mask, &dns1, &dns2, &server, &lease); env->ReleaseStringUTFChars(ifname, nameStr); if (result == 0 && 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 (jboolean)(result == 0); } // ---------------------------------------------------------------------------- /* Loading @@ -232,6 +263,7 @@ static JNINativeMethod gNetworkUtilMethods[] = { { "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 }, { "runDhcpRenew", "(Ljava/lang/String;Landroid/net/DhcpInfo;)Z", (void *)android_net_utils_runDhcpRenew} }; int register_android_net_NetworkUtils(JNIEnv* env) Loading Loading
core/java/android/net/ConnectivityManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -222,9 +222,9 @@ public class ConnectivityManager /** {@hide} */ public static final int TYPE_ETHERNET = 9; /** {@hide} TODO: Need to adjust this for WiMAX. */ public static final int MAX_RADIO_TYPE = TYPE_WIFI; public static final int MAX_RADIO_TYPE = TYPE_ETHERNET; /** {@hide} TODO: Need to adjust this for WiMAX. */ public static final int MAX_NETWORK_TYPE = TYPE_MOBILE_HIPRI; public static final int MAX_NETWORK_TYPE = TYPE_ETHERNET; public static final int DEFAULT_NETWORK_PREFERENCE = TYPE_WIFI; Loading
core/java/android/net/NetworkUtils.java +12 −0 Original line number Diff line number Diff line Loading @@ -209,4 +209,16 @@ public class NetworkUtils { } return result; } /** * Start the DHCP renew service for wimax, * This call blocks until it obtains a result (either success * or failure) from the daemon. * @param interfaceName the name of the interface to configure * @param ipInfo if the request succeeds, this object is filled in with * the IP address information. * @return {@code true} for success, {@code false} for failure * {@hide} */ public native static boolean runDhcpRenew(String interfaceName, DhcpInfo ipInfo); }
core/java/android/net/wimax/WimaxManagerConstants.java 0 → 100644 +85 −0 Original line number Diff line number Diff line package android.net.wimax; /** * {@hide} */ public class WimaxManagerConstants { /** * Used by android.net.wimax.WimaxManager for handling management of * Wimax access. */ public static final String WIMAX_SERVICE="WiMax"; /** * Broadcast intent action indicating that Wimax has been enabled, disabled, * enabling, disabling, or unknown. One extra provides this state as an int. * Another extra provides the previous state, if available. */ public static final String WIMAX_STATUS_CHANGED_ACTION = "android.net.wimax.WIMAX_STATUS_CHANGED"; /** * The lookup key for an int that indicates whether Wimax is enabled, * disabled, enabling, disabling, or unknown. */ public static final String EXTRA_WIMAX_STATUS = "wimax_status"; /** * Broadcast intent action indicating that Wimax data has been recieved, sent. One extra * provides the state as int. */ public static final String WIMAX_DATA_USED_ACTION = "android.net.wimax.WIMAX_DATA_USED"; /** * The lookup key for an int that indicates whether Wimax is data is being recieved or sent, * up indicates data is being sent and down indicates data being recieved. */ public static final String EXTRA_UP_DOWN_DATA = "upDownData"; /** * Indicatates Wimax is disabled. */ public static final int WIMAX_STATUS_DISABLED = 1; /** * Indicatates Wimax is enabled. */ public static final int WIMAX_STATUS_ENABLED = 3; /** * Indicatates Wimax status is known. */ public static final int WIMAX_STATUS_UNKNOWN = 4; /** * Indicatates Wimax is in idle state. */ public static final int WIMAX_IDLE = 6; /** * Indicatates Wimax is being deregistered. */ public static final int WIMAX_DEREGISTRATION = 8; /** * Indicatates no data on wimax. */ public static final int NO_DATA = 0; /** * Indicatates data is being sent. */ public static final int UP_DATA = 1; /** * Indicatates dats is being revieved. */ public static final int DOWN_DATA = 2; /** * Indicatates data is being recieved and sent simultaneously. */ public static final int UP_DOWN_DATA = 3; }
core/java/android/provider/Settings.java +6 −0 Original line number Diff line number Diff line Loading @@ -1100,6 +1100,12 @@ public final class Settings { */ public static final String RADIO_CELL = "cell"; /** * Constant for use in AIRPLANE_MODE_RADIOS to specify WiMAX radio. * @hide */ public static final String RADIO_WIMAX = "wimax"; /** * A comma separated list of radios that need to be disabled when airplane mode * is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi and bluetooth are Loading
core/jni/android_net_NetUtils.cpp +32 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,15 @@ int dhcp_do_request(const char *ifname, int dhcp_stop(const char *ifname); int dhcp_release_lease(const char *ifname); char *dhcp_get_errmsg(); int dhcp_do_request_renew(const char *ifname, in_addr_t *ipaddr, in_addr_t *gateway, in_addr_t *mask, in_addr_t *dns1, in_addr_t *dns2, in_addr_t *server, uint32_t *lease); } #define NETUTILS_PKG_NAME "android/net/NetworkUtils" Loading Loading @@ -211,6 +220,28 @@ static jboolean android_net_utils_configureInterface(JNIEnv* env, return (jboolean)(result == 0); } static jboolean android_net_utils_runDhcpRenew(JNIEnv* env, jobject clazz, jstring ifname, jobject info) { int result = -1; in_addr_t ipaddr, gateway, mask, dns1, dns2, server; uint32_t lease; const char *nameStr = env->GetStringUTFChars(ifname, NULL); result = ::dhcp_do_request_renew(nameStr, &ipaddr, &gateway, &mask, &dns1, &dns2, &server, &lease); env->ReleaseStringUTFChars(ifname, nameStr); if (result == 0 && 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 (jboolean)(result == 0); } // ---------------------------------------------------------------------------- /* Loading @@ -232,6 +263,7 @@ static JNINativeMethod gNetworkUtilMethods[] = { { "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 }, { "runDhcpRenew", "(Ljava/lang/String;Landroid/net/DhcpInfo;)Z", (void *)android_net_utils_runDhcpRenew} }; int register_android_net_NetworkUtils(JNIEnv* env) Loading