Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9d68e97 authored by Sanket Padawe's avatar Sanket Padawe Committed by Android Partner Code Review
Browse files

Merge "Restore password visibility on screen rotation in Hotspot/Wifi setup." into m-wireless-dev

parents e8d640f1 3eb3b104
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -184,6 +184,15 @@ public class WifiApDialog extends AlertDialog implements View.OnClickListener,
        validate();
    }

    public void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        mPassword.setInputType(
                InputType.TYPE_CLASS_TEXT |
                (((CheckBox) mView.findViewById(R.id.show_password)).isChecked() ?
                InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD :
                InputType.TYPE_TEXT_VARIATION_PASSWORD));
    }

    private void validate() {
        if ((mSsid != null && mSsid.length() == 0) ||
                   ((mSecurityTypeIndex == WPA2_INDEX)&&
+7 −9
Original line number Diff line number Diff line
@@ -999,14 +999,12 @@ public class WifiConfigController implements TextWatcher,
    /**
     * Make the characters of the password visible if show_password is checked.
     */
    private void updatePasswordVisibility(boolean checked) {
        int pos = mPasswordView.getSelectionEnd();
        mPasswordView.setInputType(
                InputType.TYPE_CLASS_TEXT | (checked ?
    public void updatePassword() {
        TextView passwdView = (TextView) mView.findViewById(R.id.password);
        passwdView.setInputType(
                InputType.TYPE_CLASS_TEXT |
                (((CheckBox) mView.findViewById(R.id.show_password)).isChecked() ?
                InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD :
                InputType.TYPE_TEXT_VARIATION_PASSWORD));
        if (pos >= 0) {
            ((EditText)mPasswordView).setSelection(pos);
        }
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -74,6 +74,11 @@ class WifiDialog extends AlertDialog implements WifiConfigUiBase {
        }
    }

    public void onRestoreInstanceState(Bundle savedInstanceState) {
            super.onRestoreInstanceState(savedInstanceState);
            mController.updatePassword();
    }

    @Override
    public boolean isEdit() {
        return mEdit;