summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorEcco Park <eccopark@google.com>2018-07-23 15:50:56 -0700
committerEcco Park <eccopark@google.com>2018-07-31 14:02:24 -0700
commitaa7c4ae667d9c2e6d50fcf4acd5453544c854185 (patch)
tree3ab9f8c0e533b55b7b5ebbf3fdd103233613fc70 /service
parent4fc8cdcbb46c788d3e55e23b8cd1dbe061369bc8 (diff)
passpoint-r1: add the metrics for installed passpoint profile type
add count for each EAP method type for installed passpoint profiles. Bug: 111473296 Test:./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: adb shell dumpsys wifi captured the print line like below after intalling passpoint profile for EAP_TTLS. mWifiLogProto.installedPasspointProfileType: EAP_METHOD (2): 1 captured the print line after removing the profile. mWifiLogProto.installedPasspointProfileType Merged-In: Ica6cbd87cc003f02da47c58cb51b56cff9433789 Change-Id: Ica6cbd87cc003f02da47c58cb51b56cff9433789
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java80
-rw-r--r--service/java/com/android/server/wifi/hotspot2/PasspointManager.java1
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);
}