Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cb5e4d7 authored by Vinit Deshpande's avatar Vinit Deshpande
Browse files

am "get channel list from driver for SoftAP channel selection"

merged from partner/m-wireless-wifi-dev
18ae1d22 get channel list from driver for SoftAP channel selection
parents 76f9acee 18ae1d22
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -17897,7 +17897,6 @@ package android.net.wifi {
  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;
+1 −7
Original line number Diff line number Diff line
@@ -1373,14 +1373,8 @@ 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", Integer.toString(apChannel),
                                   "broadcast", Integer.toString(wifiConfig.apChannel),
                                   getSecurityType(wifiConfig),
                                   new SensitiveArg(wifiConfig.preSharedKey));
            }
+0 −14
Original line number Diff line number Diff line
@@ -62,8 +62,6 @@ public class WifiConfiguration implements Parcelable {
    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.
@@ -1374,18 +1372,6 @@ public class WifiConfiguration implements Parcelable {
        }
    }

    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) {