[Wi-Fi] Apply WifiTrackerLib objects in WifiDppQrCodeScannerFragment
Bug: 152571756 Bug: 145100890 Test: manual Scan QR code and check connection. Change-Id: I21b9fadc83ab185df5710f4bf777afec3dfbbc8d
This commit is contained in:
@@ -534,4 +534,25 @@ public class WifiDppUtils {
|
||||
VIBRATE_DURATION_QR_CODE_RECOGNITION.toMillis(),
|
||||
VibrationEffect.DEFAULT_AMPLITUDE));
|
||||
}
|
||||
|
||||
@WifiEntry.Security
|
||||
static int getSecurityTypeFromWifiConfiguration(WifiConfiguration config) {
|
||||
if (config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.SAE)) {
|
||||
return WifiEntry.SECURITY_SAE;
|
||||
}
|
||||
if (config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.WPA_PSK)) {
|
||||
return WifiEntry.SECURITY_PSK;
|
||||
}
|
||||
if (config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.SUITE_B_192)) {
|
||||
return WifiEntry.SECURITY_EAP_SUITE_B;
|
||||
}
|
||||
if (config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.WPA_EAP)
|
||||
|| config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.IEEE8021X)) {
|
||||
return WifiEntry.SECURITY_EAP;
|
||||
}
|
||||
if (config.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.OWE)) {
|
||||
return WifiEntry.SECURITY_OWE;
|
||||
}
|
||||
return (config.wepKeys[0] != null) ? WifiEntry.SECURITY_WEP : WifiEntry.SECURITY_NONE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user