Commit 57832724 by olly Committed by Oliver Woodman

Fix missing generics

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129624395
parent a7cb98d9
......@@ -32,16 +32,16 @@ public final class DefaultOkHttpDataSourceFactory implements Factory {
private final Context context;
private final OkHttpClient client;
private final String userAgent;
private final TransferListener transferListener;
private final TransferListener<? super DataSource> transferListener;
private final CacheControl cacheControl;
public DefaultOkHttpDataSourceFactory(Context context, OkHttpClient client, String userAgent,
TransferListener transferListener) {
TransferListener<? super DataSource> transferListener) {
this(context, client, userAgent, transferListener, null);
}
public DefaultOkHttpDataSourceFactory(Context context, OkHttpClient client, String userAgent,
TransferListener transferListener, CacheControl cacheControl) {
TransferListener<? super DataSource> transferListener, CacheControl cacheControl) {
this.context = context.getApplicationContext();
this.client = client;
this.userAgent = userAgent;
......
......@@ -57,8 +57,8 @@ public final class DefaultDataSource implements DataSource {
* @param allowCrossProtocolRedirects Whether cross-protocol redirects (i.e. redirects from HTTP
* to HTTPS and vice versa) are enabled when fetching remote data..
*/
public DefaultDataSource(Context context, TransferListener listener, String userAgent,
boolean allowCrossProtocolRedirects) {
public DefaultDataSource(Context context, TransferListener<? super DataSource> listener,
String userAgent, boolean allowCrossProtocolRedirects) {
this(context, listener,
new DefaultHttpDataSource(userAgent, null, listener,
DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
......@@ -74,7 +74,8 @@ public final class DefaultDataSource implements DataSource {
* @param baseDataSource A {@link DataSource} to use for URI schemes other than file, asset and
* content. This {@link DataSource} should normally support at least http(s).
*/
public DefaultDataSource(Context context, TransferListener listener, DataSource baseDataSource) {
public DefaultDataSource(Context context, TransferListener<? super DataSource> listener,
DataSource baseDataSource) {
this.baseDataSource = Assertions.checkNotNull(baseDataSource);
this.fileDataSource = new FileDataSource(listener);
this.assetDataSource = new AssetDataSource(context, listener);
......
......@@ -26,7 +26,7 @@ public final class DefaultDataSourceFactory implements Factory {
private final Context context;
private final String userAgent;
private final TransferListener listener;
private final TransferListener<? super DataSource> listener;
private final boolean allowCrossProtocolRedirects;
/**
......@@ -42,7 +42,8 @@ public final class DefaultDataSourceFactory implements Factory {
* @param userAgent The User-Agent string that should be used.
* @param listener An optional listener.
*/
public DefaultDataSourceFactory(Context context, String userAgent, TransferListener listener) {
public DefaultDataSourceFactory(Context context, String userAgent,
TransferListener<? super DataSource> listener) {
this(context, userAgent, listener, false);
}
......@@ -53,8 +54,8 @@ public final class DefaultDataSourceFactory implements Factory {
* @param allowCrossProtocolRedirects Whether cross-protocol redirects (i.e. redirects from HTTP
* to HTTPS and vice versa) are enabled.
*/
public DefaultDataSourceFactory(Context context, String userAgent, TransferListener listener,
boolean allowCrossProtocolRedirects) {
public DefaultDataSourceFactory(Context context, String userAgent,
TransferListener<? super DataSource> listener, boolean allowCrossProtocolRedirects) {
this.context = context.getApplicationContext();
this.userAgent = userAgent;
this.listener = listener;
......
......@@ -68,7 +68,7 @@ public final class UdpDataSource implements DataSource {
/**
* @param listener An optional listener.
*/
public UdpDataSource(TransferListener listener) {
public UdpDataSource(TransferListener<? super UdpDataSource> listener) {
this(listener, DEFAULT_MAX_PACKET_SIZE);
}
......
......@@ -732,7 +732,7 @@ public final class DashTest extends ActivityInstrumentationTestCase2<HostActivit
@Override
public MediaSource buildSource(HostActivity host, String userAgent,
TransferListener mediaTransferListener) {
TransferListener<? super DataSource> mediaTransferListener) {
DataSource.Factory manifestDataSourceFactory = new DefaultDataSourceFactory(host, userAgent);
DataSource.Factory mediaDataSourceFactory = new DefaultDataSourceFactory(host, userAgent,
mediaTransferListener);
......
......@@ -35,12 +35,12 @@ import com.google.android.exoplayer2.trackselection.AdaptiveVideoTrackSelection;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
import com.google.android.exoplayer2.upstream.BandwidthMeter;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.util.Util;
import junit.framework.Assert;
/**
* A {@link HostedTest} for {@link ExoPlayer} playback tests.
*/
......@@ -307,7 +307,7 @@ public abstract class ExoHostedTest implements HostedTest, ExoPlayer.EventListen
@SuppressWarnings("unused")
protected abstract MediaSource buildSource(HostActivity host, String userAgent,
TransferListener mediaTransferListener);
TransferListener<? super DataSource> mediaTransferListener);
@SuppressWarnings("unused")
protected void onPlayerErrorInternal(ExoPlaybackException error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment