diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 49f77a01c9cff..cba4c1e17e828 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -499,6 +499,9 @@
8
16
+
+ 16
+ 16
-82
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index f2c05c8ee3617..b9f491807eda4 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -375,6 +375,8 @@
+
+
diff --git a/wifi/java/android/net/wifi/WifiInfo.java b/wifi/java/android/net/wifi/WifiInfo.java
index 25c1a8bb68d7f..476ef979f5a9a 100644
--- a/wifi/java/android/net/wifi/WifiInfo.java
+++ b/wifi/java/android/net/wifi/WifiInfo.java
@@ -151,8 +151,9 @@ public class WifiInfo implements Parcelable {
/**
* This factor is used to adjust the rate output under the new algorithm
* such that the result is comparable to the previous algorithm.
+ * This actually converts from unit 'packets per second' to 'packets per 5 seconds'.
*/
- private static final long OUTPUT_SCALE_FACTOR = 5000;
+ private static final long OUTPUT_SCALE_FACTOR = 5;
private long mLastPacketCountUpdateTimeStamp;
/**
@@ -198,16 +199,16 @@ public class WifiInfo implements Parcelable {
double currentSampleWeight = 1.0 - lastSampleWeight;
txBadRate = txBadRate * lastSampleWeight
- + (txbad - txBad) * OUTPUT_SCALE_FACTOR / timeDelta
+ + (txbad - txBad) * OUTPUT_SCALE_FACTOR * 1000 / timeDelta
* currentSampleWeight;
txSuccessRate = txSuccessRate * lastSampleWeight
- + (txgood - txSuccess) * OUTPUT_SCALE_FACTOR / timeDelta
+ + (txgood - txSuccess) * OUTPUT_SCALE_FACTOR * 1000 / timeDelta
* currentSampleWeight;
rxSuccessRate = rxSuccessRate * lastSampleWeight
- + (rxgood - rxSuccess) * OUTPUT_SCALE_FACTOR / timeDelta
+ + (rxgood - rxSuccess) * OUTPUT_SCALE_FACTOR * 1000 / timeDelta
* currentSampleWeight;
txRetriesRate = txRetriesRate * lastSampleWeight
- + (txretries - txRetries) * OUTPUT_SCALE_FACTOR / timeDelta
+ + (txretries - txRetries) * OUTPUT_SCALE_FACTOR * 1000/ timeDelta
* currentSampleWeight;
} else {
txBadRate = 0;
@@ -446,6 +447,22 @@ public class WifiInfo implements Parcelable {
return ScanResult.is5GHz(mFrequency);
}
+ /**
+ * @hide
+ * This returns txSuccessRate in packets per second.
+ */
+ public double getTxSuccessRatePps() {
+ return txSuccessRate / OUTPUT_SCALE_FACTOR;
+ }
+
+ /**
+ * @hide
+ * This returns rxSuccessRate in packets per second.
+ */
+ public double getRxSuccessRatePps() {
+ return rxSuccessRate / OUTPUT_SCALE_FACTOR;
+ }
+
/**
* Record the MAC address of the WLAN interface
* @param macAddress the MAC address in {@code XX:XX:XX:XX:XX:XX} form