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

Commit ae2715b4 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge changes from topic 'am-6e32dc27f0314ee78cc61c474b61ed96' into nyc-mr1-dev-plus-aosp

* changes:
  Merge changes from topic 'remove-set-frequency-band' am: 430904a4 am: 5135fb8f am: 4fd00327
  Remove ability to set frequency from WifiAssociationTest am: 93ce6376 am: 4bec7b53 am: a04b2b5f
  Remove WifiManager#get/setFrequencyBand am: 79ec1736 am: a7394a4a am: af51ffe8
parents c6bbbedd 8897ad18
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -63,11 +63,6 @@ public class WifiAssociationTest extends ConnectivityManagerTestBase {

        String password = arguments.getString("password");

        String freqStr = arguments.getString("frequency-band");
        if (freqStr != null) {
            setFrequencyBand(freqStr);
        }

        assertTrue("enable Wifi failed", enableWifi());
        WifiInfo wi = mWifiManager.getConnectionInfo();
        logv("%s", wi);
@@ -79,28 +74,6 @@ public class WifiAssociationTest extends ConnectivityManagerTestBase {
        connectToWifi(config);
    }

    /**
     * Set the frequency band and verify that it has been set.
     */
    private void setFrequencyBand(String frequencyBandStr) {
        int frequencyBand = -1;
        if ("2.4".equals(frequencyBandStr)) {
            frequencyBand = WifiManager.WIFI_FREQUENCY_BAND_2GHZ;
        } else if ("5.0".equals(frequencyBandStr)) {
            frequencyBand = WifiManager.WIFI_FREQUENCY_BAND_5GHZ;
        } else if ("auto".equals(frequencyBandStr)) {
            frequencyBand = WifiManager.WIFI_FREQUENCY_BAND_AUTO;
        } else {
            fail("Invalid frequency-band");
        }
        if (mWifiManager.getFrequencyBand() != frequencyBand) {
            logv("Set frequency band to %s", frequencyBandStr);
            mWifiManager.setFrequencyBand(frequencyBand, true);
        }
        assertEquals("Specified frequency band does not match operational band",
                frequencyBand, mWifiManager.getFrequencyBand());
    }

    /**
     * Get the {@link WifiConfiguration} based on ssid, security, and password.
     */
+0 −4
Original line number Diff line number Diff line
@@ -97,10 +97,6 @@ interface IWifiManager

    String getCountryCode();

    void setFrequencyBand(int band, boolean persist);

    int getFrequencyBand();

    boolean isDualBandSupported();

    boolean saveConfiguration();
+0 −34
Original line number Diff line number Diff line
@@ -1377,40 +1377,6 @@ public class WifiManager {
       }
    }

    /**
     * Set the operational frequency band.
     * @param band  One of
     *     {@link #WIFI_FREQUENCY_BAND_AUTO},
     *     {@link #WIFI_FREQUENCY_BAND_5GHZ},
     *     {@link #WIFI_FREQUENCY_BAND_2GHZ},
     * @param persist {@code true} if this needs to be remembered
     * @hide
     */
    public void setFrequencyBand(int band, boolean persist) {
        try {
            mService.setFrequencyBand(band, persist);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Get the operational frequency band.
     * @return One of
     *     {@link #WIFI_FREQUENCY_BAND_AUTO},
     *     {@link #WIFI_FREQUENCY_BAND_5GHZ},
     *     {@link #WIFI_FREQUENCY_BAND_2GHZ} or
     *     {@code -1} on failure.
     * @hide
     */
    public int getFrequencyBand() {
        try {
            return mService.getFrequencyBand();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Check if the chipset supports dual frequency band (2.4 GHz and 5 GHz)
     * @return {@code true} if supported, {@code false} otherwise.