Merge changes from topic 'mwd-merge-wifi-062215' into mnc-dev

* changes:
  Added config_wifi_hotspot2_enabled.
  make sure wifi link stats are reset
This commit is contained in:
Vinit Deshpande
2015-06-23 00:21:28 +00:00
committed by Android (Google) Code Review
3 changed files with 31 additions and 14 deletions

View File

@@ -368,6 +368,9 @@
<!-- Boolean indicating whether the wifi chipset has dual frequency band support -->
<bool translatable="false" name="config_wifi_dual_band_support">false</bool>
<!-- Boolean indicating whether Hotspot 2.0/Passpoint and ANQP queries is enabled -->
<bool translatable="false" name="config_wifi_hotspot2_enabled">true</bool>
<!-- Device type information conforming to Annex B format in WiFi Direct specification.
The default represents a dual-mode smartphone -->
<string translatable="false" name="config_wifi_p2p_device_type">10-0050F204-5</string>

View File

@@ -1649,6 +1649,7 @@
<java-symbol type="bool" name="config_supportLongPressPowerWhenNonInteractive" />
<java-symbol type="bool" name="config_wifi_background_scan_support" />
<java-symbol type="bool" name="config_wifi_dual_band_support" />
<java-symbol type="bool" name="config_wifi_hotspot2_enabled" />
<java-symbol type="bool" name="config_wimaxEnabled" />
<java-symbol type="bool" name="show_ongoing_ime_switcher" />
<java-symbol type="color" name="config_defaultNotificationColor" />

View File

@@ -167,15 +167,24 @@ public class WifiInfo implements Parcelable {
long txbad = stats.lostmpdu_be + stats.lostmpdu_bk
+ stats.lostmpdu_vi + stats.lostmpdu_vo;
txBadRate = (txBadRate * 0.5)
+ ((double) (txbad - txBad) * 0.5);
txSuccessRate = (txSuccessRate * 0.5)
+ ((double) (txgood - txSuccess) * 0.5);
rxSuccessRate = (rxSuccessRate * 0.5)
+ ((double) (rxgood - rxSuccess) * 0.5);
txRetriesRate = (txRetriesRate * 0.5)
+ ((double) (txretries - txRetries) * 0.5);
if (txBad <= txbad
&& txSuccess <= txgood
&& rxSuccess <= rxgood
&& txRetries <= txretries) {
txBadRate = (txBadRate * 0.5)
+ ((double) (txbad - txBad) * 0.5);
txSuccessRate = (txSuccessRate * 0.5)
+ ((double) (txgood - txSuccess) * 0.5);
rxSuccessRate = (rxSuccessRate * 0.5)
+ ((double) (rxgood - rxSuccess) * 0.5);
txRetriesRate = (txRetriesRate * 0.5)
+ ((double) (txretries - txRetries) * 0.5);
} else {
txBadRate = 0;
txSuccessRate = 0;
rxSuccessRate = 0;
txRetriesRate = 0;
}
txBad = txbad;
txSuccess = txgood;
rxSuccess = rxgood;
@@ -204,11 +213,15 @@ public class WifiInfo implements Parcelable {
txRetries = 0;
txBadRate = 0;
txRetriesRate = 0;
txSuccessRate = (txSuccessRate * 0.5)
+ ((double) (txPackets - txSuccess) * 0.5);
rxSuccessRate = (rxSuccessRate * 0.5)
+ ((double) (rxPackets - rxSuccess) * 0.5);
if (txSuccess <= txPackets && rxSuccess <= rxPackets) {
txSuccessRate = (txSuccessRate * 0.5)
+ ((double) (txPackets - txSuccess) * 0.5);
rxSuccessRate = (rxSuccessRate * 0.5)
+ ((double) (rxPackets - rxSuccess) * 0.5);
} else {
txBadRate = 0;
txRetriesRate = 0;
}
txSuccess = txPackets;
rxSuccess = rxPackets;
}