diff options
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/WifiNative.java | 2 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateMachine.java | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/wifi/java/android/net/wifi/WifiNative.java b/wifi/java/android/net/wifi/WifiNative.java index 4c5fc5d..54b758a 100644 --- a/wifi/java/android/net/wifi/WifiNative.java +++ b/wifi/java/android/net/wifi/WifiNative.java @@ -798,4 +798,6 @@ public class WifiNative { public boolean p2pServDiscCancelReq(String id) { return doBooleanCommand("P2P_SERV_DISC_CANCEL_REQ " + id); } + + public native static boolean setMode(int mode); } diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index 9a9cad2..26bb095 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -761,6 +761,7 @@ public class WifiStateMachine extends StateMachine { public void setWifiEnabled(boolean enable) { mLastEnableUid.set(Binder.getCallingUid()); if (enable) { + WifiNative.setMode(0); /* Argument is the state that is entered prior to load */ sendMessage(obtainMessage(CMD_LOAD_DRIVER, WIFI_STATE_ENABLING, 0)); sendMessage(CMD_START_SUPPLICANT); @@ -777,6 +778,7 @@ public class WifiStateMachine extends StateMachine { public void setWifiApEnabled(WifiConfiguration wifiConfig, boolean enable) { mLastApEnableUid.set(Binder.getCallingUid()); if (enable) { + WifiNative.setMode(1); /* Argument is the state that is entered prior to load */ sendMessage(obtainMessage(CMD_LOAD_DRIVER, WIFI_AP_STATE_ENABLING, 0)); sendMessage(obtainMessage(CMD_START_AP, wifiConfig)); |