From a0be0fb2709124a567f89114b1d8e80f74452edc Mon Sep 17 00:00:00 2001 From: xinhe Date: Wed, 7 Jan 2015 17:57:38 -0800 Subject: set softAP on a specified band, including both 2.4 and 5 GHz band Bug:18929692 Change-Id: I6109b477937b0ecab95f5a2b414f2bec9b30e1cd --- .../core/java/com/android/server/NetworkManagementService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'services') 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"); -- cgit v1.1