WifiConfiguration: Fix isEnterprise

Add a check for the eap method in Enterpriseconfig associated with the
WifiConfiguration.

BUG: 31275240
Change-Id: I21aabb09bdd21e29a80d4b9c6ea0e2b1f0d7e2df
This commit is contained in:
Roshan Pius
2016-09-06 10:13:40 -07:00
parent f7c508ae09
commit 29ce1dab5a

View File

@@ -1407,8 +1407,10 @@ public class WifiConfiguration implements Parcelable {
* @hide
*/
public boolean isEnterprise() {
return allowedKeyManagement.get(KeyMgmt.WPA_EAP) ||
allowedKeyManagement.get(KeyMgmt.IEEE8021X);
return (allowedKeyManagement.get(KeyMgmt.WPA_EAP)
|| allowedKeyManagement.get(KeyMgmt.IEEE8021X))
&& enterpriseConfig != null
&& enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.NONE;
}
@Override