Removed WPA PSK from HotSpot Options
Bug: 16380972 Change-Id: I77735ff7a8962d538132bb55ebbf6cc75358f8a1
This commit is contained in:
@@ -310,7 +310,6 @@
|
|||||||
<!-- Note that adding/removing/moving the items will need wifi settings code change. -->
|
<!-- Note that adding/removing/moving the items will need wifi settings code change. -->
|
||||||
<string-array name="wifi_ap_security">
|
<string-array name="wifi_ap_security">
|
||||||
<item>@string/wifi_security_none</item>
|
<item>@string/wifi_security_none</item>
|
||||||
<item>@string/wifi_security_wpa</item>
|
|
||||||
<item>@string/wifi_security_wpa2</item>
|
<item>@string/wifi_security_wpa2</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
@@ -47,8 +47,7 @@ public class WifiApDialog extends AlertDialog implements View.OnClickListener,
|
|||||||
private final DialogInterface.OnClickListener mListener;
|
private final DialogInterface.OnClickListener mListener;
|
||||||
|
|
||||||
public static final int OPEN_INDEX = 0;
|
public static final int OPEN_INDEX = 0;
|
||||||
public static final int WPA_INDEX = 1;
|
public static final int WPA2_INDEX = 1;
|
||||||
public static final int WPA2_INDEX = 2;
|
|
||||||
|
|
||||||
private View mView;
|
private View mView;
|
||||||
private TextView mSsid;
|
private TextView mSsid;
|
||||||
@@ -68,9 +67,7 @@ public class WifiApDialog extends AlertDialog implements View.OnClickListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static int getSecurityTypeIndex(WifiConfiguration wifiConfig) {
|
public static int getSecurityTypeIndex(WifiConfiguration wifiConfig) {
|
||||||
if (wifiConfig.allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
|
if (wifiConfig.allowedKeyManagement.get(KeyMgmt.WPA2_PSK)) {
|
||||||
return WPA_INDEX;
|
|
||||||
} else if (wifiConfig.allowedKeyManagement.get(KeyMgmt.WPA2_PSK)) {
|
|
||||||
return WPA2_INDEX;
|
return WPA2_INDEX;
|
||||||
}
|
}
|
||||||
return OPEN_INDEX;
|
return OPEN_INDEX;
|
||||||
@@ -93,15 +90,6 @@ public class WifiApDialog extends AlertDialog implements View.OnClickListener,
|
|||||||
config.allowedKeyManagement.set(KeyMgmt.NONE);
|
config.allowedKeyManagement.set(KeyMgmt.NONE);
|
||||||
return config;
|
return config;
|
||||||
|
|
||||||
case WPA_INDEX:
|
|
||||||
config.allowedKeyManagement.set(KeyMgmt.WPA_PSK);
|
|
||||||
config.allowedAuthAlgorithms.set(AuthAlgorithm.OPEN);
|
|
||||||
if (mPassword.length() != 0) {
|
|
||||||
String password = mPassword.getText().toString();
|
|
||||||
config.preSharedKey = password;
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
|
|
||||||
case WPA2_INDEX:
|
case WPA2_INDEX:
|
||||||
config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);
|
config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);
|
||||||
config.allowedAuthAlgorithms.set(AuthAlgorithm.OPEN);
|
config.allowedAuthAlgorithms.set(AuthAlgorithm.OPEN);
|
||||||
@@ -137,8 +125,7 @@ public class WifiApDialog extends AlertDialog implements View.OnClickListener,
|
|||||||
if (mWifiConfig != null) {
|
if (mWifiConfig != null) {
|
||||||
mSsid.setText(mWifiConfig.SSID);
|
mSsid.setText(mWifiConfig.SSID);
|
||||||
mSecurity.setSelection(mSecurityTypeIndex);
|
mSecurity.setSelection(mSecurityTypeIndex);
|
||||||
if (mSecurityTypeIndex == WPA_INDEX ||
|
if (mSecurityTypeIndex == WPA2_INDEX) {
|
||||||
mSecurityTypeIndex == WPA2_INDEX) {
|
|
||||||
mPassword.setText(mWifiConfig.preSharedKey);
|
mPassword.setText(mWifiConfig.preSharedKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,7 +143,7 @@ public class WifiApDialog extends AlertDialog implements View.OnClickListener,
|
|||||||
|
|
||||||
private void validate() {
|
private void validate() {
|
||||||
if ((mSsid != null && mSsid.length() == 0) ||
|
if ((mSsid != null && mSsid.length() == 0) ||
|
||||||
(((mSecurityTypeIndex == WPA_INDEX) || (mSecurityTypeIndex == WPA2_INDEX))&&
|
((mSecurityTypeIndex == WPA2_INDEX)&&
|
||||||
mPassword.length() < 8)) {
|
mPassword.length() < 8)) {
|
||||||
getButton(BUTTON_SUBMIT).setEnabled(false);
|
getButton(BUTTON_SUBMIT).setEnabled(false);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user