@Test public void networkTypeOverride_doesFullReset() { setActiveNetworkInfo(networkInfoEthernet); FakeClock clock = new FakeClock( 0); DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter.Builder(ApplicationProvider.getApplicationContext()) .setClock(clock) .build(); long[] bitrateEstimatesWithNewInstance = simulateTransfers(bandwidthMeter, clock); setActiveNetworkInfo(networkInfo2g); bandwidthMeter = new DefaultBandwidthMeter.Builder(ApplicationProvider.getApplicationContext()) .setClock(clock) .build(); simulateTransfers(bandwidthMeter, clock); bandwidthMeter.setNetworkTypeOverride(C.NETWORK_TYPE_ETHERNET); long[] bitrateEstimatesAfterReset = simulateTransfers(bandwidthMeter, clock); assertThat(bitrateEstimatesAfterReset).isEqualTo(bitrateEstimatesWithNewInstance); }
public synchronized void setNetworkTypeOverride(@C.NetworkType int networkType) { networkTypeOverride = networkType; networkTypeOverrideSet = true; onConnectivityAction(); }
DefaultBandwidthMeter implements BandwidthMeter, TransferListener { public synchronized void setNetworkTypeOverride(@C.NetworkType int networkType) { networkTypeOverride = networkType; networkTypeOverrideSet = true; onConnectivityAction(); } }
DefaultBandwidthMeter implements BandwidthMeter, TransferListener { public synchronized void setNetworkTypeOverride(@C.NetworkType int networkType) { networkTypeOverride = networkType; networkTypeOverrideSet = true; onConnectivityAction(); } @Deprecated  DefaultBandwidthMeter(); private  DefaultBandwidthMeter(
      @Nullable Context context,
      SparseArray<Long> initialBitrateEstimates,
      int maxWeight,
      Clock clock,
      boolean resetOnNetworkTypeChange); }
DefaultBandwidthMeter implements BandwidthMeter, TransferListener { public synchronized void setNetworkTypeOverride(@C.NetworkType int networkType) { networkTypeOverride = networkType; networkTypeOverrideSet = true; onConnectivityAction(); } @Deprecated  DefaultBandwidthMeter(); private  DefaultBandwidthMeter(
      @Nullable Context context,
      SparseArray<Long> initialBitrateEstimates,
      int maxWeight,
      Clock clock,
      boolean resetOnNetworkTypeChange); synchronized void setNetworkTypeOverride(@C.NetworkType int networkType); @Override synchronized long getBitrateEstimate(); @Override @Nullable TransferListener getTransferListener(); @Override void addEventListener(Handler eventHandler, EventListener eventListener); @Override void removeEventListener(EventListener eventListener); @Override void onTransferInitializing(DataSource source, DataSpec dataSpec, boolean isNetwork); @Override synchronized void onTransferStart(
      DataSource source, DataSpec dataSpec, boolean isNetwork); @Override synchronized void onBytesTransferred(
      DataSource source, DataSpec dataSpec, boolean isNetwork, int bytes); @Override synchronized void onTransferEnd(DataSource source, DataSpec dataSpec, boolean isNetwork); }
DefaultBandwidthMeter implements BandwidthMeter, TransferListener { public synchronized void setNetworkTypeOverride(@C.NetworkType int networkType) { networkTypeOverride = networkType; networkTypeOverrideSet = true; onConnectivityAction(); } @Deprecated  DefaultBandwidthMeter(); private  DefaultBandwidthMeter(
      @Nullable Context context,
      SparseArray<Long> initialBitrateEstimates,
      int maxWeight,
      Clock clock,
      boolean resetOnNetworkTypeChange); synchronized void setNetworkTypeOverride(@C.NetworkType int networkType); @Override synchronized long getBitrateEstimate(); @Override @Nullable TransferListener getTransferListener(); @Override void addEventListener(Handler eventHandler, EventListener eventListener); @Override void removeEventListener(EventListener eventListener); @Override void onTransferInitializing(DataSource source, DataSpec dataSpec, boolean isNetwork); @Override synchronized void onTransferStart(
      DataSource source, DataSpec dataSpec, boolean isNetwork); @Override synchronized void onBytesTransferred(
      DataSource source, DataSpec dataSpec, boolean isNetwork, int bytes); @Override synchronized void onTransferEnd(DataSource source, DataSpec dataSpec, boolean isNetwork); static final Map<String, int[]> DEFAULT_INITIAL_BITRATE_COUNTRY_GROUPS; static final long[] DEFAULT_INITIAL_BITRATE_ESTIMATES_WIFI; static final long[] DEFAULT_INITIAL_BITRATE_ESTIMATES_2G; static final long[] DEFAULT_INITIAL_BITRATE_ESTIMATES_3G; static final long[] DEFAULT_INITIAL_BITRATE_ESTIMATES_4G; static final long DEFAULT_INITIAL_BITRATE_ESTIMATE; static final int DEFAULT_SLIDING_WINDOW_MAX_WEIGHT; }