Default MAC address should display "Not Available" in network details
For saved networks that do not have a MAC address available in their WifiConfiguration such as Passpoint networks, the MAC address will be the default value of 20:00:00:00:00:00. In this case, display "Not Available" as the summary of the MAC address preference. Bug: 137282522 Test: atest WifiDetailPreferenceControllerTest && manual - open saved passpoint network details while disconnected but in range and observe MAC address preference. Change-Id: Ie9010b0430726de8105852ae2afe10047dcc3676
This commit is contained in:
@@ -682,7 +682,11 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
|
||||
}
|
||||
|
||||
mMacAddressPref.setVisible(true);
|
||||
mMacAddressPref.setSummary(macAddress);
|
||||
if (macAddress.equals(WifiInfo.DEFAULT_MAC_ADDRESS)) {
|
||||
mMacAddressPref.setSummary(R.string.device_info_not_available);
|
||||
} else {
|
||||
mMacAddressPref.setSummary(macAddress);
|
||||
}
|
||||
}
|
||||
|
||||
private String getMacAddress() {
|
||||
|
@@ -114,7 +114,7 @@ public class WifiDetailPreferenceControllerTest {
|
||||
private static final int TX_LINK_SPEED = 123;
|
||||
private static final int RX_LINK_SPEED = 54;
|
||||
private static final String SSID = "ssid";
|
||||
private static final String MAC_ADDRESS = WifiInfo.DEFAULT_MAC_ADDRESS;
|
||||
private static final String MAC_ADDRESS = "01:23:45:67:89:ab";
|
||||
private static final String RANDOMIZED_MAC_ADDRESS = "RANDOMIZED_MAC_ADDRESS";
|
||||
private static final String FACTORY_MAC_ADDRESS = "FACTORY_MAC_ADDRESS";
|
||||
private static final String SECURITY = "None";
|
||||
|
Reference in New Issue
Block a user