diff options
author | Mingguang Xu <mingguangxu@google.com> | 2019-10-04 23:27:38 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-10-04 23:27:38 +0000 |
commit | a6d9c2bad258dfcfbf3f0c6359d12d6397b29df7 (patch) | |
tree | 9d434b6f960d742844eec648ec96243eb032786b | |
parent | 718bf7a21502446f0b8ac133db4ad77ab60a9940 (diff) | |
parent | 1bea2b5d4072cc068fbb120a9d7e9338adee74de (diff) |
Merge "Revert "Wifi usability: Change the unit of the threshold for tx/rx throughput from Mbps to Kbps"" into qt-qpr1-dev
4 files changed, 32 insertions, 32 deletions
diff --git a/service/java/com/android/server/wifi/DeviceConfigFacade.java b/service/java/com/android/server/wifi/DeviceConfigFacade.java index 947261b8a..a9889f424 100644 --- a/service/java/com/android/server/wifi/DeviceConfigFacade.java +++ b/service/java/com/android/server/wifi/DeviceConfigFacade.java @@ -31,10 +31,10 @@ public class DeviceConfigFacade { // Default duration for evaluating Wifi condition to trigger a data stall // measured in milliseconds public static final int DEFAULT_DATA_STALL_DURATION_MS = 1500; - // Default threshold of Tx throughput below which to trigger a data stall measured in Kbps - public static final int DEFAULT_DATA_STALL_TX_TPUT_THR_KBPS = 2000; - // Default threshold of Rx throughput below which to trigger a data stall measured in Kbps - public static final int DEFAULT_DATA_STALL_RX_TPUT_THR_KBPS = 2000; + // Default threshold of Tx throughput below which to trigger a data stall measured in Mbps + public static final int DEFAULT_DATA_STALL_TX_TPUT_THR_MBPS = 2; + // Default threshold of Rx throughput below which to trigger a data stall measured in Mbps + public static final int DEFAULT_DATA_STALL_RX_TPUT_THR_MBPS = 2; // Default threshold of Tx packet error rate above which to trigger a data stall in percentage public static final int DEFAULT_DATA_STALL_TX_PER_THR = 90; // Default threshold of CCA level above which to trigger a data stall in percentage @@ -77,17 +77,17 @@ public class DeviceConfigFacade { /** * Gets the threshold of Tx throughput below which to trigger a data stall. */ - public int getDataStallTxTputThrKbps() { - return DeviceConfig.getInt(NAMESPACE, "data_stall_tx_tput_thr_kbps", - DEFAULT_DATA_STALL_TX_TPUT_THR_KBPS); + public int getDataStallTxTputThrMbps() { + return DeviceConfig.getInt(NAMESPACE, "data_stall_tx_tput_thr_mbps", + DEFAULT_DATA_STALL_TX_TPUT_THR_MBPS); } /** * Gets the threshold of Rx throughput below which to trigger a data stall. */ - public int getDataStallRxTputThrKbps() { - return DeviceConfig.getInt(NAMESPACE, "data_stall_rx_tput_thr_kbps", - DEFAULT_DATA_STALL_RX_TPUT_THR_KBPS); + public int getDataStallRxTputThrMbps() { + return DeviceConfig.getInt(NAMESPACE, "data_stall_rx_tput_thr_mbps", + DEFAULT_DATA_STALL_RX_TPUT_THR_MBPS); } /** diff --git a/service/java/com/android/server/wifi/WifiDataStall.java b/service/java/com/android/server/wifi/WifiDataStall.java index a7931febe..6eb3b41e5 100644 --- a/service/java/com/android/server/wifi/WifiDataStall.java +++ b/service/java/com/android/server/wifi/WifiDataStall.java @@ -52,8 +52,8 @@ public class WifiDataStall { private int mMinTxBad; private int mMinTxSuccessWithoutRx; private int mDataStallDurationMs; - private int mDataStallTxTputThrKbps; - private int mDataStallRxTputThrKbps; + private int mDataStallTxTputThrMbps; + private int mDataStallRxTputThrMbps; private int mDataStallTxPerThr; private int mDataStallCcaLevelThr; private int mLastFrequency = -1; @@ -156,12 +156,12 @@ public class WifiDataStall { boolean isTxTputLow = false; boolean isRxTputLow = false; if (txLinkSpeed > 0) { - int txTputKbps = txLinkSpeed * 1000 * (100 - txPer) * (100 - ccaLevel); - isTxTputLow = txTputKbps < mDataStallTxTputThrKbps * 100 * 100; + int txTput = txLinkSpeed * (100 - txPer) * (100 - ccaLevel); + isTxTputLow = txTput < mDataStallTxTputThrMbps * 100 * 100; } if (rxLinkSpeed > 0) { - int rxTputKbps = rxLinkSpeed * 1000 * (100 - ccaLevel); - isRxTputLow = rxTputKbps < mDataStallRxTputThrKbps * 100; + int rxTput = rxLinkSpeed * (100 - ccaLevel); + isRxTputLow = rxTput < mDataStallRxTputThrMbps * 100; } boolean dataStallTx = isTxTputLow || ccaLevel >= mDataStallCcaLevelThr @@ -255,14 +255,14 @@ public class WifiDataStall { private void updateUsabilityDataCollectionFlags() { mDataStallDurationMs = mDeviceConfigFacade.getDataStallDurationMs(); - mDataStallTxTputThrKbps = mDeviceConfigFacade.getDataStallTxTputThrKbps(); - mDataStallRxTputThrKbps = mDeviceConfigFacade.getDataStallRxTputThrKbps(); + mDataStallTxTputThrMbps = mDeviceConfigFacade.getDataStallTxTputThrMbps(); + mDataStallRxTputThrMbps = mDeviceConfigFacade.getDataStallRxTputThrMbps(); mDataStallTxPerThr = mDeviceConfigFacade.getDataStallTxPerThr(); mDataStallCcaLevelThr = mDeviceConfigFacade.getDataStallCcaLevelThr(); mWifiMetrics.setDataStallDurationMs(mDataStallDurationMs); - mWifiMetrics.setDataStallTxTputThrKbps(mDataStallTxTputThrKbps); - mWifiMetrics.setDataStallRxTputThrKbps(mDataStallRxTputThrKbps); + mWifiMetrics.setDataStallTxTputThrMbps(mDataStallTxTputThrMbps); + mWifiMetrics.setDataStallRxTputThrMbps(mDataStallRxTputThrMbps); mWifiMetrics.setDataStallTxPerThr(mDataStallTxPerThr); mWifiMetrics.setDataStallCcaLevelThr(mDataStallCcaLevelThr); } diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index 54a0be66d..1b7e8cdb3 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -2784,10 +2784,10 @@ public class WifiMetrics { + mExperimentValues.linkSpeedCountsLoggingEnabled); pw.println("mExperimentValues.dataStallDurationMs=" + mExperimentValues.dataStallDurationMs); - pw.println("mExperimentValues.dataStallTxTputThrKbps=" - + mExperimentValues.dataStallTxTputThrKbps); - pw.println("mExperimentValues.dataStallRxTputThrKbps=" - + mExperimentValues.dataStallRxTputThrKbps); + pw.println("mExperimentValues.dataStallTxTputThrMbps=" + + mExperimentValues.dataStallTxTputThrMbps); + pw.println("mExperimentValues.dataStallRxTputThrMbps=" + + mExperimentValues.dataStallRxTputThrMbps); pw.println("mExperimentValues.dataStallTxPerThr=" + mExperimentValues.dataStallTxPerThr); pw.println("mExperimentValues.dataStallCcaLevelThr=" @@ -5214,18 +5214,18 @@ public class WifiMetrics { /** * Sets the threshold of Tx throughput below which to trigger a data stall */ - public void setDataStallTxTputThrKbps(int txTputThr) { + public void setDataStallTxTputThrMbps(int txTputThr) { synchronized (mLock) { - mExperimentValues.dataStallTxTputThrKbps = txTputThr; + mExperimentValues.dataStallTxTputThrMbps = txTputThr; } } /** * Sets the threshold of Rx throughput below which to trigger a data stall */ - public void setDataStallRxTputThrKbps(int rxTputThr) { + public void setDataStallRxTputThrMbps(int rxTputThr) { synchronized (mLock) { - mExperimentValues.dataStallRxTputThrKbps = rxTputThr; + mExperimentValues.dataStallRxTputThrMbps = rxTputThr; } } diff --git a/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java b/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java index 6ac18361c..71b658923 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java @@ -76,10 +76,10 @@ public class WifiDataStallTest { .thenReturn(WifiDataStall.MIN_TX_SUCCESS_WITHOUT_RX_DEFAULT); when(mDeviceConfigFacade.getDataStallDurationMs()).thenReturn( DeviceConfigFacade.DEFAULT_DATA_STALL_DURATION_MS); - when(mDeviceConfigFacade.getDataStallTxTputThrKbps()).thenReturn( - DeviceConfigFacade.DEFAULT_DATA_STALL_TX_TPUT_THR_KBPS); - when(mDeviceConfigFacade.getDataStallRxTputThrKbps()).thenReturn( - DeviceConfigFacade.DEFAULT_DATA_STALL_RX_TPUT_THR_KBPS); + when(mDeviceConfigFacade.getDataStallTxTputThrMbps()).thenReturn( + DeviceConfigFacade.DEFAULT_DATA_STALL_TX_TPUT_THR_MBPS); + when(mDeviceConfigFacade.getDataStallRxTputThrMbps()).thenReturn( + DeviceConfigFacade.DEFAULT_DATA_STALL_RX_TPUT_THR_MBPS); when(mDeviceConfigFacade.getDataStallTxPerThr()).thenReturn( DeviceConfigFacade.DEFAULT_DATA_STALL_TX_PER_THR); when(mDeviceConfigFacade.getDataStallCcaLevelThr()).thenReturn( |