diff options
-rw-r--r-- | service/java/com/android/server/wifi/WifiDataStall.java | 4 | ||||
-rw-r--r-- | service/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/WifiDataStall.java b/service/java/com/android/server/wifi/WifiDataStall.java index 7a10fd8ae5..9d5e6ea96d 100644 --- a/service/java/com/android/server/wifi/WifiDataStall.java +++ b/service/java/com/android/server/wifi/WifiDataStall.java @@ -574,8 +574,8 @@ public class WifiDataStall { tputSufficientLowThrKbps = mDeviceConfigFacade.getRxTputSufficientLowThrKbps(); tputSufficientHighThrKbps = mDeviceConfigFacade.getRxTputSufficientHighThrKbps(); } - boolean isL3TputLow = (l3TputKbps * mDeviceConfigFacade.getTputSufficientRatioThrDen()) - < (tputSufficientLowThrKbps * mDeviceConfigFacade.getTputSufficientRatioThrNum()); + boolean isL3TputLow = (l3TputKbps * mDeviceConfigFacade.getTputSufficientRatioThrNum()) + < (tputSufficientLowThrKbps * mDeviceConfigFacade.getTputSufficientRatioThrDen()); boolean isL2TputAboveLowThr = l2TputKbps >= tputSufficientLowThrKbps; if (isL3TputLow) return isL2TputAboveLowThr; diff --git a/service/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java b/service/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java index d76a860929..fb610b9a95 100644 --- a/service/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java +++ b/service/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java @@ -148,6 +148,7 @@ public class WifiDataStallTest extends WifiBaseTest { mWifiDataStall = new WifiDataStall(mWifiMetrics, mContext, mDeviceConfigFacade, mWifiChannelUtilization, mClock, mHandler, mThroughputPredictor, mActiveModeWarden, mClientModeImplMonitor); + mWifiDataStall.enableVerboseLogging(true); mOldLlStats.txmpdu_be = 1000; mOldLlStats.retries_be = 1000; mOldLlStats.lostmpdu_be = 3000; @@ -386,6 +387,7 @@ public class WifiDataStallTest extends WifiBaseTest { WifiIsUnusableEvent.TYPE_DATA_STALL_BAD_TX); } + /** * Verify there is no data stall from tx failures if tx is not consecutively bad */ @@ -416,7 +418,11 @@ public class WifiDataStallTest extends WifiBaseTest { */ @Test public void verifyDataStallRxFailure() throws Exception { - when(mWifiInfo.getRxLinkSpeedMbps()).thenReturn(1); + when(mWifiInfo.getRxLinkSpeedMbps()).thenReturn(2); + when(mDeviceConfigFacade.getTputSufficientRatioThrDen()).thenReturn(1); + when(mDeviceConfigFacade.getTputSufficientRatioThrNum()).thenReturn(3); + when(mDeviceConfigFacade.getRxTputSufficientLowThrKbps()).thenReturn(1); + mNewLlStats.retries_be = 2 * mOldLlStats.retries_be; when(mClock.getElapsedSinceBootMillis()).thenReturn(10L); assertEquals(WifiIsUnusableEvent.TYPE_UNKNOWN, mWifiDataStall @@ -431,7 +437,7 @@ public class WifiDataStallTest extends WifiBaseTest { mCapabilities, mOldLlStats, mNewLlStats, mWifiInfo, mTxBytes, mRxBytes)); assertEquals(false, mWifiDataStall.isThroughputSufficient()); assertEquals(4804, mWifiDataStall.getTxThroughputKbps()); - assertEquals(960, mWifiDataStall.getRxThroughputKbps()); + assertEquals(1921, mWifiDataStall.getRxThroughputKbps()); verify(mWifiMetrics).logWifiIsUnusableEvent(TEST_IFACE_NAME, WifiIsUnusableEvent.TYPE_DATA_STALL_TX_WITHOUT_RX); } |