Disable hidden network spinner on existing networks

We only want this to be modifiable if you are adding a network
manually, so this CL disables it for existing networks. You
can still see what the spinner is set to though.

Test: robotests
Bug: 78436456
Change-Id: If660e432eca2dabf5bd16881368657ee89fe5a57
This commit is contained in:
Salvador Martinez
2018-04-23 10:50:22 -07:00
parent 8a3bcaa3e3
commit 35b76437e0
2 changed files with 13 additions and 0 deletions

View File

@@ -220,6 +220,7 @@ public class WifiConfigController implements TextWatcher,
mMeteredSettingsSpinner = mView.findViewById(R.id.metered_settings);
mHiddenSettingsSpinner = mView.findViewById(R.id.hidden_settings);
mHiddenSettingsSpinner.setOnItemSelectedListener(this);
mHiddenSettingsSpinner.setEnabled(false);
mHiddenWarningView = mView.findViewById(R.id.hidden_settings_warning);
mHiddenWarningView.setVisibility(
mHiddenSettingsSpinner.getSelectedItemPosition() == NOT_HIDDEN_NETWORK
@@ -238,6 +239,8 @@ public class WifiConfigController implements TextWatcher,
showIpConfigFields();
showProxyFields();
mView.findViewById(R.id.wifi_advanced_toggle).setVisibility(View.VISIBLE);
// Hidden option can be changed only when the user adds a network manually.
mHiddenSettingsSpinner.setEnabled(true);
((CheckBox) mView.findViewById(R.id.wifi_advanced_togglebox))
.setOnCheckedChangeListener(this);