Merge "Prevent unnecessary reconnection for wifi privacy" into main

This commit is contained in:
Chaohui Wang
2023-10-13 07:08:45 +00:00
committed by Android (Google) Code Review
3 changed files with 147 additions and 124 deletions

View File

@@ -72,6 +72,10 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
@Override
public boolean onPreferenceChange(@NonNull Preference preference, Object newValue) {
final int privacy = Integer.parseInt((String) newValue);
if (mWifiEntry.getPrivacy() == privacy) {
// Prevent disconnection + reconnection if settings not changed.
return true;
}
mWifiEntry.setPrivacy(privacy);
// To activate changing, we need to reconnect network. WiFi will auto connect to