mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Delete deprecated zero-arg DefaultBandwidthMeter
constructor
Use `DefaultBandwidthMeter.Builder` instead. #minor-release PiperOrigin-RevId: 532069549
This commit is contained in:
parent
6dfb387117
commit
8f29a5eba9
@ -11,6 +11,8 @@
|
||||
* Remove two deprecated `SimpleCache` constructors, use a non-deprecated
|
||||
constructor that takes a `DatabaseProvider` instead for better
|
||||
performance.
|
||||
* Remove `DefaultBandwidthMeter` constructor, use
|
||||
`DefaultBandwidthMeter.Builder` instead.
|
||||
|
||||
### 1.1.0-alpha01 (2023-05-10)
|
||||
|
||||
|
@ -297,19 +297,6 @@ public final class DefaultBandwidthMeter implements BandwidthMeter, TransferList
|
||||
private boolean networkTypeOverrideSet;
|
||||
private @C.NetworkType int networkTypeOverride;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link Builder} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public DefaultBandwidthMeter() {
|
||||
this(
|
||||
/* context= */ null,
|
||||
/* initialBitrateEstimates= */ ImmutableMap.of(),
|
||||
DEFAULT_SLIDING_WINDOW_MAX_WEIGHT,
|
||||
Clock.DEFAULT,
|
||||
/* resetOnNetworkTypeChange= */ false);
|
||||
}
|
||||
|
||||
private DefaultBandwidthMeter(
|
||||
@Nullable Context context,
|
||||
Map<Integer, Long> initialBitrateEstimates,
|
||||
|
@ -688,19 +688,13 @@ public final class DefaultBandwidthMeterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
public void defaultInitialBitrateEstimate_withoutContext_isReasonable() {
|
||||
DefaultBandwidthMeter bandwidthMeterWithBuilder =
|
||||
DefaultBandwidthMeter bandwidthMeter =
|
||||
new DefaultBandwidthMeter.Builder(/* context= */ null).build();
|
||||
long initialEstimateWithBuilder = bandwidthMeterWithBuilder.getBitrateEstimate();
|
||||
long initialEstimate = bandwidthMeter.getBitrateEstimate();
|
||||
|
||||
DefaultBandwidthMeter bandwidthMeterWithoutBuilder = new DefaultBandwidthMeter();
|
||||
long initialEstimateWithoutBuilder = bandwidthMeterWithoutBuilder.getBitrateEstimate();
|
||||
|
||||
assertThat(initialEstimateWithBuilder).isGreaterThan(100_000L);
|
||||
assertThat(initialEstimateWithBuilder).isLessThan(50_000_000L);
|
||||
assertThat(initialEstimateWithoutBuilder).isGreaterThan(100_000L);
|
||||
assertThat(initialEstimateWithoutBuilder).isLessThan(50_000_000L);
|
||||
assertThat(initialEstimate).isGreaterThan(100_000L);
|
||||
assertThat(initialEstimate).isLessThan(50_000_000L);
|
||||
}
|
||||
|
||||
private void setActiveNetworkInfo(NetworkInfo networkInfo) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user