summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorKai Shi <kaishi@google.com>2020-06-02 20:49:29 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-02 20:49:29 +0000
commitc63548aec88b70e6dfec3844363ba24179851a28 (patch)
tree24960cbaa929472f3feeb5ea9c9e94815b746128 /service
parent2fcd0c96e9af48bfe9512d1d132f88353b4f914c (diff)
parent7406fac7e4550b239dfa2a6f53b83a79042a5e1b (diff)
Merge "Add mainlineModuleVersion in WifiMetrics" into rvc-dev am: 7406fac7e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/net/wifi/+/11687245 Change-Id: Ic18c47db2ff7070863e209726873eee2af05ca83
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiHealthMonitor.java23
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java3
-rw-r--r--service/proto/src/metrics.proto3
-rw-r--r--service/proto/src/scorecard.proto2
4 files changed, 22 insertions, 9 deletions
diff --git a/service/java/com/android/server/wifi/WifiHealthMonitor.java b/service/java/com/android/server/wifi/WifiHealthMonitor.java
index 27167dccf..8ab3a74a6 100644
--- a/service/java/com/android/server/wifi/WifiHealthMonitor.java
+++ b/service/java/com/android/server/wifi/WifiHealthMonitor.java
@@ -326,6 +326,15 @@ public class WifiHealthMonitor {
pw.println("WifiHealthMonitor - Log End ----");
}
+ /**
+ * Get current wifi mainline module long version code
+ * @Return a non-zero value if version code is available, 0 otherwise.
+ */
+ public long getWifiStackVersion() {
+ WifiSoftwareBuildInfo currentBuild = getWifiSystemInfoStats().getCurrSoftwareBuildInfo();
+ return (currentBuild == null) ? 0 : currentBuild.getWifiStackVersion();
+ }
+
private synchronized void dailyDetectionHandler() {
logd("Run daily detection");
// Clear daily detection result
@@ -533,12 +542,12 @@ public class WifiHealthMonitor {
return null;
}
PackageManager packageManager = mContext.getPackageManager();
- int wifiStackVersion = 0;
+ long wifiStackVersion = 0;
try {
wifiStackVersion = packageManager.getPackageInfo(
- WIFI_APK_PACKAGE_NAME, PackageManager.MATCH_APEX).versionCode;
+ WIFI_APK_PACKAGE_NAME, PackageManager.MATCH_APEX).getLongVersionCode();
} catch (PackageManager.NameNotFoundException e) {
- Log.e(TAG, " hit PackageManager nameNotFoundException");
+ Log.e(TAG, " Hit PackageManager exception", e);
}
String osBuildVersion = replaceNullByEmptyString(Build.DISPLAY);
if (mWifiNative == null) {
@@ -629,10 +638,10 @@ public class WifiHealthMonitor {
*/
final class WifiSoftwareBuildInfo {
private String mOsBuildVersion;
- private int mWifiStackVersion;
+ private long mWifiStackVersion;
private String mWifiDriverVersion;
private String mWifiFirmwareVersion;
- WifiSoftwareBuildInfo(@NonNull String osBuildVersion, int wifiStackVersion,
+ WifiSoftwareBuildInfo(@NonNull String osBuildVersion, long wifiStackVersion,
@NonNull String wifiDriverVersion, @NonNull String wifiFirmwareVersion) {
mOsBuildVersion = osBuildVersion;
mWifiStackVersion = wifiStackVersion;
@@ -648,7 +657,7 @@ public class WifiHealthMonitor {
String getOsBuildVersion() {
return mOsBuildVersion;
}
- int getWifiStackVersion() {
+ long getWifiStackVersion() {
return mWifiStackVersion;
}
String getWifiDriverVersion() {
@@ -842,7 +851,7 @@ public class WifiHealthMonitor {
@NonNull SoftwareBuildInfo softwareBuildInfo) {
String osBuildVersion = softwareBuildInfo.hasOsBuildVersion()
? softwareBuildInfo.getOsBuildVersion() : "NA";
- int stackVersion = softwareBuildInfo.hasWifiStackVersion()
+ long stackVersion = softwareBuildInfo.hasWifiStackVersion()
? softwareBuildInfo.getWifiStackVersion() : 0;
String driverVersion = softwareBuildInfo.hasWifiDriverVersion()
? softwareBuildInfo.getWifiDriverVersion() : "NA";
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java
index dbd532541..e23779e85 100644
--- a/service/java/com/android/server/wifi/WifiMetrics.java
+++ b/service/java/com/android/server/wifi/WifiMetrics.java
@@ -4359,8 +4359,9 @@ public class WifiMetrics {
initialPartialScanStats.failedScanChannelCountHistogram =
mInitPartialScanFailureHistogram.toProto();
mWifiLogProto.initPartialScanStats = initialPartialScanStats;
-
mWifiLogProto.carrierWifiMetrics = mCarrierWifiMetrics.toProto();
+ mWifiLogProto.mainlineModuleVersion = mWifiHealthMonitor.getWifiStackVersion();
+
}
}
diff --git a/service/proto/src/metrics.proto b/service/proto/src/metrics.proto
index eaea7342b..349543d59 100644
--- a/service/proto/src/metrics.proto
+++ b/service/proto/src/metrics.proto
@@ -712,6 +712,9 @@ message WifiLog {
// Metrics about carrier wifi network.
optional CarrierWifiMetrics carrier_wifi_metrics = 200;
+
+ // Long version code of wifi mainline module, 0 means not available.
+ optional int64 mainline_module_version = 201;
}
// Information that gets logged for every WiFi connection.
diff --git a/service/proto/src/scorecard.proto b/service/proto/src/scorecard.proto
index ad5822c72..d351c5666 100644
--- a/service/proto/src/scorecard.proto
+++ b/service/proto/src/scorecard.proto
@@ -146,7 +146,7 @@ message SoftwareBuildInfo {
// Android OS build version
optional string os_build_version = 1;
// WiFi stack APK version, 0 means not available.
- optional int32 wifi_stack_version = 2;
+ optional int64 wifi_stack_version = 2;
// WiFi driver version
optional string wifi_driver_version = 3;
// WiFi firmware version