am "get channel list from driver for SoftAP channel selection"
merged from goog/mirror-m-wireless-internal-release
18ae1d2 get channel list from driver for SoftAP channel selection
diff --git a/api/current.txt b/api/current.txt
index 7d5f4b7..dd2555d 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -18470,7 +18470,6 @@
public class WifiConfiguration implements android.os.Parcelable {
ctor public WifiConfiguration();
- method public static int chooseApChannel(int);
method public int describeContents();
method public void writeToParcel(android.os.Parcel, int);
field public java.lang.String BSSID;
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 64931a2..b7acb88 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -1386,14 +1386,8 @@
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", Integer.toString(apChannel),
+ "broadcast", Integer.toString(wifiConfig.apChannel),
getSecurityType(wifiConfig),
new SensitiveArg(wifiConfig.preSharedKey));
}
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index 593af18..2bb1cc5 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -62,8 +62,6 @@
public static final String updateIdentiferVarName = "update_identifier";
/** {@hide} */
public static final int INVALID_NETWORK_ID = -1;
- /**{@hide}*/
- private static Random mRandom = new Random(Calendar.getInstance().getTimeInMillis());
/**
* Recognized key management schemes.
@@ -1448,18 +1446,6 @@
}
}
- public static int chooseApChannel(int apBand) {
- int apChannel;
- if (apBand == 0) {
- apChannel = 1 + mRandom.nextInt(11);
- } else {
- int channel[] = {36,40,44,48,149,153,157,161,165};
- apChannel = channel[mRandom.nextInt(channel.length)];
- }
- Log.d(TAG, "AP set on channel " + apChannel);
- return apChannel;
- }
-
/** @hide */
public int getAuthType() {
if (isValid() == false) {