[Wi-Fi] Wrong MAC address shown in Settings.
The MAC addresses in "About phone" and "Saved networks" may be different because of new Randomized MAC mechanism. 1.Add new UIs to guide users to saved network and use different titles to show different conditions. 2.Remove MAC address and IP fields in WifiPreference by new design. Bug: 133466540 Test: add test case to check if the title changed according to the privacy level. Change-Id: Idb5972dc2565f6fe58a83f6aa7124abbc035888f
This commit is contained in:
@@ -687,6 +687,9 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
|
||||
} else {
|
||||
mMacAddressPref.setSummary(macAddress);
|
||||
}
|
||||
|
||||
// MAC Address Pref Title
|
||||
refreshMacTitle();
|
||||
}
|
||||
|
||||
private String getMacAddress() {
|
||||
@@ -1141,4 +1144,24 @@ public class WifiDetailPreferenceController extends AbstractPreferenceController
|
||||
mTimer.cancel();
|
||||
mTimer = null;
|
||||
}
|
||||
|
||||
private void refreshMacTitle() {
|
||||
if (mWifiConfig == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// For saved Passpoint network, framework doesn't have the field to keep the MAC choice
|
||||
// persistently, so Passpoint network will always use the default value so far, which is
|
||||
// randomized MAC address, so don't need to modify title.
|
||||
if (mAccessPoint.isPasspoint() || mAccessPoint.isPasspointConfig()) {
|
||||
return;
|
||||
}
|
||||
|
||||
mMacAddressPref.setTitle(
|
||||
(mWifiConfig.macRandomizationSetting
|
||||
== WifiConfiguration.RANDOMIZATION_PERSISTENT)
|
||||
? R.string.wifi_advanced_randomized_mac_address_title
|
||||
: R.string.wifi_advanced_factory_mac_address_title);
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user