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

Commit bce70a1f authored by Vinit Deshpande's avatar Vinit Deshpande Committed by Android Git Automerger
Browse files

am 2fbcdd34: am 5bfa8d8a: am 5acb871c: am b74c0b2a: Merge "wifi: Check for the...

am 2fbcdd34: am 5bfa8d8a: am 5acb871c: am b74c0b2a: Merge "wifi: Check for the sizeof ssid to start SoftAP" into mnc-dev

* commit '2fbcdd34':
  wifi: Check for the sizeof ssid to start SoftAP
parents 8ea975c1 2fbcdd34
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import java.nio.charset.Charset;

import com.android.settings.R;

@@ -213,9 +214,11 @@ public class WifiApDialog extends AlertDialog implements View.OnClickListener,
    }

    private void validate() {
        if ((mSsid != null && mSsid.length() == 0) ||
                   ((mSecurityTypeIndex == WPA2_INDEX)&&
                        mPassword.length() < 8)) {
        String mSsidString = mSsid.getText().toString();
        if ((mSsid != null && mSsid.length() == 0)
                || ((mSecurityTypeIndex == WPA2_INDEX) && mPassword.length() < 8)
                || (mSsid != null &&
                Charset.forName("UTF-8").encode(mSsidString).limit() > 32)) {
            getButton(BUTTON_SUBMIT).setEnabled(false);
        } else {
            getButton(BUTTON_SUBMIT).setEnabled(true);