|
发表于 2018-4-17 18:11:41
只看该作者
5#
diff --git a/service/java/com/android/server/wifi/SoftApManager.java b/service/java/com/android/server/wifi/SoftApManager.java
index 2dfb754..3e60ede 100644
--- a/service/java/com/android/server/wifi/SoftApManager.java
+++ b/service/java/com/android/server/wifi/SoftApManager.java
@@ -137,12 +137,13 @@ public class SoftApManager {
* Country code is mandatory for 5GHz band, return an error if failed to set
* country code when AP is configured for 5GHz band.
*/
- if (!mWifiNative.setCountryCodeHal(mCountryCode.toUpperCase(Locale.ROOT))
+
+ /*if (!mWifiNative.setCountryCodeHal(mCountryCode.toUpperCase(Locale.ROOT))
&& config.apBand == WifiConfiguration.AP_BAND_5GHZ) {
Log.e(TAG, "Failed to set country code, required for setting up "
+ "soft ap in 5GHz");
return ERROR_GENERIC;
- }
+ }*/
}
try {
diff --git a/service/java/com/android/server/wifi/util/ApConfigUtil.java b/service/java/com/android/server/wifi/util/ApConfigUtil.java
index 7bbbc03..0e12f06 100644
--- a/service/java/com/android/server/wifi/util/ApConfigUtil.java
+++ b/service/java/com/android/server/wifi/util/ApConfigUtil.java
@@ -133,15 +133,14 @@ public class ApConfigUtil {
config.apBand, allowed2GChannels,
wifiNative.getChannelsForBand(WifiScanner.WIFI_BAND_5_GHZ));
if (config.apChannel == -1) {
- if (wifiNative.isGetChannelsForBandSupported()) {
- /* We're not able to get channel when it is supported by HAL. */
- Log.e(TAG, "Failed to get available channel.");
- return ERROR_NO_CHANNEL;
- }
-
/* Use the default for HAL without get channel support. */
- config.apBand = DEFAULT_AP_BAND;
- config.apChannel = DEFAULT_AP_CHANNEL;
+ if (config.apBand == WifiConfiguration.AP_BAND_5GHZ) {
+ Log.e(TAG, "kernel not support,set to chanel 153");
+ config.apChannel = 153;
+ } else {
+ config.apBand = DEFAULT_AP_BAND;
+ config.apChannel = DEFAULT_AP_CHANNEL;
+ }
}
} |
|