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

Commit ea29e27a authored by Steve Kondik's avatar Steve Kondik
Browse files

hotspot: Use system property for TI HotSpot

Change-Id: Iaa202886614561af141c2bda9fc9f4968a135133
parent a4f8e739
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -108,7 +108,6 @@ static jboolean android_net_wifi_unloadDriver(JNIEnv* env, jobject clazz)
    return (jboolean)(::wifi_unload_driver() == 0);
}

#ifdef OMAP_ENHANCEMENT
static jboolean android_net_hotspot_loadDriver(JNIEnv* env, jobject clazz)
{
    return (jboolean)(::hotspot_load_driver() == 0);
@@ -118,7 +117,6 @@ static jboolean android_net_hotspot_unloadDriver(JNIEnv* env, jobject clazz)
{
    return (jboolean)(::hotspot_unload_driver() == 0);
}
#endif /*OMAP_ENHANCEMENT*/

static jboolean android_net_wifi_startSupplicant(JNIEnv* env, jobject clazz)
{
@@ -544,10 +542,8 @@ static JNINativeMethod gWifiMethods[] = {

    { "loadDriver", "()Z",  (void *)android_net_wifi_loadDriver },
    { "unloadDriver", "()Z",  (void *)android_net_wifi_unloadDriver },
#ifdef OMAP_ENHANCEMENT
    { "loadHotspotDriver", "()Z",  (void *)android_net_hotspot_loadDriver },
    { "unloadHotspotDriver", "()Z",  (void *)android_net_hotspot_unloadDriver },
#endif /*OMAP_ENHANCEMENT*/
    { "startSupplicant", "()Z",  (void *)android_net_wifi_startSupplicant },
    { "stopSupplicant", "()Z",  (void *)android_net_wifi_stopSupplicant },
    { "connectToSupplicant", "()Z",  (void *)android_net_wifi_connectToSupplicant },
+2 −2
Original line number Diff line number Diff line
@@ -606,7 +606,7 @@ class NetworkManagementService extends INetworkManagementService.Stub {
        mContext.enforceCallingOrSelfPermission(
                android.Manifest.permission.CHANGE_WIFI_STATE, "NetworkManagementService");
        try {
            if(SystemProperties.OMAP_ENHANCEMENT) {
            if (SystemProperties.getBoolean("wifi.hotspot.ti", false)) {
                mConnector.doCommand(String.format("softap start " + softapIface));
                mConnector.doCommand(String.format("softap startap " + softapIface));
                NetworkUtils.enableInterface(softapIface);
@@ -636,7 +636,7 @@ class NetworkManagementService extends INetworkManagementService.Stub {
                                           convertQuotedString(wifiConfig.preSharedKey));
                mConnector.doCommand(str);
            }
            if(!SystemProperties.OMAP_ENHANCEMENT)
            if(!SystemProperties.getBoolean("wifi.hotspot.ti", false))
                mConnector.doCommand(String.format("softap startap"));
        } catch (NativeDaemonConnectorException e) {
            throw new IllegalStateException("Error communicating to native daemon to start softap", e);
+5 −5
Original line number Diff line number Diff line
@@ -683,7 +683,7 @@ public class WifiService extends IWifiManager.Stub {
            /* Configuration changed on a running access point */
            if(enable && (wifiConfig != null)) {
                try {
                    if(SystemProperties.OMAP_ENHANCEMENT) {
                    if (SystemProperties.getBoolean("wifi.hotspot.ti", false)) {
                        nwService.setAccessPoint(wifiConfig, mWifiStateTracker.getInterfaceName(),
                                                 TI_SOFTAP_IFACE);
                    } else {
@@ -727,7 +727,7 @@ public class WifiService extends IWifiManager.Stub {
                wifiConfig.allowedKeyManagement.set(KeyMgmt.NONE);
            }

            if (SystemProperties.OMAP_ENHANCEMENT) {
            if (SystemProperties.getBoolean("wifi.hotspot.ti", false)) {
                if (!mWifiStateTracker.loadHotspotDriver()) {
                    Slog.e(TAG, "Failed to load Wi-Fi driver for AP mode");
                    setWifiApEnabledState(WIFI_AP_STATE_FAILED, uid, DriverAction.NO_DRIVER_UNLOAD);
@@ -742,7 +742,7 @@ public class WifiService extends IWifiManager.Stub {
            }

            try {
                if(SystemProperties.OMAP_ENHANCEMENT) {
                if (SystemProperties.getBoolean("wifi.hotspot.ti", false)) {
                    nwService.startAccessPoint(wifiConfig, mWifiStateTracker.getInterfaceName(),
                                               TI_SOFTAP_IFACE);
                } else {
@@ -767,7 +767,7 @@ public class WifiService extends IWifiManager.Stub {
                return false;
            }

            if(SystemProperties.OMAP_ENHANCEMENT) {
            if (SystemProperties.getBoolean("wifi.hotspot.ti", false)) {
                if (!mWifiStateTracker.unloadHotspotDriver()) {
                    Slog.e(TAG, "Failed to unload Wi-Fi driver for AP mode");
                    setWifiApEnabledState(WIFI_AP_STATE_FAILED, uid, DriverAction.NO_DRIVER_UNLOAD);
@@ -806,7 +806,7 @@ public class WifiService extends IWifiManager.Stub {
         * Unload the driver if going to a failed state
         */
        if ((mWifiApState == WIFI_AP_STATE_FAILED) && (flag == DriverAction.DRIVER_UNLOAD)) {
            if(SystemProperties.OMAP_ENHANCEMENT) {
            if (SystemProperties.getBoolean("wifi.hotspot.ti", false)) {
                mWifiStateTracker.unloadHotspotDriver();
            } else {
                mWifiStateTracker.unloadDriver();