summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-03-04 04:04:25 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-03-04 04:04:25 +0000
commiteeae0941a8c34d99fbed49f6d70e3c19bf2ea2d5 (patch)
tree6106989c334bb41d67e19c5f63dc55571233c51d /service
parent8b92a153539931940b5ec32e93f46968d4988317 (diff)
parent52bd643999ea77bbaaf1c153023bac2fed601615 (diff)
Merge "Add EAP methods in WifiMetrics" into rvc-dev
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java
index e4a99377e..14f7f846b 100644
--- a/service/java/com/android/server/wifi/WifiMetrics.java
+++ b/service/java/com/android/server/wifi/WifiMetrics.java
@@ -25,6 +25,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;
@@ -473,6 +474,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();
}
@@ -509,10 +512,64 @@ 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.WAPI_CERT:
+ return WifiMetricsProto.RouterFingerPrint.TYPE_EAP_WAPI_CERT;
+ 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;
+ }
+ }
class BssidBlocklistStats {
public IntCounter networkSelectionFilteredBssidCount = new IntCounter();