From 9133f77f1f0d56eda344fdc62ab11a97293265c1 Mon Sep 17 00:00:00 2001 From: Les Lee Date: Tue, 26 Jul 2022 16:00:09 +0800 Subject: [PATCH] wifi: Fix unnecessary notification after restoring config from cloud. The persistent randomzied MAC address is generated by hash function with key Ssid. It might be different in different device even if the key doesn't be changed. But the persist randomized MAC is not a user setting, it is generated by the frameworks. Ahe user would need to set up the ACL again anyways even if they use factory MAC. So it should not to notify user configuration is changed since it is not a user setting and user aware it since user is using a new device. BUg: 235591501 Test: Manual test, no notification show up. Change-Id: I08fef497df0c42115ee61e92a22009d32666da41 --- .../android/providers/settings/SettingsBackupAgent.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java index 5088533ccdd82..d3afccc9dcb1a 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java @@ -1076,7 +1076,9 @@ public class SettingsBackupAgent extends BackupAgentHelper { SoftApConfiguration storedConfig = mWifiManager.getSoftApConfiguration(); if (isNeedToNotifyUserConfigurationHasChanged(configInCloud, storedConfig)) { - Log.d(TAG, "restored ap configuration requires a conversion, notify the user"); + Log.d(TAG, "restored ap configuration requires a conversion, notify the user" + + ", configInCloud is " + configInCloud + " but storedConfig is " + + storedConfig); WifiSoftApConfigChangedNotifier.notifyUserOfConfigConversion(this); } } @@ -1115,9 +1117,6 @@ public class SettingsBackupAgent extends BackupAgentHelper { == storedConfig.getBridgedModeOpportunisticShutdownTimeoutMillis() && Objects.equals(configInCloud.getVendorElements(), storedConfig.getVendorElements()) - && (configInCloud.getPersistentRandomizedMacAddress() != null - ? Objects.equals(configInCloud.getPersistentRandomizedMacAddress(), - storedConfig.getPersistentRandomizedMacAddress()) : true) && Arrays.equals(configInCloud.getAllowedAcsChannels( SoftApConfiguration.BAND_2GHZ), storedConfig.getAllowedAcsChannels(SoftApConfiguration.BAND_2GHZ))