Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bdab175 authored by TK MUN's avatar TK MUN Committed by Simon Wilson
Browse files

DO NOT MERGE WiMAX support



- In Connectivity service, start WiMAX service
- 4G icon display in StatusBarPolicy
- Add DHCP renew
- Add radio for WiMAX

Change-Id: Iffff012b270d80e84ec8fbd4486921a8adb847dd
Signed-off-by: default avatarTK MUN <tk.mun@samsung.com>
parent 33029221
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -219,9 +219,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;

+12 −0
Original line number Diff line number Diff line
@@ -143,4 +143,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);
}
+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;
}
+6 −0
Original line number Diff line number Diff line
@@ -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
+32 −0
Original line number Diff line number Diff line
@@ -44,6 +44,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"
@@ -212,6 +221,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);
}
// ----------------------------------------------------------------------------

/*
@@ -233,6 +264,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