diff options
author | Roshan Pius <rpius@google.com> | 2017-03-14 19:53:44 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-03-14 19:53:46 +0000 |
commit | eb26485dd36b83676b4931e415f20b284abd7dfc (patch) | |
tree | 83eb25aedf0e4273ff3c3b30c2e4d3a3c9732f69 /service | |
parent | e65f63b6758b2c310a17263fab622adf798e47cd (diff) | |
parent | 9ca3944e48689ee1d72eed1ed27bc19ecea2c039 (diff) |
Merge "[WifiVendorHal] Add support for more than 1 radio stat instance"
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiVendorHal.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/WifiVendorHal.java b/service/java/com/android/server/wifi/WifiVendorHal.java index 51ead033b..0c1a56c46 100644 --- a/service/java/com/android/server/wifi/WifiVendorHal.java +++ b/service/java/com/android/server/wifi/WifiVendorHal.java @@ -34,6 +34,7 @@ import android.hardware.wifi.V1_0.RttType; import android.hardware.wifi.V1_0.StaBackgroundScanBucketEventReportSchemeMask; import android.hardware.wifi.V1_0.StaBackgroundScanBucketParameters; import android.hardware.wifi.V1_0.StaBackgroundScanParameters; +import android.hardware.wifi.V1_0.StaLinkLayerRadioStats; import android.hardware.wifi.V1_0.StaLinkLayerStats; import android.hardware.wifi.V1_0.StaRoamingConfig; import android.hardware.wifi.V1_0.StaRoamingState; @@ -700,14 +701,18 @@ public class WifiVendorHal { out.txmpdu_vo = stats.iface.wmeVoPktStats.txMpdu; out.lostmpdu_vo = stats.iface.wmeVoPktStats.lostMpdu; out.retries_vo = stats.iface.wmeVoPktStats.retries; - out.on_time = stats.radio.onTimeInMs; - out.tx_time = stats.radio.txTimeInMs; - out.tx_time_per_level = new int[stats.radio.txTimeInMsPerLevel.size()]; - for (int i = 0; i < out.tx_time_per_level.length; i++) { - out.tx_time_per_level[i] = stats.radio.txTimeInMsPerLevel.get(i); - } - out.rx_time = stats.radio.rxTimeInMs; - out.on_time_scan = stats.radio.onTimeInMsForScan; + // TODO(b/36176141): Figure out how to coalesce this info for multi radio devices. + if (stats.radios.size() > 0) { + StaLinkLayerRadioStats radioStats = stats.radios.get(0); + out.on_time = radioStats.onTimeInMs; + out.tx_time = radioStats.txTimeInMs; + out.tx_time_per_level = new int[radioStats.txTimeInMsPerLevel.size()]; + for (int i = 0; i < out.tx_time_per_level.length; i++) { + out.tx_time_per_level[i] = radioStats.txTimeInMsPerLevel.get(i); + } + out.rx_time = radioStats.rxTimeInMs; + out.on_time_scan = radioStats.onTimeInMsForScan; + } // unused: stats.timeStampInMs; return out; } |