wifi: managed Passpoint configurations in "Saved Networks" page

Instead of going through WifiTracker to retrieve saved network
configurations (including both WiFi networks and Passpoint provider
configurations), use the WifiManager's APIs to retrieve the
configurations directly, to avoid any unnecessary complexities.

Also update to use the appropriate APIs for configuration removal
based on the configuration type.

Bug: 34207710
Test: manual test by removing a Passpoint configuration from
      "Saved Networks" page.

Change-Id: I549cc484d8825b6c38895428c1b7941390bb5f1f
This commit is contained in:
Peter Qiu
2017-03-14 15:53:20 -07:00
parent 32924e2f58
commit ae727fbb73
2 changed files with 58 additions and 8 deletions

View File

@@ -217,7 +217,11 @@ public class WifiConfigController implements TextWatcher,
mConfigUi.setSubmitButton(res.getString(R.string.wifi_save));
} else {
mConfigUi.setTitle(mAccessPoint.getSsid());
if (!mAccessPoint.isPasspointConfig()) {
mConfigUi.setTitle(mAccessPoint.getSsid());
} else {
mConfigUi.setTitle(mAccessPoint.getConfigName());
}
ViewGroup group = (ViewGroup) mView.findViewById(R.id.info);
@@ -258,7 +262,8 @@ public class WifiConfigController implements TextWatcher,
}
}
if ((!mAccessPoint.isSaved() && !mAccessPoint.isActive())
if ((!mAccessPoint.isSaved() && !mAccessPoint.isActive()
&& !mAccessPoint.isPasspointConfig())
|| mMode != WifiConfigUiBase.MODE_VIEW) {
showSecurityFields();
showIpConfigFields();
@@ -326,7 +331,8 @@ public class WifiConfigController implements TextWatcher,
addRow(group, R.string.wifi_security, mAccessPoint.getSecurityString(false));
mView.findViewById(R.id.ip_fields).setVisibility(View.GONE);
}
if (mAccessPoint.isSaved() || mAccessPoint.isActive()) {
if (mAccessPoint.isSaved() || mAccessPoint.isActive()
|| mAccessPoint.isPasspointConfig()) {
mConfigUi.setForgetButton(res.getString(R.string.wifi_forget));
}
}