Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
The code below, allow Free Mobile's users (20815 operator) to connect to Free Mobile hotspots, using Free Mobile EAPSIM network (SSID = "FreeWifi_secure") in France.
This code works on Motorola Nexus 6 (LRX210), LG G3 (v20d-EUR-XX LRX21R.A1417119896) but not on Nexus 5 (LRX210) "Authentification error".
-> logcat -b radio on nexus 5 is attached.
WifiManager wifiManag = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
TelephonyManager mTelephonyMgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String userName = "1" + mTelephonyMgr.getSubscriberId() + "@
String ssid = "FreeWifi_secure";
WifiConfiguration selectedConfig = new WifiConfiguration();
selectedConfig.SSID = "\"FreeWifi_secure\"";
selectedConfig.priority = 0;
selectedConfig.hiddenSSID = false;
selectedConfig.allowedKeyManagement.clear();
selectedConfig.allowedKeyManagement.set(KeyMgmt.IEEE8021X);
selectedConfig.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
selectedConfig.allowedGroupCiphers.clear();
selectedConfig.allowedGroupCiphers.set(GroupCipher.CCMP);
selectedConfig.allowedGroupCiphers.set(GroupCipher.TKIP);
selectedConfig.allowedPairwiseCiphers.clear();
selectedConfig.allowedPairwiseCiphers.set(PairwiseCipher.CCMP);
selectedConfig.allowedPairwiseCiphers.set(PairwiseCipher.TKIP);
selectedConfig.allowedProtocols.clear();
selectedConfig.allowedProtocols.set(Protocol.RSN);
selectedConfig.allowedProtocols.set(Protocol.WPA);
try
{
WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
enterpriseConfig.setIdentity(userName);
enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM);
wifiConfig.enterpriseConfig = enterpriseConfig;
}
catch (Exception e)
{
logger.e("Could not configure WifiEnterpriseConfig" + e.getMessage());
}
int res = wifiManag.addNetwork(selectedConfig);
wifiManag.saveConfiguration();
wifiManag.enableNetwork(res, false);