diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 40380100121ae..06aa9a37e12af 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -525,6 +525,9 @@
8
16
+
+ 16
+ 16
-82
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index f392ea0e38330..e7a95c8b88b50 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -377,6 +377,8 @@
+
+
diff --git a/wifi/java/android/net/wifi/WifiInfo.java b/wifi/java/android/net/wifi/WifiInfo.java
index 4dc78627ef916..a367b23107219 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;
@@ -447,6 +448,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