From ebe8480d17af649474b9dd03ce78e76064be23ea Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 30 Apr 2020 11:18:22 -0700 Subject: ClientModeImpl: Only randomize MAC address at start if feature enabled Bug: 155014563 Test: atest com.android.server.wifi Change-Id: Iba72b268387c5c1c6fd9e90fddbcea695ba3cc88 --- service/java/com/android/server/wifi/ClientModeImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index 7314bb853..49edc366a 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -3585,7 +3585,9 @@ public class ClientModeImpl extends StateMachine { mLastSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; mLastSimBasedConnectionCarrierName = null; mLastSignalLevel = -1; - mWifiNative.setMacAddress(mInterfaceName, MacAddressUtils.createRandomUnicastAddress()); + if (isConnectedMacRandomizationEnabled()) { + mWifiNative.setMacAddress(mInterfaceName, MacAddressUtils.createRandomUnicastAddress()); + } mWifiInfo.setMacAddress(mWifiNative.getMacAddress(mInterfaceName)); // TODO: b/79504296 This broadcast has been deprecated and should be removed sendSupplicantConnectionChangedBroadcast(true); -- cgit v1.2.3