Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ad38cd9 authored by Chong Zhang's avatar Chong Zhang Committed by Android (Google) Code Review
Browse files

Merge "do not do bandwidth estimation if total data downloaded is too small"

parents d4db9dcd 358e7174
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -75,7 +75,11 @@ void HTTPBase::addBandwidthMeasurement(
bool HTTPBase::estimateBandwidth(int32_t *bandwidth_bps) {
    Mutex::Autolock autoLock(mLock);

    if (mNumBandwidthHistoryItems < 2) {
    // Do not do bandwidth estimation if we don't have enough samples, or
    // total bytes download are too small (<64K).
    // Bandwidth estimation from these samples can often shoot up and cause
    // unwanted bw adaption behaviors.
    if (mNumBandwidthHistoryItems < 2 || mTotalTransferBytes < 65536) {
        return false;
    }