diff options
author | Kai Shi <kaishi@google.com> | 2020-06-02 20:38:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-06-02 20:38:23 +0000 |
commit | 7406fac7e4550b239dfa2a6f53b83a79042a5e1b (patch) | |
tree | 9288c490944c5b43a8f659ab620437d4b5493c81 /service | |
parent | 40a6a0e1fb3efb62b81e24b30820c9ffa778b206 (diff) | |
parent | 175269fd8db424e61b3ab5e3b8e9ffa85681ab60 (diff) |
Merge "Add mainlineModuleVersion in WifiMetrics" into rvc-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiHealthMonitor.java | 23 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiMetrics.java | 3 | ||||
-rw-r--r-- | service/proto/src/metrics.proto | 3 | ||||
-rw-r--r-- | service/proto/src/scorecard.proto | 2 |
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 |