Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f73d65c9 authored by Quang Luong's avatar Quang Luong
Browse files

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
parent 66b0cabf
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -682,8 +682,12 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
        }

        mMacAddressPref.setVisible(true);
        if (macAddress.equals(WifiInfo.DEFAULT_MAC_ADDRESS)) {
            mMacAddressPref.setSummary(R.string.device_info_not_available);
        } else {
            mMacAddressPref.setSummary(macAddress);
        }
    }

    private String getMacAddress() {
        if (mWifiInfo != null) {
+1 −1
Original line number Diff line number Diff line
@@ -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";