summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsabelle Taylor <taylori@google.com>2020-02-14 13:09:16 +0000
committerIsabelle Taylor <taylori@google.com>2020-02-14 13:09:16 +0000
commit809f06a078b04f6b3a592340174a183d69a34af6 (patch)
tree02a8c9ebb40ebedbeb566931cbe41f8ae6eeb1b1
parentf6ebba45e7b32cf9a61f0ceeb970d17f5c222f14 (diff)
Revert "Use createRandomUnicastAddress from MacAddressUtils"
Revert "Add net-utils-framework-net to telephony-common" Revert submission 1191997-net-utils-framework-net Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_qt-qpr1-dev-plus-aosp&target=aosp_taimen-userdebug&lkgb=6208131&lkbb=6208273&fkbb=6208273, bug b/149551544 Reverted Changes: Ib1c807d64:Use createRandomUnicastAddress from MacAddressUtil... I9e0f297e0:Add net-utils-framework-net to telephony-common Ieb8927f9a:Remove framework code that has moved to frameworks... Change-Id: Ic3760992d0118ebd2cf8afa149487ed194419dc0
-rw-r--r--tests/wifitests/src/com/android/server/wifi/NetworkRequestStoreDataTest.java16
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiCandidatesTest.java7
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java9
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java6
-rw-r--r--tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java3
5 files changed, 19 insertions, 22 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/NetworkRequestStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/NetworkRequestStoreDataTest.java
index 6147f478a..f40f71bcf 100644
--- a/tests/wifitests/src/com/android/server/wifi/NetworkRequestStoreDataTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/NetworkRequestStoreDataTest.java
@@ -19,7 +19,7 @@ package com.android.server.wifi;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
-import android.net.util.MacAddressUtils;
+import android.net.MacAddress;
import android.net.wifi.WifiConfiguration;
import android.util.Xml;
@@ -113,7 +113,7 @@ public class NetworkRequestStoreDataTest {
AccessPoint accessPoint = new AccessPoint(
WifiConfigurationTestUtil.createPskNetwork().SSID,
- MacAddressUtils.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_PSK);
+ MacAddress.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_PSK);
Set<AccessPoint> accessPoints = new HashSet<AccessPoint>() {{
add(accessPoint);
}};
@@ -131,7 +131,7 @@ public class NetworkRequestStoreDataTest {
AccessPoint accessPoint1 = new AccessPoint(
WifiConfigurationTestUtil.createPskNetwork().SSID,
- MacAddressUtils.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_PSK);
+ MacAddress.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_PSK);
Set<AccessPoint> accessPoints1 = new HashSet<AccessPoint>() {{
add(accessPoint1);
}};
@@ -139,7 +139,7 @@ public class NetworkRequestStoreDataTest {
AccessPoint accessPoint2 = new AccessPoint(
WifiConfigurationTestUtil.createPskNetwork().SSID,
- MacAddressUtils.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_PSK);
+ MacAddress.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_PSK);
Set<AccessPoint> accessPoints2 = new HashSet<AccessPoint>() {{
add(accessPoint2);
}};
@@ -157,10 +157,10 @@ public class NetworkRequestStoreDataTest {
AccessPoint accessPoint1 = new AccessPoint(
WifiConfigurationTestUtil.createPskNetwork().SSID,
- MacAddressUtils.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_PSK);
+ MacAddress.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_PSK);
AccessPoint accessPoint2 = new AccessPoint(
WifiConfigurationTestUtil.createOpenNetwork().SSID,
- MacAddressUtils.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_OPEN);
+ MacAddress.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_OPEN);
Set<AccessPoint> accessPoints1 = new HashSet<AccessPoint>() {{
add(accessPoint1);
add(accessPoint2);
@@ -169,10 +169,10 @@ public class NetworkRequestStoreDataTest {
AccessPoint accessPoint3 = new AccessPoint(
WifiConfigurationTestUtil.createSaeNetwork().SSID,
- MacAddressUtils.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_SAE);
+ MacAddress.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_SAE);
AccessPoint accessPoint4 = new AccessPoint(
WifiConfigurationTestUtil.createOpenNetwork().SSID,
- MacAddressUtils.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_OPEN);
+ MacAddress.createRandomUnicastAddress(), WifiConfiguration.SECURITY_TYPE_OPEN);
Set<AccessPoint> accessPoints2 = new HashSet<AccessPoint>() {{
add(accessPoint3);
add(accessPoint4);
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiCandidatesTest.java b/tests/wifitests/src/com/android/server/wifi/WifiCandidatesTest.java
index 02302a95b..275d90deb 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiCandidatesTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiCandidatesTest.java
@@ -22,7 +22,6 @@ import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import android.net.MacAddress;
-import android.net.util.MacAddressUtils;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
@@ -135,9 +134,9 @@ public class WifiCandidatesTest {
ScanResultMatchInfo matchInfo1Prime = ScanResultMatchInfo.fromWifiConfiguration(mConfig1);
ScanResultMatchInfo matchInfo2 = ScanResultMatchInfo.fromWifiConfiguration(mConfig2);
assertFalse(matchInfo1 == matchInfo1Prime); // Checking assumption
- MacAddress mac1 = MacAddressUtils.createRandomUnicastAddress();
- MacAddress mac2 = MacAddressUtils.createRandomUnicastAddress();
- assertNotEquals(mac1, mac2); // really tiny probability of failing here
+ MacAddress mac1 = MacAddress.createRandomUnicastAddress();
+ MacAddress mac2 = MacAddress.createRandomUnicastAddress();
+ assertNotEquals(mac1, mac2); // really tiny probablility of failing here
WifiCandidates.Key key1 = new WifiCandidates.Key(matchInfo1, mac1, 1);
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
index 2223c196a..686b2098d 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
@@ -31,7 +31,6 @@ import android.content.pm.UserInfo;
import android.database.ContentObserver;
import android.net.IpConfiguration;
import android.net.MacAddress;
-import android.net.util.MacAddressUtils;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiConfiguration.NetworkSelectionStatus;
@@ -1902,7 +1901,7 @@ public class WifiConfigManagerTest {
WifiConfiguration config = WifiConfigurationTestUtil.createOpenNetwork();
NetworkUpdateResult result = verifyAddNetworkToWifiConfigManager(config);
- MacAddress testMac = MacAddressUtils.createRandomUnicastAddress();
+ MacAddress testMac = MacAddress.createRandomUnicastAddress();
mWifiConfigManager.setNetworkRandomizedMacAddress(result.getNetworkId(), testMac);
// Verify that randomized MAC address is masked when obtaining saved networks from
@@ -1949,7 +1948,7 @@ public class WifiConfigManagerTest {
WifiConfiguration config = WifiConfigurationTestUtil.createOpenNetwork();
NetworkUpdateResult result = verifyAddNetworkToWifiConfigManager(config);
- MacAddress testMac = MacAddressUtils.createRandomUnicastAddress();
+ MacAddress testMac = MacAddress.createRandomUnicastAddress();
mWifiConfigManager.setNetworkRandomizedMacAddress(result.getNetworkId(), testMac);
// Verify macRandomizationSetting is not masked out when feature is supported.
@@ -1970,7 +1969,7 @@ public class WifiConfigManagerTest {
WifiConfiguration config = WifiConfigurationTestUtil.createOpenNetwork();
NetworkUpdateResult result = verifyAddNetworkToWifiConfigManager(config);
- MacAddress testMac = MacAddressUtils.createRandomUnicastAddress();
+ MacAddress testMac = MacAddress.createRandomUnicastAddress();
mWifiConfigManager.setNetworkRandomizedMacAddress(result.getNetworkId(), testMac);
// Verify macRandomizationSetting is masked out when feature is unsupported.
@@ -4316,7 +4315,7 @@ public class WifiConfigManagerTest {
// Verify that changing randomized MAC address through setNetworkRandomizedMacAddress
// changes the internal randomized MAC address
- MacAddress newMac = MacAddressUtils.createRandomUnicastAddress();
+ MacAddress newMac = MacAddress.createRandomUnicastAddress();
mWifiConfigManager.setNetworkRandomizedMacAddress(result.getNetworkId(), newMac);
retrievedConfig = mWifiConfigManager
.getConfiguredNetworkWithoutMasking(result.getNetworkId());
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java
index 855000edc..612fdf575 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java
@@ -44,7 +44,7 @@ import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
-import android.net.util.MacAddressUtils;
+import android.net.MacAddress;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiNetworkSuggestion;
@@ -718,7 +718,7 @@ public class WifiNetworkSuggestionsManagerTest {
// Now change the bssid of the scan result to a different value, now only the general
// (without bssid) suggestion.
- scanDetail.getScanResult().BSSID = MacAddressUtils.createRandomUnicastAddress().toString();
+ scanDetail.getScanResult().BSSID = MacAddress.createRandomUnicastAddress().toString();
matchingNetworkSuggestions =
mWifiNetworkSuggestionsManager.getNetworkSuggestionsForScanDetail(scanDetail);
expectedMatchingNetworkSuggestions =
@@ -2174,7 +2174,7 @@ public class WifiNetworkSuggestionsManagerTest {
*/
private ScanDetail createScanDetailForNetwork(WifiConfiguration configuration) {
return WifiConfigurationTestUtil.createScanDetailForNetwork(configuration,
- MacAddressUtils.createRandomUnicastAddress().toString(), -45, 0, 0, 0);
+ MacAddress.createRandomUnicastAddress().toString(), -45, 0, 0, 0);
}
private void validatePostConnectionBroadcastSent(
diff --git a/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java b/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
index 8a2be3a6b..85b4a9370 100644
--- a/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/util/XmlUtilTest.java
@@ -20,7 +20,6 @@ import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import android.net.IpConfiguration;
-import android.net.util.MacAddressUtils;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiConfiguration.NetworkSelectionStatus;
import android.net.wifi.WifiEnterpriseConfig;
@@ -209,7 +208,7 @@ public class XmlUtilTest {
configuration.lastUpdateUid = configuration.lastConnectUid = configuration.creatorUid;
configuration.creatorName = configuration.lastUpdateName = TEST_PACKAGE_NAME;
configuration.creationTime = "04-04-2016";
- configuration.setRandomizedMacAddress(MacAddressUtils.createRandomUnicastAddress());
+ configuration.getOrCreateRandomizedMacAddress();
configuration.macRandomizationSetting = WifiConfiguration.RANDOMIZATION_PERSISTENT;
serializeDeserializeWifiConfigurationForConfigStore(configuration);