summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorxshu <xshu@google.com>2019-07-10 18:03:32 -0700
committerxshu <xshu@google.com>2019-07-10 18:03:32 -0700
commit608b03f29d70b6d9055f349dcf194fae0248c9bb (patch)
tree4ac64c71bb4292aa6a7bd8bb64c6571f793a67da /service
parentc23fd06553163353e75ed9b45d2556b5969ed6f0 (diff)
Mask out macRandomizationSetting when feature is unsupported
All wifi networks will use factory MAC to connect when the config_wifi_connected_mac_randomization_supported feature flag is set to false. Making macRandomizationSetting always return "false" in the above case. Bug: 137230966 Test: unit tests Test: manual test on a unsupported device - verifying network details page is always showing the factory MAC address. Change-Id: I3ed8599a7123a084bdf20d8f30ba6dcbcea83356
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index 1d287f02d..bda1eb7d2 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -271,6 +271,7 @@ public class WifiConfigManager {
private final WifiPermissionsUtil mWifiPermissionsUtil;
private final WifiPermissionsWrapper mWifiPermissionsWrapper;
private final WifiInjector mWifiInjector;
+ private boolean mConnectedMacRandomzationSupported;
/**
* Local log used for debugging any WifiConfigManager issues.
@@ -437,6 +438,8 @@ public class WifiConfigManager {
}
});
updatePnoRecencySortingSetting();
+ mConnectedMacRandomzationSupported = mContext.getResources()
+ .getBoolean(R.bool.config_wifi_connected_mac_randomization_supported);
try {
mSystemUiUid = mContext.getPackageManager().getPackageUidAsUser(SYSUI_PACKAGE_NAME,
PackageManager.MATCH_SYSTEM_ONLY, UserHandle.USER_SYSTEM);
@@ -541,6 +544,9 @@ public class WifiConfigManager {
&& targetUid != configuration.creatorUid) {
maskRandomizedMacAddressInWifiConfiguration(network);
}
+ if (!mConnectedMacRandomzationSupported) {
+ network.macRandomizationSetting = WifiConfiguration.RANDOMIZATION_NONE;
+ }
return network;
}