----------- src/com/android/settings/wifi/WifiConfigController.java -----------
index 88acd88..c143258 100644
@@ -474,4 +474,8 @@ public class WifiConfigController implements TextWatcher,
boolean enabled = false;
boolean passwordInvalid = false;
+ // not allow unsafe net work
+ if(mAccessPointSecurity == AccessPoint.SECURITY_WEP || mAccessPointSecurity == AccessPoint.SECURITY_NONE){
+ return false;
+ }
if (mPasswordView != null
&& ((mAccessPointSecurity == AccessPoint.SECURITY_WEP
--------------- src/com/android/settings/wifi/WifiSettings.java ---------------
index ccc6abe..1516522 100644
@@ -531,4 +531,9 @@ public class WifiSettings extends RestrictedSettingsFragment
switch (item.getItemId()) {
case MENU_ID_CONNECT: {
+ // add for unsafe network
+ if (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE || mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_WEP){
+ //Toast.makeText(getActivity(), R.string.wifi_failed_connect_message,Toast.LENGTH_SHORT).show();
+ return false;
+ }
boolean isSavedNetwork = mSelectedAccessPoint.isSaved();
if (isSavedNetwork) {
@@ -580,4 +585,9 @@ public class WifiSettings extends RestrictedSettingsFragment
return false;
}
+ //add for network
+ if(mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) {
+ //Toast.makeText(getActivity(),R.string.wifi_not_allow_connect.Toast.LENGTH_SHORT).show();
+ return true;
+ }
if (mSelectedAccessPoint.isActive()) {
return super.onPreferenceTreeClick(preference);
----------- src/com/android/settings/wifi/WifiConfigController.java -----------
index 88acd88..c143258 100644
@@ -474,4 +474,8 @@ public class WifiConfigController implements TextWatcher,
boolean enabled = false;
boolean passwordInvalid = false;
+ // not allow unsafe net work
+ if(mAccessPointSecurity == AccessPoint.SECURITY_WEP || mAccessPointSecurity == AccessPoint.SECURITY_NONE){
+ return false;
+ }
if (mPasswordView != null
&& ((mAccessPointSecurity == AccessPoint.SECURITY_WEP
--------------- src/com/android/settings/wifi/WifiSettings.java ---------------
index ccc6abe..1516522 100644
@@ -531,4 +531,9 @@ public class WifiSettings extends RestrictedSettingsFragment
switch (item.getItemId()) {
case MENU_ID_CONNECT: {
+ // add for unsafe network
+ if (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE || mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_WEP){
+ //Toast.makeText(getActivity(), R.string.wifi_failed_connect_message,Toast.LENGTH_SHORT).show();
+ return false;
+ }
boolean isSavedNetwork = mSelectedAccessPoint.isSaved();
if (isSavedNetwork) {
@@ -580,4 +585,9 @@ public class WifiSettings extends RestrictedSettingsFragment
return false;
}
+ //add for network
+ if(mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) {
+ //Toast.makeText(getActivity(),R.string.wifi_not_allow_connect.Toast.LENGTH_SHORT).show();
+ return true;
+ }
if (mSelectedAccessPoint.isActive()) {
return super.onPreferenceTreeClick(preference);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)