summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Shi <kaishi@google.com>2020-06-30 16:38:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-06-30 16:38:18 +0000
commitde359e61f8d727725b8b2393127f6d2a10a14abb (patch)
tree91688c1f9b6e191dc762866f98d7540484e59881
parentefb2c0a98a4dc23b6081993b548941fbbab69d53 (diff)
parent2b435c05d7d588b665d9ad0f1728b9d0bb02395b (diff)
Merge "Bug fix of Tx PER when packet count is low" into rvc-dev
-rw-r--r--service/java/com/android/server/wifi/DeviceConfigFacade.java2
-rw-r--r--service/java/com/android/server/wifi/WifiDataStall.java8
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java4
3 files changed, 8 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/DeviceConfigFacade.java b/service/java/com/android/server/wifi/DeviceConfigFacade.java
index 0e43a0891..0b707701f 100644
--- a/service/java/com/android/server/wifi/DeviceConfigFacade.java
+++ b/service/java/com/android/server/wifi/DeviceConfigFacade.java
@@ -66,7 +66,7 @@ public class DeviceConfigFacade {
// Denominator part of default threshold of L2 throughput over L3 throughput ratio
public static final int DEFAULT_TPUT_SUFFICIENT_RATIO_THR_DEN = 1;
// Default threshold of Tx packet per second
- public static final int DEFAULT_TX_PACKET_PER_SECOND_THR = 1;
+ public static final int DEFAULT_TX_PACKET_PER_SECOND_THR = 2;
// Default threshold of Rx packet per second
public static final int DEFAULT_RX_PACKET_PER_SECOND_THR = 1;
// Default high threshold values for various connection/disconnection cases
diff --git a/service/java/com/android/server/wifi/WifiDataStall.java b/service/java/com/android/server/wifi/WifiDataStall.java
index 7ae577900..ebc184773 100644
--- a/service/java/com/android/server/wifi/WifiDataStall.java
+++ b/service/java/com/android/server/wifi/WifiDataStall.java
@@ -296,7 +296,8 @@ public class WifiDataStall {
}
logd(" ccaLevel = " + ccaLevel);
- int txPer = updateTxPer(txSuccessDelta, txRetriesDelta, isSameBssidAndFreq);
+ int txPer = updateTxPer(txSuccessDelta, txRetriesDelta, isSameBssidAndFreq,
+ isTxTrafficHigh);
boolean isTxTputLow = false;
boolean isRxTputLow = false;
@@ -397,12 +398,13 @@ public class WifiDataStall {
return WifiIsUnusableEvent.TYPE_UNKNOWN;
}
- private int updateTxPer(long txSuccessDelta, long txRetriesDelta, boolean isSameBssidAndFreq) {
+ private int updateTxPer(long txSuccessDelta, long txRetriesDelta, boolean isSameBssidAndFreq,
+ boolean isTxTrafficHigh) {
if (!isSameBssidAndFreq) {
return DEFAULT_TX_PACKET_ERROR_RATE;
}
long txAttempts = txSuccessDelta + txRetriesDelta;
- if (txAttempts <= 0) {
+ if (txAttempts <= 0 || !isTxTrafficHigh) {
return DEFAULT_TX_PACKET_ERROR_RATE;
}
return (int) (txRetriesDelta * 100 / txAttempts);
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java b/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java
index b1eb5e9a8..de1e5cb4e 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java
@@ -342,7 +342,7 @@ public class WifiDataStallTest extends WifiBaseTest {
assertEquals(WifiIsUnusableEvent.TYPE_UNKNOWN, mWifiDataStall
.checkDataStallAndThroughputSufficiency(mOldLlStats, mNewLlStats, mWifiInfo));
assertEquals(true, mWifiDataStall.isThroughputSufficient());
- assertEquals(4804, mWifiDataStall.getTxThroughputKbps());
+ assertEquals(9128, mWifiDataStall.getTxThroughputKbps());
assertEquals(-1, mWifiDataStall.getRxThroughputKbps());
verify(mWifiMetrics, never()).logWifiIsUnusableEvent(anyInt());
}
@@ -400,7 +400,7 @@ public class WifiDataStallTest extends WifiBaseTest {
assertEquals(WifiIsUnusableEvent.TYPE_UNKNOWN, mWifiDataStall
.checkDataStallAndThroughputSufficiency(mOldLlStats, mNewLlStats, mWifiInfo));
assertEquals(true, mWifiDataStall.isThroughputSufficient());
- assertEquals(4707, mWifiDataStall.getTxThroughputKbps());
+ assertEquals(8943, mWifiDataStall.getTxThroughputKbps());
assertEquals(9414, mWifiDataStall.getRxThroughputKbps());
}