Add randomized MAC (last used)

Makes it clear that when a network is disconnected, the randomized MAC
address shown is the last used one. (ie. it could change in the next
connection depending on whether enhanced MAC randomization is active)

Bug: 170166681
Test: Manually verified that the new text is shown for disconnected
networks.

Change-Id: I4aec47b2de68c077e6fdc7efa96d39e6666d4c86
This commit is contained in:
xshu
2020-10-05 18:57:27 -07:00
parent ab45ca09bc
commit 19eabbff63
3 changed files with 30 additions and 5 deletions

View File

@@ -814,6 +814,22 @@ public class WifiDetailPreferenceController2Test {
verify(mMockMacAddressPref).setTitle(R.string.wifi_advanced_device_mac_address_title);
}
@Test
public void macAddressPref_shouldVisibleAsRandomizedForConnectedNetwork() {
setUpForConnectedNetwork();
setUpSpyController();
when(mMockWifiEntry.isSaved()).thenReturn(true);
when(mMockWifiEntry.getPrivacy()).thenReturn(WifiEntry.PRIVACY_RANDOMIZED_MAC);
when(mMockWifiEntry.getMacAddress()).thenReturn(RANDOMIZED_MAC_ADDRESS);
displayAndResume();
verify(mMockMacAddressPref).setVisible(true);
verify(mMockMacAddressPref).setSummary(RANDOMIZED_MAC_ADDRESS);
verify(mMockMacAddressPref).setTitle(
R.string.wifi_advanced_randomized_mac_address_title);
}
@Test
public void macAddressPref_shouldVisibleAsRandomizedForDisconnectedNetwork() {
setUpForDisconnectedNetwork();
@@ -825,7 +841,8 @@ public class WifiDetailPreferenceController2Test {
verify(mMockMacAddressPref).setVisible(true);
verify(mMockMacAddressPref).setSummary(RANDOMIZED_MAC_ADDRESS);
verify(mMockMacAddressPref).setTitle(R.string.wifi_advanced_randomized_mac_address_title);
verify(mMockMacAddressPref).setTitle(
R.string.wifi_advanced_randomized_mac_address_disconnected_title);
}
@Test