Prevent unnecessary reconnection for wifi privacy
Before fix, privacy toggle in the Network details page causes a disconnection + reconnection even when selecting the same setting. Check current setting first to prevent unnecessary reconnection. Fix: 303093138 Test: manual - select same privacy setting Test: unit test Change-Id: I71208e3cd256fdc0dd5e895fa1a68fdab47aed9a
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user