Merge "wifi: support SAE password identifier in wifi dialog"

This commit is contained in:
Jimmy Chen
2019-08-28 15:31:18 +00:00
committed by Android (Google) Code Review
3 changed files with 49 additions and 0 deletions

View File

@@ -133,6 +133,7 @@ public class WifiConfigController implements TextWatcher,
@VisibleForTesting
int mAccessPointSecurity;
private TextView mPasswordView;
private TextView mSaePasswordIdView;
private ImageButton mSsidScanButton;
private String mUnspecifiedCertString;
@@ -797,6 +798,11 @@ public class WifiConfigController implements TextWatcher,
String password = mPasswordView.getText().toString();
config.preSharedKey = '"' + password + '"';
}
if (mSaePasswordIdView.length() != 0) {
config.saePasswordId = mSaePasswordIdView.getText().toString();
} else {
config.saePasswordId = null;
}
break;
case AccessPoint.SECURITY_OWE:
@@ -979,6 +985,23 @@ public class WifiConfigController implements TextWatcher,
}
}
if (mSaePasswordIdView == null) {
mSaePasswordIdView = (TextView) mView.findViewById(R.id.sae_password_id);
mSaePasswordIdView.setOnEditorActionListener(this);
mSaePasswordIdView.setOnKeyListener(this);
}
if (mAccessPointSecurity == AccessPoint.SECURITY_SAE) {
mView.findViewById(R.id.sae_password_id_layout).setVisibility(View.VISIBLE);
if (mAccessPoint != null && mAccessPoint.isSaved()) {
if (!TextUtils.isEmpty(mAccessPoint.getConfig().saePasswordId)) {
mSaePasswordIdView.setText(mAccessPoint.getConfig().saePasswordId);
}
}
} else {
setSaePasswordIdInvisible();
}
if (mAccessPointSecurity != AccessPoint.SECURITY_EAP &&
mAccessPointSecurity != AccessPoint.SECURITY_EAP_SUITE_B) {
mView.findViewById(R.id.eap).setVisibility(View.GONE);
@@ -1260,6 +1283,11 @@ public class WifiConfigController implements TextWatcher,
mView.findViewById(R.id.show_password_layout).setVisibility(View.GONE);
}
private void setSaePasswordIdInvisible() {
mSaePasswordIdView.setText("");
mView.findViewById(R.id.sae_password_id_layout).setVisibility(View.GONE);
}
private void setEapMethodInvisible() {
mView.findViewById(R.id.eap).setVisibility(View.GONE);
}