diff options
author | Vinit Deshpande <vinitd@google.com> | 2015-06-23 00:21:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-23 00:21:34 +0000 |
commit | a2cbb3e632f46dda69fce264b29ed50c4f827ad3 (patch) | |
tree | e940e68a8412c7a06759dfd1ff450fb92b642be1 | |
parent | 484b114846d6ed425f7e938fb97980ee67f43140 (diff) | |
parent | c88e8b230bb3f51107cf0ed5313c5a39115ddf33 (diff) | |
download | frameworks_base-a2cbb3e632f46dda69fce264b29ed50c4f827ad3.zip frameworks_base-a2cbb3e632f46dda69fce264b29ed50c4f827ad3.tar.gz frameworks_base-a2cbb3e632f46dda69fce264b29ed50c4f827ad3.tar.bz2 |
Merge changes from topic 'mwd-merge-wifi-062215' into mnc-dev
* changes:
Added config_wifi_hotspot2_enabled.
make sure wifi link stats are reset
-rwxr-xr-x | core/res/res/values/config.xml | 3 | ||||
-rwxr-xr-x | core/res/res/values/symbols.xml | 1 | ||||
-rw-r--r-- | wifi/java/android/net/wifi/WifiInfo.java | 41 |
3 files changed, 31 insertions, 14 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 9ac1fdd..f5c89c5 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -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> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 6386ce8..3a1a156 100755 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -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" /> diff --git a/wifi/java/android/net/wifi/WifiInfo.java b/wifi/java/android/net/wifi/WifiInfo.java index dbfd4ef..2ba38e1 100644 --- a/wifi/java/android/net/wifi/WifiInfo.java +++ b/wifi/java/android/net/wifi/WifiInfo.java @@ -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; } |