summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorKai Shi <kaishi@google.com>2020-02-25 17:09:21 -0800
committerKai Shi <kaishi@google.com>2020-03-03 18:51:39 +0000
commitd7d14da8eafb570f00287ac715d31ebca6fca164 (patch)
tree40d0ca7a3d4d8b2caecc67d029c3be166c05cda3 /service
parent57281a616601d703cd89904a92c68d320f426190 (diff)
Add EAP methods in WifiMetrics
To help find the root cause of high authentication failure rate in enterprise network, add EAP method and authentication phase2 method in connection event metrics. Bug: 150237135 Test: manual Test: atest com.android.server.wifi Change-Id: I0c4ab436b1e43cc52d4bd4dab6c01db53fec91a6
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java
index 7578d3723..6db4e9955 100644
--- a/service/java/com/android/server/wifi/WifiMetrics.java
+++ b/service/java/com/android/server/wifi/WifiMetrics.java
@@ -26,6 +26,7 @@ import android.net.wifi.IOnWifiUsabilityStatsListener;
import android.net.wifi.ScanResult;
import android.net.wifi.SupplicantState;
import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiEnterpriseConfig;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiManager.DeviceMobilityState;
@@ -480,6 +481,8 @@ public class WifiMetrics {
sb.append(", mHidden=" + mRouterFingerPrintProto.hidden);
sb.append(", mRouterTechnology=" + mRouterFingerPrintProto.routerTechnology);
sb.append(", mSupportsIpv6=" + mRouterFingerPrintProto.supportsIpv6);
+ sb.append(", mEapMethod=" + mRouterFingerPrintProto.eapMethod);
+ sb.append(", mAuthPhase2Method=" + mRouterFingerPrintProto.authPhase2Method);
}
return sb.toString();
}
@@ -516,9 +519,61 @@ public class WifiMetrics {
if (candidate != null) {
updateMetricsFromScanResult(candidate);
}
+ if (mCurrentConnectionEvent.mRouterFingerPrint.mRouterFingerPrintProto
+ .authentication == WifiMetricsProto.RouterFingerPrint.AUTH_ENTERPRISE
+ && config.enterpriseConfig != null) {
+ int eapMethod = config.enterpriseConfig.getEapMethod();
+ mCurrentConnectionEvent.mRouterFingerPrint.mRouterFingerPrintProto
+ .eapMethod = getEapMethodProto(eapMethod);
+ int phase2Method = config.enterpriseConfig.getPhase2Method();
+ mCurrentConnectionEvent.mRouterFingerPrint.mRouterFingerPrintProto
+ .authPhase2Method = getAuthPhase2MethodProto(phase2Method);
+ }
}
}
}
+ private int getEapMethodProto(int eapMethod) {
+ switch (eapMethod) {
+ case WifiEnterpriseConfig.Eap.TLS:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_EAP_TLS;
+ case WifiEnterpriseConfig.Eap.UNAUTH_TLS:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_EAP_UNAUTH_TLS;
+ case WifiEnterpriseConfig.Eap.PEAP:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_EAP_PEAP;
+ case WifiEnterpriseConfig.Eap.PWD:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_EAP_PWD;
+ case WifiEnterpriseConfig.Eap.TTLS:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_EAP_TTLS;
+ case WifiEnterpriseConfig.Eap.SIM:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_EAP_SIM;
+ case WifiEnterpriseConfig.Eap.AKA:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_EAP_AKA;
+ case WifiEnterpriseConfig.Eap.AKA_PRIME:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_EAP_AKA_PRIME;
+ default:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_EAP_UNKNOWN;
+ }
+ }
+ private int getAuthPhase2MethodProto(int phase2Method) {
+ switch (phase2Method) {
+ case WifiEnterpriseConfig.Phase2.PAP:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_PHASE2_PAP;
+ case WifiEnterpriseConfig.Phase2.MSCHAP:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_PHASE2_MSCHAP;
+ case WifiEnterpriseConfig.Phase2.MSCHAPV2:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_PHASE2_MSCHAPV2;
+ case WifiEnterpriseConfig.Phase2.GTC:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_PHASE2_GTC;
+ case WifiEnterpriseConfig.Phase2.SIM:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_PHASE2_SIM;
+ case WifiEnterpriseConfig.Phase2.AKA:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_PHASE2_AKA;
+ case WifiEnterpriseConfig.Phase2.AKA_PRIME:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_PHASE2_AKA_PRIME;
+ default:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_PHASE2_NONE;
+ }
+ }
}
/**