diff options
author | Steve Kondik <shade@chemlab.org> | 2012-12-20 20:40:52 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-12-20 20:44:05 -0800 |
commit | aa1add7be6c2f16233e67320a2dca996b88f38ce (patch) | |
tree | eac0474baac4490f59448b75ec785c28608c35ba /wifi | |
parent | fa8af946a3057f8d4e1fd4701a312553ec2d1c38 (diff) | |
download | frameworks_base-aa1add7be6c2f16233e67320a2dca996b88f38ce.zip frameworks_base-aa1add7be6c2f16233e67320a2dca996b88f38ce.tar.gz frameworks_base-aa1add7be6c2f16233e67320a2dca996b88f38ce.tar.bz2 |
wifi: Set the mode at native layer
* Set normal/AP mode so that the HAL can specify correct module
arguments when loading the driver.
Change-Id: I6eee2cc53b5f1e70306e252e52c909833f220515
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)); |