summaryrefslogtreecommitdiff
path: root/wifi/tests
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
commita996b06b6f28878e29badb9c3f8ac132ec39f86b (patch)
tree7ca40cdfb9e613e4975b4a6c11129d4e322ef297 /wifi/tests
parent80abddc763fd02b773ae86bd904014f124cf2d53 (diff)
Revert "Remove framework code that has moved to frameworks/libs/net"
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: I2824f781babd9f7e0bb9df524dadf6b8397dcaa1
Diffstat (limited to 'wifi/tests')
-rw-r--r--wifi/tests/src/android/net/wifi/WifiConfigurationTest.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java b/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
index 15aa3cc4a355..ba9fc786afe7 100644
--- a/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import android.net.MacAddress;
-import android.net.util.MacAddressUtils;
import android.net.wifi.WifiConfiguration.KeyMgmt;
import android.net.wifi.WifiConfiguration.NetworkSelectionStatus;
import android.os.Parcel;
@@ -63,8 +62,7 @@ public class WifiConfigurationTest {
config.updateIdentifier = "1234";
config.fromWifiNetworkSpecifier = true;
config.fromWifiNetworkSuggestion = true;
- config.setRandomizedMacAddress(MacAddressUtils.createRandomUnicastAddress());
- MacAddress macBeforeParcel = config.getRandomizedMacAddress();
+ MacAddress macBeforeParcel = config.getOrCreateRandomizedMacAddress();
Parcel parcelW = Parcel.obtain();
config.writeToParcel(parcelW, 0);
byte[] bytes = parcelW.marshall();
@@ -77,7 +75,7 @@ public class WifiConfigurationTest {
// lacking a useful config.equals, check two fields near the end.
assertEquals(cookie, reconfig.getMoTree());
- assertEquals(macBeforeParcel, reconfig.getRandomizedMacAddress());
+ assertEquals(macBeforeParcel, reconfig.getOrCreateRandomizedMacAddress());
assertEquals(config.updateIdentifier, reconfig.updateIdentifier);
assertFalse(reconfig.trusted);
assertTrue(config.fromWifiNetworkSpecifier);
@@ -213,7 +211,7 @@ public class WifiConfigurationTest {
MacAddress defaultMac = MacAddress.fromString(WifiInfo.DEFAULT_MAC_ADDRESS);
assertEquals(defaultMac, config.getRandomizedMacAddress());
- MacAddress macToChangeInto = MacAddressUtils.createRandomUnicastAddress();
+ MacAddress macToChangeInto = MacAddress.createRandomUnicastAddress();
config.setRandomizedMacAddress(macToChangeInto);
MacAddress macAfterChange = config.getRandomizedMacAddress();