diff options
author | Kai Shi <kaishi@google.com> | 2020-03-06 15:42:35 -0800 |
---|---|---|
committer | Kai Shi <kaishi@google.com> | 2020-03-09 22:35:41 -0700 |
commit | f72ffaec74a68d6eb035f358e3d2e2080e592379 (patch) | |
tree | 8b82444fb6da8670df15580a279a178c14b95063 /service | |
parent | 20869409e420dade9f2295f8fa2f78550f1ea7a3 (diff) |
use txTput when rxLinkSpeed is not available
Rx link speed is not available in some phones. Use txTput value for both up and down stream bandwidth of networkCapabilities instead of using maxSupportedLinkSpeed which is fixed during the entire connection.
Bug: 148875063
Bug: 124112470
Test: manual
Test: atest com.android.server.wifi
Change-Id: I74ebe90a82d085bc06568a68d14025aa9fac007f
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index f13983898..cac0e9c78 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -4372,19 +4372,11 @@ public class ClientModeImpl extends StateMachine { txTputKbps = mWifiDataStall.getTxThroughputKbps(); rxTputKbps = mWifiDataStall.getRxThroughputKbps(); } - // If throughput is not available, check if Tx/Rx link speed is available - if (txTputKbps == INVALID_THROUGHPUT || rxTputKbps == INVALID_THROUGHPUT) { - int txLinkSpeedMbps = mWifiInfo.getLinkSpeed(); - int rxLinkSpeedMbps = mWifiInfo.getRxLinkSpeedMbps(); - if (txLinkSpeedMbps > 0) { - txTputKbps = txLinkSpeedMbps * 1000; - } - if (rxLinkSpeedMbps > 0) { - rxTputKbps = rxLinkSpeedMbps * 1000; - } - } - // If link speed is not available, check if max supported link speed is available - if (txTputKbps == INVALID_THROUGHPUT || rxTputKbps == INVALID_THROUGHPUT) { + if (txTputKbps == INVALID_THROUGHPUT && rxTputKbps != INVALID_THROUGHPUT) { + txTputKbps = rxTputKbps; + } else if (rxTputKbps == INVALID_THROUGHPUT && txTputKbps != INVALID_THROUGHPUT) { + rxTputKbps = txTputKbps; + } else if (txTputKbps == INVALID_THROUGHPUT && rxTputKbps == INVALID_THROUGHPUT) { int maxTxLinkSpeedMbps = mWifiInfo.getMaxSupportedTxLinkSpeedMbps(); int maxRxLinkSpeedMbps = mWifiInfo.getMaxSupportedRxLinkSpeedMbps(); if (maxTxLinkSpeedMbps > 0) { @@ -4394,6 +4386,10 @@ public class ClientModeImpl extends StateMachine { rxTputKbps = maxRxLinkSpeedMbps * 1000; } } + if (mVerboseLoggingEnabled) { + logd("tx tput in kbps: " + txTputKbps); + logd("rx tput in kbps: " + rxTputKbps); + } if (txTputKbps > 0) { networkCapabilities.setLinkUpstreamBandwidthKbps(txTputKbps); } |