Skip to content

Commit

Permalink
Remove deprecated CronetDataSource constructors
Browse files Browse the repository at this point in the history
#minor-release

PiperOrigin-RevId: 427216911
  • Loading branch information
icbaker committed Feb 21, 2022
1 parent 0dbe01d commit 94ee09a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 127 deletions.
6 changes: 4 additions & 2 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
([#9619](https://github.com/google/ExoPlayer/issues/9619)).
* Transformer:
* The transformer module is no longer included by depending on
`com.google.android.exoplayer:exoplayer`. To continue using
transformer, add an additional dependency on
`com.google.android.exoplayer:exoplayer`. To continue using transformer,
add an additional dependency on
`com.google.android.exoplayer:exoplayer-transformer`.
* Cast extension
* Fix bug that prevented `CastPlayer` from calling `onIsPlayingChanged`
Expand Down Expand Up @@ -186,6 +186,8 @@
constructors. Use the `DefaultRenderersFactory(Context)` constructor,
`DefaultRenderersFactory#setExtensionRendererMode`, and
`DefaultRenderersFactory#setAllowedVideoJoiningTimeMs` instead.
* Remove all public `CronetDataSource` constructors. Use
`CronetDataSource.Factory` instead.
* Change the following `IntDefs` to `@Target(TYPE_USE)` only. This may break
the compilation of usages in Kotlin, which can be fixed by moving the
annotation to annotate the type (`Int`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,130 +430,6 @@ public OpenException(

private volatile long currentConnectTimeoutMs;

/** @deprecated Use {@link CronetDataSource.Factory} instead. */
@SuppressWarnings("deprecation")
@Deprecated
public CronetDataSource(CronetEngine cronetEngine, Executor executor) {
this(
cronetEngine,
executor,
DEFAULT_CONNECT_TIMEOUT_MILLIS,
DEFAULT_READ_TIMEOUT_MILLIS,
/* resetTimeoutOnRedirects= */ false,
/* defaultRequestProperties= */ null);
}

/** @deprecated Use {@link CronetDataSource.Factory} instead. */
@Deprecated
public CronetDataSource(
CronetEngine cronetEngine,
Executor executor,
int connectTimeoutMs,
int readTimeoutMs,
boolean resetTimeoutOnRedirects,
@Nullable RequestProperties defaultRequestProperties) {
this(
cronetEngine,
executor,
REQUEST_PRIORITY_MEDIUM,
connectTimeoutMs,
readTimeoutMs,
resetTimeoutOnRedirects,
/* handleSetCookieRequests= */ false,
/* userAgent= */ null,
defaultRequestProperties,
/* contentTypePredicate= */ null,
/* keepPostFor302Redirects */ false);
}

/** @deprecated Use {@link CronetDataSource.Factory} instead. */
@Deprecated
public CronetDataSource(
CronetEngine cronetEngine,
Executor executor,
int connectTimeoutMs,
int readTimeoutMs,
boolean resetTimeoutOnRedirects,
@Nullable RequestProperties defaultRequestProperties,
boolean handleSetCookieRequests) {
this(
cronetEngine,
executor,
REQUEST_PRIORITY_MEDIUM,
connectTimeoutMs,
readTimeoutMs,
resetTimeoutOnRedirects,
handleSetCookieRequests,
/* userAgent= */ null,
defaultRequestProperties,
/* contentTypePredicate= */ null,
/* keepPostFor302Redirects */ false);
}

/** @deprecated Use {@link CronetDataSource.Factory} instead. */
@SuppressWarnings("deprecation")
@Deprecated
public CronetDataSource(
CronetEngine cronetEngine,
Executor executor,
@Nullable Predicate<String> contentTypePredicate) {
this(
cronetEngine,
executor,
contentTypePredicate,
DEFAULT_CONNECT_TIMEOUT_MILLIS,
DEFAULT_READ_TIMEOUT_MILLIS,
/* resetTimeoutOnRedirects= */ false,
/* defaultRequestProperties= */ null);
}

/** @deprecated Use {@link CronetDataSource.Factory} instead. */
@SuppressWarnings("deprecation")
@Deprecated
public CronetDataSource(
CronetEngine cronetEngine,
Executor executor,
@Nullable Predicate<String> contentTypePredicate,
int connectTimeoutMs,
int readTimeoutMs,
boolean resetTimeoutOnRedirects,
@Nullable RequestProperties defaultRequestProperties) {
this(
cronetEngine,
executor,
contentTypePredicate,
connectTimeoutMs,
readTimeoutMs,
resetTimeoutOnRedirects,
defaultRequestProperties,
/* handleSetCookieRequests= */ false);
}

/** @deprecated Use {@link CronetDataSource.Factory} instead. */
@Deprecated
public CronetDataSource(
CronetEngine cronetEngine,
Executor executor,
@Nullable Predicate<String> contentTypePredicate,
int connectTimeoutMs,
int readTimeoutMs,
boolean resetTimeoutOnRedirects,
@Nullable RequestProperties defaultRequestProperties,
boolean handleSetCookieRequests) {
this(
cronetEngine,
executor,
REQUEST_PRIORITY_MEDIUM,
connectTimeoutMs,
readTimeoutMs,
resetTimeoutOnRedirects,
handleSetCookieRequests,
/* userAgent= */ null,
defaultRequestProperties,
contentTypePredicate,
/* keepPostFor302Redirects */ false);
}

protected CronetDataSource(
CronetEngine cronetEngine,
Executor executor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.google.android.exoplayer2.ext.cronet;

import static org.chromium.net.UrlRequest.Builder.REQUEST_PRIORITY_MEDIUM;

import androidx.annotation.Nullable;
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
import com.google.android.exoplayer2.upstream.HttpDataSource;
Expand Down Expand Up @@ -344,10 +346,15 @@ protected HttpDataSource createDataSourceInternal(
new CronetDataSource(
cronetEngine,
executor,
REQUEST_PRIORITY_MEDIUM,
connectTimeoutMs,
readTimeoutMs,
resetTimeoutOnRedirects,
defaultRequestProperties);
/* handleSetCookieRequests= */ false,
/* userAgent= */ null,
defaultRequestProperties,
/* contentTypePredicate= */ null,
/* keepPostFor302Redirects */ false);
if (transferListener != null) {
dataSource.addTransferListener(transferListener);
}
Expand Down

0 comments on commit 94ee09a

Please sign in to comment.