diff options
author | Oscar Shu <xshu@google.com> | 2020-04-24 04:43:25 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-04-24 04:43:25 +0000 |
commit | 65d9ad5fd183f58dd2a962913148fef1bb612d08 (patch) | |
tree | c2082fd59ae94f1282bb9131cd5fe012fa63c2da /service | |
parent | 67fbe2bf5663042fe4f74074679c9b34990adb4a (diff) | |
parent | 761fec1b48fa7329dc40713ccfe0637dd9dd20a9 (diff) |
Merge "Randomize sta MAC address upon start" into rvc-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index 63ebf9824..cf8acb4f0 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -67,6 +67,7 @@ import android.net.shared.Inet4AddressUtils; import android.net.shared.Layer2Information; import android.net.shared.ProvisioningConfiguration; import android.net.shared.ProvisioningConfiguration.ScanResultInfo; +import android.net.util.MacAddressUtils; import android.net.util.NetUtils; import android.net.wifi.IActionListener; import android.net.wifi.INetworkRequestMatchCallback; @@ -3555,6 +3556,7 @@ public class ClientModeImpl extends StateMachine { mLastSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; mLastSimBasedConnectionCarrierName = null; mLastSignalLevel = -1; + mWifiNative.setMacAddress(mInterfaceName, MacAddressUtils.createRandomUnicastAddress()); mWifiInfo.setMacAddress(mWifiNative.getMacAddress(mInterfaceName)); // TODO: b/79504296 This broadcast has been deprecated and should be removed sendSupplicantConnectionChangedBroadcast(true); |