summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorxinhe <xinhe@google.com>2015-01-07 17:57:38 -0800
committerxinhe <xinhe@google.com>2015-01-16 10:53:15 -0800
commita0be0fb2709124a567f89114b1d8e80f74452edc (patch)
tree93eca9ce09aee13d1aaffc615fdd9611a67ac2cb /services
parenta33424a540ea725d4b513ee713931c66e62721a2 (diff)
downloadframeworks_base-a0be0fb2709124a567f89114b1d8e80f74452edc.zip
frameworks_base-a0be0fb2709124a567f89114b1d8e80f74452edc.tar.gz
frameworks_base-a0be0fb2709124a567f89114b1d8e80f74452edc.tar.bz2
set softAP on a specified band, including both 2.4 and 5 GHz band
Bug:18929692 Change-Id: I6109b477937b0ecab95f5a2b414f2bec9b30e1cd
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/NetworkManagementService.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 748018d..891f572 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -1352,8 +1352,15 @@ public class NetworkManagementService extends INetworkManagementService.Stub
if (wifiConfig == null) {
mConnector.execute("softap", "set", wlanIface);
} else {
+ int apChannel;
+ if (wifiConfig.apChannel == 0) {
+ apChannel = WifiConfiguration.chooseApChannel(wifiConfig.apBand);
+ } else {
+ apChannel = wifiConfig.apChannel;
+ }
mConnector.execute("softap", "set", wlanIface, wifiConfig.SSID,
- "broadcast", "6", getSecurityType(wifiConfig),
+ "broadcast", Integer.toString(apChannel),
+ getSecurityType(wifiConfig),
new SensitiveArg(wifiConfig.preSharedKey));
}
mConnector.execute("softap", "startap");