summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorOscar Shu <xshu@google.com>2020-04-24 04:43:25 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-04-24 04:43:25 +0000
commit65d9ad5fd183f58dd2a962913148fef1bb612d08 (patch)
treec2082fd59ae94f1282bb9131cd5fe012fa63c2da /service
parent67fbe2bf5663042fe4f74074679c9b34990adb4a (diff)
parent761fec1b48fa7329dc40713ccfe0637dd9dd20a9 (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.java2
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);