diff --git a/library/core/src/main/java/com/google/android/exoplayer2/Player.java b/library/core/src/main/java/com/google/android/exoplayer2/Player.java index bb51cde793..0e4cf68aa4 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/Player.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/Player.java @@ -430,7 +430,7 @@ public interface Player { */ @Retention(RetentionPolicy.SOURCE) @IntDef({REPEAT_MODE_OFF, REPEAT_MODE_ONE, REPEAT_MODE_ALL}) - public @interface RepeatMode {} + @interface RepeatMode {} /** * Normal playback without repetition. */ @@ -457,7 +457,7 @@ public interface Player { DISCONTINUITY_REASON_AD_INSERTION, DISCONTINUITY_REASON_INTERNAL }) - public @interface DiscontinuityReason {} + @interface DiscontinuityReason {} /** * Automatic playback transition from one period in the timeline to the next. The period index may * be the same as it was before the discontinuity in case the current period is repeated. @@ -485,7 +485,7 @@ public interface Player { TIMELINE_CHANGE_REASON_RESET, TIMELINE_CHANGE_REASON_DYNAMIC }) - public @interface TimelineChangeReason {} + @interface TimelineChangeReason {} /** * Timeline and manifest changed as a result of a player initialization with new media. */ diff --git a/library/core/src/main/java/com/google/android/exoplayer2/Renderer.java b/library/core/src/main/java/com/google/android/exoplayer2/Renderer.java index d56b2f4f7b..d1e1541cdc 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/Renderer.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/Renderer.java @@ -40,7 +40,7 @@ public interface Renderer extends PlayerMessage.Target { */ @Retention(RetentionPolicy.SOURCE) @IntDef({STATE_DISABLED, STATE_ENABLED, STATE_STARTED}) - public @interface State {} + @interface State {} /** * The renderer is disabled. */ diff --git a/library/core/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java b/library/core/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java index 40bbde4d8a..bed3545d78 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java @@ -45,7 +45,7 @@ public interface DrmSession { */ @Retention(RetentionPolicy.SOURCE) @IntDef({STATE_RELEASED, STATE_ERROR, STATE_OPENING, STATE_OPENED, STATE_OPENED_WITH_KEYS}) - public @interface State {} + @interface State {} /** * The session has been released. */ diff --git a/library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java b/library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java index 44a31a1896..548f9cb669 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java @@ -227,7 +227,7 @@ public final class FrameworkMediaDrm implements ExoMediaDrmsneakyThrowInternal(t); + Util.sneakyThrowInternal(t); } @SuppressWarnings("unchecked") @@ -1749,6 +1750,7 @@ public final class Util { // Attempt to read sys.display-size. String sysDisplaySize = null; try { + @SuppressLint("PrivateApi") Class systemProperties = Class.forName("android.os.SystemProperties"); Method getMethod = systemProperties.getMethod("get", String.class); sysDisplaySize = (String) getMethod.invoke(systemProperties, "sys.display-size"); diff --git a/library/core/src/test/java/com/google/android/exoplayer2/source/ConcatenatingMediaSourceTest.java b/library/core/src/test/java/com/google/android/exoplayer2/source/ConcatenatingMediaSourceTest.java index 3ac962f6c3..507b718e8f 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/source/ConcatenatingMediaSourceTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/source/ConcatenatingMediaSourceTest.java @@ -97,7 +97,7 @@ public final class ConcatenatingMediaSourceTest { // Add bulk. mediaSource.addMediaSources( - 3, Arrays.asList(childSources[4], childSources[5], childSources[6])); + 3, Arrays.asList(childSources[4], childSources[5], childSources[6])); timeline = testRunner.assertTimelineChangeBlocking(); TimelineAsserts.assertPeriodCounts(timeline, 2, 4, 1, 5, 6, 7, 3); TimelineAsserts.assertWindowTags(timeline, 222, 444, 111, 555, 666, 777, 333); @@ -375,7 +375,7 @@ public final class ConcatenatingMediaSourceTest { }; Timeline nonEmptyTimeline = new FakeTimeline(/* windowCount = */ 1); - mediaSource.addMediaSources(Arrays.asList(childSources)); + mediaSource.addMediaSources(Arrays.asList(childSources)); Timeline timeline = testRunner.prepareSource(); TimelineAsserts.assertEmpty(timeline); @@ -642,7 +642,7 @@ public final class ConcatenatingMediaSourceTest { ConcatenatingMediaSource mediaSource = new ConcatenatingMediaSource(/* isAtomic= */ true, new FakeShuffleOrder(0)); testRunner = new MediaSourceTestRunner(mediaSource, null); - mediaSource.addMediaSources(Arrays.asList(createMediaSources(3))); + mediaSource.addMediaSources(Arrays.asList(createMediaSources(3))); Timeline timeline = testRunner.prepareSource(); TimelineAsserts.assertWindowTags(timeline, 111, 222, 333); TimelineAsserts.assertPeriodCounts(timeline, 1, 2, 3); @@ -747,7 +747,7 @@ public final class ConcatenatingMediaSourceTest { mediaSource.addMediaSource(childSource); mediaSource.addMediaSource(childSource); testRunner.prepareSource(); - mediaSource.addMediaSources(Arrays.asList(childSource, childSource)); + mediaSource.addMediaSources(Arrays.asList(childSource, childSource)); Timeline timeline = testRunner.assertTimelineChangeBlocking(); TimelineAsserts.assertPeriodCounts(timeline, 1, 1, 1, 1, 1, 1, 1, 1); @@ -780,7 +780,7 @@ public final class ConcatenatingMediaSourceTest { testRunner.prepareSource(); mediaSource.addMediaSources( - Arrays.asList(childSource, nestedConcatenation, nestedConcatenation)); + Arrays.asList(childSource, nestedConcatenation, nestedConcatenation)); testRunner.assertTimelineChangeBlocking(); nestedConcatenation.addMediaSource(childSource); testRunner.assertTimelineChangeBlocking(); diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java index 6218e4624d..70c40b76e9 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeAdaptiveMediaPeriod.java @@ -76,8 +76,13 @@ public class FakeAdaptiveMediaPeriod extends FakeMediaPeriod } @Override - public long selectTracks(TrackSelection[] selections, boolean[] mayRetainStreamFlags, - SampleStream[] streams, boolean[] streamResetFlags, long positionUs) { + @SuppressWarnings("unchecked") + public long selectTracks( + TrackSelection[] selections, + boolean[] mayRetainStreamFlags, + SampleStream[] streams, + boolean[] streamResetFlags, + long positionUs) { long returnPositionUs = super.selectTracks(selections, mayRetainStreamFlags, streams, streamResetFlags, positionUs); List> validStreams = new ArrayList<>();