Merge "Assign StaticIpConfiguration builder value to global variable" into sc-dev

This commit is contained in:
Betty Chang
2021-05-04 14:04:56 +00:00
committed by Android (Google) Code Review

View File

@@ -923,7 +923,6 @@ public class WifiConfigController2 implements TextWatcher,
return R.string.wifi_ip_settings_invalid_dns; return R.string.wifi_ip_settings_invalid_dns;
} }
dnsServers.add(dnsAddr); dnsServers.add(dnsAddr);
staticIpConfiguration.getDnsServers().add(dnsAddr);
} }
if (mDns2View.length() > 0) { if (mDns2View.length() > 0) {
@@ -933,14 +932,13 @@ public class WifiConfigController2 implements TextWatcher,
return R.string.wifi_ip_settings_invalid_dns; return R.string.wifi_ip_settings_invalid_dns;
} }
dnsServers.add(dnsAddr); dnsServers.add(dnsAddr);
staticIpConfiguration.getDnsServers().add(dnsAddr);
} }
staticIPBuilder.setDnsServers(dnsServers); staticIPBuilder.setDnsServers(dnsServers);
return 0; return 0;
} finally { } finally {
// Caller of this method may rely on staticIpConfiguration, so build the final result // Caller of this method may rely on staticIpConfiguration, so build the final result
// at the end of the method. // at the end of the method.
staticIpConfiguration = staticIPBuilder.build(); mStaticIpConfiguration = staticIPBuilder.build();
} }
} }