Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
23d680a4
authored
Jul 13, 2020
by
ibaker
Committed by
Oliver Woodman
Jul 24, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Suppress deprecation warnings in deprecated places
PiperOrigin-RevId: 320970814
parent
f2055396
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
21 additions
and
1 deletions
extensions/cronet/src/main/java/com/google/android/exoplayer2/ext/cronet/CronetDataSource.java
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/PlayerWrapper.java
extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSource.java
library/common/src/main/java/com/google/android/exoplayer2/C.java
library/common/src/main/java/com/google/android/exoplayer2/Format.java
library/core/src/main/java/com/google/android/exoplayer2/audio/AudioSink.java
library/core/src/main/java/com/google/android/exoplayer2/audio/DefaultAudioSink.java
library/core/src/main/java/com/google/android/exoplayer2/source/SingleSampleMediaSource.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultHttpDataSource.java
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java
library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java
library/smoothstreaming/src/test/java/com/google/android/exoplayer2/source/smoothstreaming/SsMediaSourceTest.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java
extensions/cronet/src/main/java/com/google/android/exoplayer2/ext/cronet/CronetDataSource.java
View file @
23d680a4
...
@@ -243,6 +243,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
...
@@ -243,6 +243,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
* @deprecated Use {@link #CronetDataSource(CronetEngine, Executor)} and {@link
* @deprecated Use {@link #CronetDataSource(CronetEngine, Executor)} and {@link
* #setContentTypePredicate(Predicate)}.
* #setContentTypePredicate(Predicate)}.
*/
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
@Deprecated
public
CronetDataSource
(
public
CronetDataSource
(
CronetEngine
cronetEngine
,
CronetEngine
cronetEngine
,
...
@@ -276,6 +277,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
...
@@ -276,6 +277,7 @@ public class CronetDataSource extends BaseDataSource implements HttpDataSource {
* @deprecated Use {@link #CronetDataSource(CronetEngine, Executor, int, int, boolean,
* @deprecated Use {@link #CronetDataSource(CronetEngine, Executor, int, int, boolean,
* RequestProperties)} and {@link #setContentTypePredicate(Predicate)}.
* RequestProperties)} and {@link #setContentTypePredicate(Predicate)}.
*/
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
@Deprecated
public
CronetDataSource
(
public
CronetDataSource
(
CronetEngine
cronetEngine
,
CronetEngine
cronetEngine
,
...
...
extensions/media2/src/main/java/com/google/android/exoplayer2/ext/media2/PlayerWrapper.java
View file @
23d680a4
...
@@ -421,6 +421,7 @@ import java.util.List;
...
@@ -421,6 +421,7 @@ import java.util.List;
listener
.
onShuffleModeChanged
(
Utils
.
getShuffleMode
(
shuffleModeEnabled
));
listener
.
onShuffleModeChanged
(
Utils
.
getShuffleMode
(
shuffleModeEnabled
));
}
}
@SuppressWarnings
(
"deprecation"
)
private
void
handlePlaybackParametersChanged
(
PlaybackParameters
playbackParameters
)
{
private
void
handlePlaybackParametersChanged
(
PlaybackParameters
playbackParameters
)
{
listener
.
onPlaybackSpeedChanged
(
playbackParameters
.
speed
);
listener
.
onPlaybackSpeedChanged
(
playbackParameters
.
speed
);
}
}
...
...
extensions/okhttp/src/main/java/com/google/android/exoplayer2/ext/okhttp/OkHttpDataSource.java
View file @
23d680a4
...
@@ -119,6 +119,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
...
@@ -119,6 +119,7 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
* @deprecated Use {@link #OkHttpDataSource(Call.Factory, String)} and {@link
* @deprecated Use {@link #OkHttpDataSource(Call.Factory, String)} and {@link
* #setContentTypePredicate(Predicate)}.
* #setContentTypePredicate(Predicate)}.
*/
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
@Deprecated
public
OkHttpDataSource
(
public
OkHttpDataSource
(
Call
.
Factory
callFactory
,
Call
.
Factory
callFactory
,
...
...
library/common/src/main/java/com/google/android/exoplayer2/C.java
View file @
23d680a4
...
@@ -564,6 +564,7 @@ public final class C {
...
@@ -564,6 +564,7 @@ public final class C {
// )
// )
/** @deprecated Use {@code Renderer.VideoScalingMode}. */
/** @deprecated Use {@code Renderer.VideoScalingMode}. */
@SuppressWarnings
(
"deprecation"
)
@Documented
@Documented
@Retention
(
RetentionPolicy
.
SOURCE
)
@Retention
(
RetentionPolicy
.
SOURCE
)
@IntDef
(
value
=
{
VIDEO_SCALING_MODE_SCALE_TO_FIT
,
VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING
})
@IntDef
(
value
=
{
VIDEO_SCALING_MODE_SCALE_TO_FIT
,
VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING
})
...
...
library/common/src/main/java/com/google/android/exoplayer2/Format.java
View file @
23d680a4
...
@@ -1213,6 +1213,8 @@ public final class Format implements Parcelable {
...
@@ -1213,6 +1213,8 @@ public final class Format implements Parcelable {
return
new
Builder
().
setId
(
id
).
setSampleMimeType
(
sampleMimeType
).
build
();
return
new
Builder
().
setId
(
id
).
setSampleMimeType
(
sampleMimeType
).
build
();
}
}
// Some fields are deprecated but they're still assigned below.
@SuppressWarnings
(
"deprecation"
)
/* package */
Format
(
/* package */
Format
(
@Nullable
String
id
,
@Nullable
String
id
,
@Nullable
String
label
,
@Nullable
String
label
,
...
@@ -1298,7 +1300,8 @@ public final class Format implements Parcelable {
...
@@ -1298,7 +1300,8 @@ public final class Format implements Parcelable {
this
.
exoMediaCryptoType
=
exoMediaCryptoType
;
this
.
exoMediaCryptoType
=
exoMediaCryptoType
;
}
}
@SuppressWarnings
(
"ResourceType"
)
// Some fields are deprecated but they're still assigned below.
@SuppressWarnings
({
"ResourceType"
,
"deprecation"
})
/* package */
Format
(
Parcel
in
)
{
/* package */
Format
(
Parcel
in
)
{
id
=
in
.
readString
();
id
=
in
.
readString
();
label
=
in
.
readString
();
label
=
in
.
readString
();
...
...
library/core/src/main/java/com/google/android/exoplayer2/audio/AudioSink.java
View file @
23d680a4
...
@@ -302,6 +302,7 @@ public interface AudioSink {
...
@@ -302,6 +302,7 @@ public interface AudioSink {
* @deprecated Use {@link #setPlaybackSpeed(float)} and {@link #setSkipSilenceEnabled(boolean)}
* @deprecated Use {@link #setPlaybackSpeed(float)} and {@link #setSkipSilenceEnabled(boolean)}
* instead.
* instead.
*/
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
@Deprecated
void
setPlaybackParameters
(
PlaybackParameters
playbackParameters
);
void
setPlaybackParameters
(
PlaybackParameters
playbackParameters
);
...
...
library/core/src/main/java/com/google/android/exoplayer2/audio/DefaultAudioSink.java
View file @
23d680a4
...
@@ -86,6 +86,7 @@ public final class DefaultAudioSink implements AudioSink {
...
@@ -86,6 +86,7 @@ public final class DefaultAudioSink implements AudioSink {
* @deprecated Use {@link #applyPlaybackSpeed(float)} and {@link
* @deprecated Use {@link #applyPlaybackSpeed(float)} and {@link
* #applySkipSilenceEnabled(boolean)} instead.
* #applySkipSilenceEnabled(boolean)} instead.
*/
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
@Deprecated
PlaybackParameters
applyPlaybackParameters
(
PlaybackParameters
playbackParameters
);
PlaybackParameters
applyPlaybackParameters
(
PlaybackParameters
playbackParameters
);
...
...
library/core/src/main/java/com/google/android/exoplayer2/source/SingleSampleMediaSource.java
View file @
23d680a4
...
@@ -229,6 +229,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
...
@@ -229,6 +229,7 @@ public final class SingleSampleMediaSource extends BaseMediaSource {
}
}
/** @deprecated Use {@link Factory} instead. */
/** @deprecated Use {@link Factory} instead. */
@SuppressWarnings
(
"deprecation"
)
@Deprecated
@Deprecated
public
SingleSampleMediaSource
(
public
SingleSampleMediaSource
(
Uri
uri
,
Uri
uri
,
...
...
library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultHttpDataSource.java
View file @
23d680a4
...
@@ -150,6 +150,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
...
@@ -150,6 +150,7 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
* @deprecated Use {@link #DefaultHttpDataSource(String)} and {@link
* @deprecated Use {@link #DefaultHttpDataSource(String)} and {@link
* #setContentTypePredicate(Predicate)}.
* #setContentTypePredicate(Predicate)}.
*/
*/
@SuppressWarnings
(
"deprecation"
)
@Deprecated
@Deprecated
public
DefaultHttpDataSource
(
String
userAgent
,
@Nullable
Predicate
<
String
>
contentTypePredicate
)
{
public
DefaultHttpDataSource
(
String
userAgent
,
@Nullable
Predicate
<
String
>
contentTypePredicate
)
{
this
(
this
(
...
...
library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java
View file @
23d680a4
...
@@ -134,6 +134,7 @@ public final class SimpleCache implements Cache {
...
@@ -134,6 +134,7 @@ public final class SimpleCache implements Cache {
* @deprecated Use a constructor that takes a {@link DatabaseProvider} for improved performance.
* @deprecated Use a constructor that takes a {@link DatabaseProvider} for improved performance.
*/
*/
@Deprecated
@Deprecated
@SuppressWarnings
(
"deprecation"
)
public
SimpleCache
(
File
cacheDir
,
CacheEvictor
evictor
)
{
public
SimpleCache
(
File
cacheDir
,
CacheEvictor
evictor
)
{
this
(
cacheDir
,
evictor
,
null
,
false
);
this
(
cacheDir
,
evictor
,
null
,
false
);
}
}
...
...
library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java
View file @
23d680a4
...
@@ -1603,6 +1603,7 @@ public final class AnalyticsCollectorTest {
...
@@ -1603,6 +1603,7 @@ public final class AnalyticsCollectorTest {
assertThat
(
reportedEvents
).
isEmpty
();
assertThat
(
reportedEvents
).
isEmpty
();
}
}
@SuppressWarnings
(
"deprecation"
)
// Testing deprecated behaviour.
@Override
@Override
public
void
onPlayerStateChanged
(
public
void
onPlayerStateChanged
(
EventTime
eventTime
,
boolean
playWhenReady
,
@Player
.
State
int
playbackState
)
{
EventTime
eventTime
,
boolean
playWhenReady
,
@Player
.
State
int
playbackState
)
{
...
@@ -1626,6 +1627,7 @@ public final class AnalyticsCollectorTest {
...
@@ -1626,6 +1627,7 @@ public final class AnalyticsCollectorTest {
reportedEvents
.
add
(
new
ReportedEvent
(
EVENT_SEEK_STARTED
,
eventTime
));
reportedEvents
.
add
(
new
ReportedEvent
(
EVENT_SEEK_STARTED
,
eventTime
));
}
}
@SuppressWarnings
(
"deprecation"
)
// Testing deprecated behaviour.
@Override
@Override
public
void
onSeekProcessed
(
EventTime
eventTime
)
{
public
void
onSeekProcessed
(
EventTime
eventTime
)
{
reportedEvents
.
add
(
new
ReportedEvent
(
EVENT_SEEK_PROCESSED
,
eventTime
));
reportedEvents
.
add
(
new
ReportedEvent
(
EVENT_SEEK_PROCESSED
,
eventTime
));
...
...
library/smoothstreaming/src/test/java/com/google/android/exoplayer2/source/smoothstreaming/SsMediaSourceTest.java
View file @
23d680a4
...
@@ -82,6 +82,7 @@ public class SsMediaSourceTest {
...
@@ -82,6 +82,7 @@ public class SsMediaSourceTest {
}
}
// Tests backwards compatibility
// Tests backwards compatibility
@SuppressWarnings
(
"deprecation"
)
@Test
@Test
public
void
factoryCreateMediaSource_setsDeprecatedMediaSourceTag
()
{
public
void
factoryCreateMediaSource_setsDeprecatedMediaSourceTag
()
{
Object
tag
=
new
Object
();
Object
tag
=
new
Object
();
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerNotificationManager.java
View file @
23d680a4
...
@@ -971,6 +971,8 @@ public class PlayerNotificationManager {
...
@@ -971,6 +971,8 @@ public class PlayerNotificationManager {
}
}
}
}
// We're calling a deprecated listener method that we still want to notify.
@SuppressWarnings
(
"deprecation"
)
private
void
startOrUpdateNotification
(
Player
player
,
@Nullable
Bitmap
bitmap
)
{
private
void
startOrUpdateNotification
(
Player
player
,
@Nullable
Bitmap
bitmap
)
{
boolean
ongoing
=
getOngoing
(
player
);
boolean
ongoing
=
getOngoing
(
player
);
builder
=
createNotification
(
player
,
builder
,
ongoing
,
bitmap
);
builder
=
createNotification
(
player
,
builder
,
ongoing
,
bitmap
);
...
@@ -993,6 +995,8 @@ public class PlayerNotificationManager {
...
@@ -993,6 +995,8 @@ public class PlayerNotificationManager {
}
}
}
}
// We're calling a deprecated listener method that we still want to notify.
@SuppressWarnings
(
"deprecation"
)
private
void
stopNotification
(
boolean
dismissedByUser
)
{
private
void
stopNotification
(
boolean
dismissedByUser
)
{
if
(
isNotificationStarted
)
{
if
(
isNotificationStarted
)
{
isNotificationStarted
=
false
;
isNotificationStarted
=
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment