diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-08-07 18:20:16 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-08-07 18:20:16 +0000 |
commit | 4db818057501c2b913825e7eeb78c89a82c98fff (patch) | |
tree | d0bfc9aa19022536c786aed08b022cbb9836a060 /service | |
parent | 4abb52b9125356b97adda4e430188b8a976fdc6c (diff) | |
parent | aa7c4ae667d9c2e6d50fcf4acd5453544c854185 (diff) |
Merge "passpoint-r1: add the metrics for installed passpoint profile type" into pi-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiMetrics.java | 80 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/PasspointManager.java | 1 |
2 files changed, 81 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index a3bd1697c..0b746196f 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -18,11 +18,13 @@ package com.android.server.wifi; import android.hardware.wifi.supplicant.V1_0.ISupplicantStaIfaceCallback; import android.net.NetworkAgent; +import android.net.wifi.EAPConstants; import android.net.wifi.ScanResult; import android.net.wifi.SupplicantState; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; +import android.net.wifi.hotspot2.PasspointConfiguration; import android.os.Handler; import android.os.Looper; import android.os.Message; @@ -175,6 +177,8 @@ public class WifiMetrics { private final SparseIntArray mAvailableSavedPasspointProviderBssidsInScanHistogram = new SparseIntArray(); + private final SparseIntArray mInstalledPasspointProfileType = new SparseIntArray(); + /** Mapping of "Connect to Network" notifications to counts. */ private final SparseIntArray mConnectToNetworkNotificationCount = new SparseIntArray(); /** Mapping of "Connect to Network" notification user actions to counts. */ @@ -2028,6 +2032,14 @@ public class WifiMetrics { + mWifiLogProto.numPasspointProviderUninstallSuccess); pw.println("mWifiLogProto.numPasspointProvidersSuccessfullyConnected=" + mWifiLogProto.numPasspointProvidersSuccessfullyConnected); + + pw.println("mWifiLogProto.installedPasspointProfileType: "); + for (int i = 0; i < mInstalledPasspointProfileType.size(); i++) { + int eapType = mInstalledPasspointProfileType.keyAt(i); + pw.println("EAP_METHOD (" + eapType + "): " + + mInstalledPasspointProfileType.valueAt(i)); + } + pw.println("mWifiLogProto.numRadioModeChangeToMcc=" + mWifiLogProto.numRadioModeChangeToMcc); pw.println("mWifiLogProto.numRadioModeChangeToScc=" @@ -2206,6 +2218,56 @@ public class WifiMetrics { } /** + * Update number of times for type of saved Passpoint profile. + * + * @param providers Passpoint providers installed on the device. + */ + public void updateSavedPasspointProfilesInfo( + Map<String, PasspointProvider> providers) { + int passpointType; + int eapType; + PasspointConfiguration config; + synchronized (mLock) { + mInstalledPasspointProfileType.clear(); + for (Map.Entry<String, PasspointProvider> entry : providers.entrySet()) { + config = entry.getValue().getConfig(); + if (config.getCredential().getUserCredential() != null) { + eapType = EAPConstants.EAP_TTLS; + } else if (config.getCredential().getCertCredential() != null) { + eapType = EAPConstants.EAP_TLS; + } else if (config.getCredential().getSimCredential() != null) { + eapType = config.getCredential().getSimCredential().getEapType(); + } else { + eapType = -1; + } + switch (eapType) { + case EAPConstants.EAP_TLS: + passpointType = WifiMetricsProto.PasspointProfileTypeCount.TYPE_EAP_TLS; + break; + case EAPConstants.EAP_TTLS: + passpointType = WifiMetricsProto.PasspointProfileTypeCount.TYPE_EAP_TTLS; + break; + case EAPConstants.EAP_SIM: + passpointType = WifiMetricsProto.PasspointProfileTypeCount.TYPE_EAP_SIM; + break; + case EAPConstants.EAP_AKA: + passpointType = WifiMetricsProto.PasspointProfileTypeCount.TYPE_EAP_AKA; + break; + case EAPConstants.EAP_AKA_PRIME: + passpointType = + WifiMetricsProto.PasspointProfileTypeCount.TYPE_EAP_AKA_PRIME; + break; + default: + passpointType = WifiMetricsProto.PasspointProfileTypeCount.TYPE_UNKNOWN; + + } + int count = mInstalledPasspointProfileType.get(passpointType); + mInstalledPasspointProfileType.put(passpointType, count + 1); + } + } + } + + /** * append the separate ConnectionEvent, SystemStateEntry and ScanReturnCode collections to their * respective lists within mWifiLogProto * @@ -2405,6 +2467,23 @@ public class WifiMetrics { keyVal.count = mConnectToNetworkNotificationActionCount.valueAt(i); notificationActionCountArray[i] = keyVal; } + + /** + * Convert the SparseIntArray of saved Passpoint profile types and counts to proto's + * repeated IntKeyVal array. + */ + int counts = mInstalledPasspointProfileType.size(); + mWifiLogProto.installedPasspointProfileType = + new WifiMetricsProto.PasspointProfileTypeCount[counts]; + for (int i = 0; i < counts; i++) { + mWifiLogProto.installedPasspointProfileType[i] = + new WifiMetricsProto.PasspointProfileTypeCount(); + mWifiLogProto.installedPasspointProfileType[i].eapMethodType = + mInstalledPasspointProfileType.keyAt(i); + mWifiLogProto.installedPasspointProfileType[i].count = + mInstalledPasspointProfileType.valueAt(i); + } + mWifiLogProto.connectToNetworkNotificationActionCount = notificationActionCountArray; mWifiLogProto.openNetworkRecommenderBlacklistSize = @@ -2529,6 +2608,7 @@ public class WifiMetrics { mWpsMetrics.clear(); mWifiWakeMetrics.clear(); mObserved80211mcApInScanHistogram.clear(); + mInstalledPasspointProfileType.clear(); } } diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java index a0915fa52..4c2937cb5 100644 --- a/service/java/com/android/server/wifi/hotspot2/PasspointManager.java +++ b/service/java/com/android/server/wifi/hotspot2/PasspointManager.java @@ -656,6 +656,7 @@ public class PasspointManager { numConnectedProviders++; } } + mWifiMetrics.updateSavedPasspointProfilesInfo(mProviders); mWifiMetrics.updateSavedPasspointProfiles(numProviders, numConnectedProviders); } |