Fixed accessibility issues in Wi-Fi SSID view for SUW
- Keep the Save button enabled at all times
- Show "Enter the SSID" to remind the user
Bug: 386897596
Flag: EXEMPT bugfix
Test: Manual testing
atest WifiDialogActivityTest \
WifiConfigControllerTest
Change-Id: I577e78c34cbaa0640479adf09a916a526500fe68
This commit is contained in:
@@ -28,6 +28,8 @@ import android.widget.TextView;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.wifi.utils.SsidInputGroup;
|
||||
import com.android.settings.wifi.utils.WifiDialogHelper;
|
||||
import com.android.settingslib.RestrictedLockUtils;
|
||||
import com.android.settingslib.RestrictedLockUtilsInternal;
|
||||
import com.android.settingslib.wifi.AccessPoint;
|
||||
@@ -62,6 +64,7 @@ public class WifiDialog extends AlertDialog implements WifiConfigUiBase,
|
||||
private View mView;
|
||||
private WifiConfigController mController;
|
||||
private boolean mHideSubmitButton;
|
||||
private WifiDialogHelper mDialogHelper;
|
||||
|
||||
/**
|
||||
* Creates a WifiDialog with no additional style. It displays as a dialog above the current
|
||||
@@ -115,6 +118,9 @@ public class WifiDialog extends AlertDialog implements WifiConfigUiBase,
|
||||
if (mAccessPoint == null) {
|
||||
mController.hideForgetButton();
|
||||
}
|
||||
|
||||
mDialogHelper = new WifiDialogHelper(this,
|
||||
new SsidInputGroup(getContext(), mView, R.id.ssid_layout, R.id.ssid));
|
||||
}
|
||||
|
||||
@SuppressWarnings("MissingSuperCall") // TODO: Fix me
|
||||
@@ -155,9 +161,6 @@ public class WifiDialog extends AlertDialog implements WifiConfigUiBase,
|
||||
public void onClick(DialogInterface dialogInterface, int id) {
|
||||
if (mListener != null) {
|
||||
switch (id) {
|
||||
case BUTTON_SUBMIT:
|
||||
mListener.onSubmit(this);
|
||||
break;
|
||||
case BUTTON_FORGET:
|
||||
if (WifiUtils.isNetworkLockedDown(getContext(), mAccessPoint.getConfig())) {
|
||||
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(getContext(),
|
||||
@@ -170,6 +173,11 @@ public class WifiDialog extends AlertDialog implements WifiConfigUiBase,
|
||||
}
|
||||
}
|
||||
|
||||
/** Return true to tell the parent activity to call onSubmit before onDismiss. */
|
||||
public boolean shouldSubmitBeforeFinish() {
|
||||
return mDialogHelper.isPositive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMode() {
|
||||
return mMode;
|
||||
|
||||
Reference in New Issue
Block a user