summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorlesl <lesl@google.com>2020-03-11 19:24:59 +0800
committerlesl <lesl@google.com>2020-03-13 14:43:51 +0800
commitcca51e5095a8f4ce69fccd189ed0ddbcd5d0ae5b (patch)
treef252f321dc1eedd18affb355b770d0087f77ad65 /service
parent769db08ae612baae7f54442b0e42fca644e07f5c (diff)
wifi: fix setChannel doesn't work when ACS enable
Bug: 151204145 Test: atest frameworks/opt/net/wifi/tests/wifitests/ Change-Id: Ide4b134cf4001868e533fdad6483e987e191b6f8
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/HostapdHal.java16
1 files changed, 6 insertions, 10 deletions
diff --git a/service/java/com/android/server/wifi/HostapdHal.java b/service/java/com/android/server/wifi/HostapdHal.java
index e6f797796..418fde66f 100644
--- a/service/java/com/android/server/wifi/HostapdHal.java
+++ b/service/java/com/android/server/wifi/HostapdHal.java
@@ -420,19 +420,15 @@ public class HostapdHal {
mContext.getResources().getBoolean(
R.bool.config_wifi_softap_ieee80211ac_supported);
int band;
- if (mForceApChannel) {
- ifaceParams.channelParams.enableAcs = false;
- ifaceParams.channelParams.channel = mForcedApChannel;
- band = mForcedApBand;
- } else if (ApConfigUtil.isAcsSupported(mContext)) {
+ boolean enableAcs = ApConfigUtil.isAcsSupported(mContext) && config.getChannel() == 0
+ && !mForceApChannel;
+ if (enableAcs) {
ifaceParams.channelParams.enableAcs = true;
ifaceParams.channelParams.acsShouldExcludeDfs = true;
- band = config.getBand();
- } else {
- ifaceParams.channelParams.enableAcs = false;
- ifaceParams.channelParams.channel = config.getChannel();
- band = config.getBand();
}
+ ifaceParams.channelParams.channel =
+ mForceApChannel ? mForcedApChannel : config.getChannel();
+ band = mForceApChannel ? mForcedApBand : config.getBand();
android.hardware.wifi.hostapd.V1_2.IHostapd.NetworkParams nwParamsV1_2 =
prepareNetworkParams(config);