Merge "wifi: Check for the sizeof ssid to start SoftAP" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b74c0b2a27
@@ -34,6 +34,7 @@ import android.widget.CheckBox;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
|
||||||
@@ -213,9 +214,11 @@ public class WifiApDialog extends AlertDialog implements View.OnClickListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void validate() {
|
private void validate() {
|
||||||
if ((mSsid != null && mSsid.length() == 0) ||
|
String mSsidString = mSsid.getText().toString();
|
||||||
((mSecurityTypeIndex == WPA2_INDEX)&&
|
if ((mSsid != null && mSsid.length() == 0)
|
||||||
mPassword.length() < 8)) {
|
|| ((mSecurityTypeIndex == WPA2_INDEX) && mPassword.length() < 8)
|
||||||
|
|| (mSsid != null &&
|
||||||
|
Charset.forName("UTF-8").encode(mSsidString).limit() > 32)) {
|
||||||
getButton(BUTTON_SUBMIT).setEnabled(false);
|
getButton(BUTTON_SUBMIT).setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
getButton(BUTTON_SUBMIT).setEnabled(true);
|
getButton(BUTTON_SUBMIT).setEnabled(true);
|
||||||
|
Reference in New Issue
Block a user