Settings: remove usage of WifiConfig helper methods

These methods can be replaced with methods on
IpConfiguration itself. There is no need to expose
these as a @SystemApi, and they are being removed.

Bug: 146046526
Test: make RunSettingsRoboTests -j40
Change-Id: I592f277f5e23bf58e76b8c48a0f0370d53cc6b81
This commit is contained in:
David Su
2020-01-29 18:16:08 -08:00
parent 8ad24a25ad
commit 59ab4ce478
4 changed files with 22 additions and 10 deletions

View File

@@ -304,11 +304,12 @@ public class WifiConfigController2 implements TextWatcher,
}
mPrivacySettingsSpinner.setSelection(prefMacValue);
if (config.getIpAssignment() == IpAssignment.STATIC) {
if (config.getIpConfiguration().getIpAssignment() == IpAssignment.STATIC) {
mIpSettingsSpinner.setSelection(STATIC_IP);
showAdvancedFields = true;
// Display IP address.
StaticIpConfiguration staticConfig = config.getStaticIpConfiguration();
StaticIpConfiguration staticConfig = config.getIpConfiguration()
.getStaticIpConfiguration();
if (staticConfig != null && staticConfig.ipAddress != null) {
addRow(group, R.string.wifi_ip_address,
staticConfig.ipAddress.getAddress().getHostAddress());
@@ -322,10 +323,11 @@ public class WifiConfigController2 implements TextWatcher,
showAdvancedFields = true;
}
if (config.getProxySettings() == ProxySettings.STATIC) {
ProxySettings proxySettings = config.getIpConfiguration().getProxySettings();
if (proxySettings == ProxySettings.STATIC) {
mProxySettingsSpinner.setSelection(PROXY_STATIC);
showAdvancedFields = true;
} else if (config.getProxySettings() == ProxySettings.PAC) {
} else if (proxySettings == ProxySettings.PAC) {
mProxySettingsSpinner.setSelection(PROXY_PAC);
showAdvancedFields = true;
} else {
@@ -1328,7 +1330,8 @@ public class WifiConfigController2 implements TextWatcher,
mDns2View.addTextChangedListener(this);
}
if (config != null) {
StaticIpConfiguration staticConfig = config.getStaticIpConfiguration();
StaticIpConfiguration staticConfig = config.getIpConfiguration()
.getStaticIpConfiguration();
if (staticConfig != null) {
if (staticConfig.ipAddress != null) {
mIpAddressView.setText(