diff options
author | Roshan Pius <rpius@google.com> | 2020-04-16 15:56:41 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2020-04-16 18:04:59 -0700 |
commit | a041df63c050ceb4b6abccd9971dc6e9555a1633 (patch) | |
tree | a969f6bd7f54a02b47f89585a6c244111476a2ae | |
parent | a3445309216d2c99eb552e6be6a214e641aff84f (diff) |
ClientModeImpl: Remove call to setScanningMacOui
Bug: 154267383
Test: Device boots up and connects to wifi networks.
Change-Id: Ieddb7057ecdf1f76c52c1f843d392a5854d9acb7
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 16 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiNative.java | 13 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiVendorHal.java | 27 | ||||
-rw-r--r-- | service/res/values/config.xml | 2 | ||||
-rw-r--r-- | service/res/values/overlayable.xml | 1 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java | 24 |
6 files changed, 0 insertions, 83 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index 99fa7f585..9b2c0dc04 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -1197,21 +1197,6 @@ public class ClientModeImpl extends StateMachine { mWifiDataStall.enableVerboseLogging(mVerboseLoggingEnabled); } - private boolean setRandomMacOui() { - String oui = mContext.getResources().getString(R.string.config_wifi_random_mac_oui); - if (TextUtils.isEmpty(oui)) { - oui = GOOGLE_OUI; - } - String[] ouiParts = oui.split("-"); - byte[] ouiBytes = new byte[3]; - ouiBytes[0] = (byte) (Integer.parseInt(ouiParts[0], 16) & 0xFF); - ouiBytes[1] = (byte) (Integer.parseInt(ouiParts[1], 16) & 0xFF); - ouiBytes[2] = (byte) (Integer.parseInt(ouiParts[2], 16) & 0xFF); - - logd("Setting OUI to " + oui); - return mWifiNative.setScanningMacOui(mInterfaceName, ouiBytes); - } - /** * Initiates connection to a network specified by the user/app. This method checks if the * requesting app holds the NETWORK_SETTINGS permission. @@ -3561,7 +3546,6 @@ public class ClientModeImpl extends StateMachine { mWifiNative.setExternalSim(mInterfaceName, true); - setRandomMacOui(); mCountryCode.setReadyForChange(true); mWifiDiagnostics.startPktFateMonitoring(mInterfaceName); diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java index fa1295dd2..20701ca6a 100644 --- a/service/java/com/android/server/wifi/WifiNative.java +++ b/service/java/com/android/server/wifi/WifiNative.java @@ -2911,19 +2911,6 @@ public class WifiNative { } /** - * Set the MAC OUI during scanning. - * An OUI {Organizationally Unique Identifier} is a 24-bit number that - * uniquely identifies a vendor or manufacturer. - * - * @param ifaceName Name of the interface. - * @param oui OUI to set. - * @return true for success - */ - public boolean setScanningMacOui(@NonNull String ifaceName, byte[] oui) { - return mWifiVendorHal.setScanningMacOui(ifaceName, oui); - } - - /** * Get the APF (Android Packet Filter) capabilities of the device * @param ifaceName Name of the interface. */ diff --git a/service/java/com/android/server/wifi/WifiVendorHal.java b/service/java/com/android/server/wifi/WifiVendorHal.java index f01f9a94c..d85d535fa 100644 --- a/service/java/com/android/server/wifi/WifiVendorHal.java +++ b/service/java/com/android/server/wifi/WifiVendorHal.java @@ -1299,33 +1299,6 @@ public class WifiVendorHal { } /** - * Set the MAC OUI during scanning. - * <p> - * An OUI {Organizationally Unique Identifier} is a 24-bit number that - * uniquely identifies a vendor or manufacturer. - * - * @param ifaceName Name of the interface. - * @param oui - * @return true for success - */ - public boolean setScanningMacOui(@NonNull String ifaceName, byte[] oui) { - if (oui == null) return boolResult(false); - if (oui.length != 3) return boolResult(false); - synchronized (sLock) { - try { - IWifiStaIface iface = getStaIface(ifaceName); - if (iface == null) return boolResult(false); - WifiStatus status = iface.setScanningMacOui(oui); - if (!ok(status)) return false; - return true; - } catch (RemoteException e) { - handleRemoteException(e); - return false; - } - } - } - - /** * Set Mac address on the given interface * * @param ifaceName Name of the interface diff --git a/service/res/values/config.xml b/service/res/values/config.xml index 0c88a258b..c58ab196b 100644 --- a/service/res/values/config.xml +++ b/service/res/values/config.xml @@ -137,8 +137,6 @@ <!-- Integer indicating maximum hardware supported client number of soft ap --> <integer translatable="false" name="config_wifiHardwareSoftapMaxClientCount">16</integer> - <string translatable="false" name="config_wifi_random_mac_oui">DA-A1-19</string> - <!-- List of allowed channels in 2GHz band for softap. If the device doesn't want to restrict channels this should be empty. Values is a comma separated channel string and/or channel range string like '1-6,11'. --> diff --git a/service/res/values/overlayable.xml b/service/res/values/overlayable.xml index 06ae35b8c..687b6b9e8 100644 --- a/service/res/values/overlayable.xml +++ b/service/res/values/overlayable.xml @@ -57,7 +57,6 @@ <item type="integer" name="config_wifiFrameworkScoreLowRssiThreshold6ghz" /> <item type="integer" name="config_wifiFrameworkScoreGoodRssiThreshold6ghz" /> <item type="integer" name="config_wifiFrameworkSoftApShutDownTimeoutMilliseconds" /> - <item type="string" name="config_wifi_random_mac_oui" /> <item type="string" name="config_wifiSoftap2gChannelList" /> <item type="string" name="config_wifiSoftap5gChannelList" /> <item type="string" name="config_wifiSoftap6gChannelList" /> diff --git a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java index 2cdcf2dda..363ae6923 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java @@ -1211,30 +1211,6 @@ public class WifiVendorHalTest extends WifiBaseTest { assertEquals(2, ex); } - /** - * Test that setScanningMacOui is hooked up to the HAL correctly - */ - @Test - public void testSetScanningMacOui() throws Exception { - byte[] oui = NativeUtil.macAddressOuiToByteArray("DA:A1:19"); - byte[] zzz = NativeUtil.macAddressOuiToByteArray("00:00:00"); - - when(mIWifiStaIface.setScanningMacOui(any())).thenReturn(mWifiStatusSuccess); - - // expect fail - STA not started - assertFalse(mWifiVendorHal.setScanningMacOui(TEST_IFACE_NAME, oui)); - assertTrue(mWifiVendorHal.startVendorHalSta()); - // expect fail - null - assertFalse(mWifiVendorHal.setScanningMacOui(TEST_IFACE_NAME, null)); - // expect fail - len - assertFalse(mWifiVendorHal.setScanningMacOui(TEST_IFACE_NAME, new byte[]{(byte) 1})); - assertTrue(mWifiVendorHal.setScanningMacOui(TEST_IFACE_NAME, oui)); - assertTrue(mWifiVendorHal.setScanningMacOui(TEST_IFACE_NAME, zzz)); - - verify(mIWifiStaIface).setScanningMacOui(eq(oui)); - verify(mIWifiStaIface).setScanningMacOui(eq(zzz)); - } - @Test public void testStartSendingOffloadedPacket() throws Exception { byte[] srcMac = NativeUtil.macAddressToByteArray("4007b2088c81"); |