Make reset on network change the default.

PiperOrigin-RevId: 262886490
This commit is contained in:
tonihei 2019-08-12 10:43:26 +01:00 committed by Andrew Lewis
parent 8967dd9c4c
commit e5fcee40e5
2 changed files with 4 additions and 4 deletions

View File

@ -31,6 +31,7 @@
`DefaultTrackSelector` to allow adaptive selections of audio tracks with
different channel counts
([#6257](https://github.com/google/ExoPlayer/issues/6257)).
* Reset `DefaultBandwidthMeter` to initial values on network change.
### 2.10.4 ###

View File

@ -100,6 +100,7 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
initialBitrateEstimates = getInitialBitrateEstimatesForCountry(Util.getCountryCode(context));
slidingWindowMaxWeight = DEFAULT_SLIDING_WINDOW_MAX_WEIGHT;
clock = Clock.DEFAULT;
resetOnNetworkTypeChange = true;
}
/**
@ -168,14 +169,12 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
}
/**
* Sets whether to reset if the network type changes.
*
* <p>This method is experimental, and will be renamed or removed in a future release.
* Sets whether to reset if the network type changes. The default value is {@code true}.
*
* @param resetOnNetworkTypeChange Whether to reset if the network type changes.
* @return This builder.
*/
public Builder experimental_resetOnNetworkTypeChange(boolean resetOnNetworkTypeChange) {
public Builder setResetOnNetworkTypeChange(boolean resetOnNetworkTypeChange) {
this.resetOnNetworkTypeChange = resetOnNetworkTypeChange;
return this;
}