summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbelgin <belginstirbu@hotmail.com>2021-03-26 12:09:12 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-03-28 19:57:20 +0200
commita99fbede6fcf727bc47dfa8f957e527854df8ddf (patch)
treee2381f5017a8f6fb880957bd1299916d78ede2e3
parent94f9a24b15cffdb1920ff2cef3edc30ed3373ddd (diff)
downloadframeworks_opt_net_wifi-replicant-6.0.tar.gz
frameworks_opt_net_wifi-replicant-6.0.tar.bz2
frameworks_opt_net_wifi-replicant-6.0.zip
Wifi: Enable hotspot functionality with external Wifi donglereplicant-6.0
The Android wifi state machine checks if the propietary firmware can be loaded, and uses that. Otherwise, this patch makes it so it tries to enable the hostapd daemon anyway, which, if you have a supported wifi dongle connected, will enable the hotspot. If no firmware and no wifi dongle is found, the wifi state machine will cause the Android UI to say "Turning hotspost on..." forever until the user turns it off, but obviously, hotspot won't work. Signed-off-by: belgin <belginstirbu@hotmail.com>
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index 6d9c0d0..00b73a7 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -6128,15 +6128,18 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiPno
case CMD_START_AP:
if (mWifiNative.loadDriver() == false) {
loge("Failed to load driver for softap");
+ loge("trying to load external wifi dongle");
+ }
+ mP2pSupported = false;
+ mWifiMonitor.killSupplicant(mP2pSupported);
+
+ if (enableSoftAp() == true) {
+ setWifiApState(WIFI_AP_STATE_ENABLING, 0);
+ transitionTo(mSoftApStartingState);
} else {
- if (enableSoftAp() == true) {
- setWifiApState(WIFI_AP_STATE_ENABLING, 0);
- transitionTo(mSoftApStartingState);
- } else {
- setWifiApState(WIFI_AP_STATE_FAILED,
- WifiManager.SAP_START_FAILURE_GENERAL);
- transitionTo(mInitialState);
- }
+ setWifiApState(WIFI_AP_STATE_FAILED,
+ WifiManager.SAP_START_FAILURE_GENERAL);
+ transitionTo(mInitialState);
}
break;
default: