diff options
author | Roshan Pius <rpius@google.com> | 2019-10-30 09:11:44 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2019-11-07 11:08:35 -0800 |
commit | efc08d99de7aa84490fa26b76312bf7877814e1f (patch) | |
tree | fd8d14aaab81497b1ba023c4152370cb6c1a3591 /service | |
parent | edd9332616700a2de9e2403fe30b1f39358a3323 (diff) |
WifiService: Add @SystemApi for STA/AP MAC randomization
This ensures that we don't use wifi overlays in settings.
Bug: 143464763
Test: atest com.android.server.wifi
Change-Id: I87ba1e05741efcaf8505ac3730d936b8b1d29e28
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index 48c387c64..87c7e049a 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -1611,10 +1611,25 @@ public class ClientModeImpl extends StateMachine { boolean rttSupported = mContext.getPackageManager().hasSystemFeature( PackageManager.FEATURE_WIFI_RTT); if (!rttSupported) { + // flags filled in by vendor HAL, remove if overlay disables it. supportedFeatureSet &= ~(WifiManager.WIFI_FEATURE_D2D_RTT | WifiManager.WIFI_FEATURE_D2AP_RTT); } - + if (!mContext.getResources().getBoolean( + R.bool.config_wifi_p2p_mac_randomization_supported)) { + // flags filled in by vendor HAL, remove if overlay disables it. + supportedFeatureSet &= ~WifiManager.WIFI_FEATURE_P2P_RAND_MAC; + } + if (mContext.getResources().getBoolean( + R.bool.config_wifi_connected_mac_randomization_supported)) { + // no corresponding flags in vendor HAL, set if overlay enables it. + supportedFeatureSet |= WifiManager.WIFI_FEATURE_CONNECTED_RAND_MAC; + } + if (mContext.getResources().getBoolean( + R.bool.config_wifi_ap_mac_randomization_supported)) { + // no corresponding flags in vendor HAL, set if overlay enables it. + supportedFeatureSet |= WifiManager.WIFI_FEATURE_AP_RAND_MAC; + } return supportedFeatureSet; } |