summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
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");