Fix some Android Studio inspection warnings

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173085316
This commit is contained in:
andrewlewis 2017-10-23 01:23:24 -07:00 committed by Oliver Woodman
parent 9568802c6d
commit 9306b24c65
18 changed files with 20 additions and 28 deletions

View File

@ -226,7 +226,7 @@ public interface Renderer extends ExoPlayerComponent {
/**
* Whether the renderer is ready for the {@link ExoPlayer} instance to transition to
* {@link ExoPlayer#STATE_ENDED}. The player will make this transition as soon as {@code true} is
* {@link Player#STATE_ENDED}. The player will make this transition as soon as {@code true} is
* returned by all of its {@link Renderer}s.
* <p>
* This method may be called when the renderer is in the following states:

View File

@ -31,7 +31,7 @@ public interface RenderersFactory {
*
* @param eventHandler A handler to use when invoking event listeners and outputs.
* @param videoRendererEventListener An event listener for video renderers.
* @param videoRendererEventListener An event listener for audio renderers.
* @param audioRendererEventListener An event listener for audio renderers.
* @param textRendererOutput An output for text renderers.
* @param metadataRendererOutput An output for metadata renderers.
* @return The {@link Renderer instances}.

View File

@ -202,8 +202,7 @@ public interface AudioSink {
* @param trimStartSamples The number of audio samples to trim from the start of data written to
* the sink after this call.
* @param trimEndSamples The number of audio samples to trim from data written to the sink
* immediately preceding the next call to {@link #reset()} or
* {@link #configure(String, int, int, int, int, int[], int, int)}.
* immediately preceding the next call to {@link #reset()} or this method.
* @throws ConfigurationException If an error occurs configuring the sink.
*/
void configure(String inputMimeType, int inputChannelCount, int inputSampleRate,

View File

@ -86,6 +86,7 @@ import java.util.UUID;
/* package */ final MediaDrmCallback callback;
/* package */ final UUID uuid;
/* package */ final PostResponseHandler postResponseHandler;
private @DrmSession.State int state;
private int openCount;
@ -96,8 +97,6 @@ import java.util.UUID;
private byte[] sessionId;
private byte[] offlineLicenseKeySetId;
/* package */ PostResponseHandler postResponseHandler;
/**
* Instantiates a new DRM session.
*

View File

@ -205,7 +205,7 @@ public interface ExoMediaDrm<T extends ExoMediaCrypto> {
*
* @param initData Opaque initialization data specific to the crypto scheme.
* @return An object extends {@link ExoMediaCrypto}, using opaque crypto scheme specific data.
* @throws MediaCryptoException
* @throws MediaCryptoException If the instance can't be created.
*/
T createMediaCrypto(byte[] initData) throws MediaCryptoException;

View File

@ -242,7 +242,7 @@ public final class MatroskaExtractor implements Extractor {
* The value by which to divide a time in microseconds to convert it to the unit of the last value
* in a subrip timecode (milliseconds).
*/
private static long SUBRIP_TIMECODE_LAST_VALUE_SCALING_FACTOR = 1000;
private static final long SUBRIP_TIMECODE_LAST_VALUE_SCALING_FACTOR = 1000;
/**
* The format of a subrip timecode.
*/
@ -270,7 +270,7 @@ public final class MatroskaExtractor implements Extractor {
* The value by which to divide a time in microseconds to convert it to the unit of the last value
* in an SSA timecode (1/100ths of a second).
*/
private static long SSA_TIMECODE_LAST_VALUE_SCALING_FACTOR = 10000;
private static final long SSA_TIMECODE_LAST_VALUE_SCALING_FACTOR = 10000;
/**
* A special end timecode indicating that an SSA subtitle should be displayed until the next
* subtitle, or until the end of the media in the case of the last subtitle.

View File

@ -28,7 +28,6 @@ import com.google.android.exoplayer2.extractor.PositionHolder;
import com.google.android.exoplayer2.extractor.SeekMap;
import com.google.android.exoplayer2.extractor.TrackOutput;
import com.google.android.exoplayer2.extractor.mp4.Atom.ContainerAtom;
import com.google.android.exoplayer2.extractor.mp4.FragmentedMp4Extractor.Flags;
import com.google.android.exoplayer2.metadata.Metadata;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.NalUnitUtil;

View File

@ -101,8 +101,8 @@ public final class ChapterTocFrame extends Id3Frame {
dest.writeByte((byte) (isOrdered ? 1 : 0));
dest.writeStringArray(children);
dest.writeInt(subFrames.length);
for (int i = 0; i < subFrames.length; i++) {
dest.writeParcelable(subFrames[i], 0);
for (Id3Frame subFrame : subFrames) {
dest.writeParcelable(subFrame, 0);
}
}

View File

@ -37,7 +37,6 @@ public final class ClippingMediaSource implements MediaSource, MediaSource.Liste
private final ArrayList<ClippingMediaPeriod> mediaPeriods;
private MediaSource.Listener sourceListener;
private ClippingTimeline clippingTimeline;
/**
* Creates a new clipping source that wraps the specified source.
@ -117,8 +116,7 @@ public final class ClippingMediaSource implements MediaSource, MediaSource.Liste
@Override
public void onSourceInfoRefreshed(Timeline timeline, Object manifest) {
clippingTimeline = new ClippingTimeline(timeline, startUs, endUs);
sourceListener.onSourceInfoRefreshed(clippingTimeline, manifest);
sourceListener.onSourceInfoRefreshed(new ClippingTimeline(timeline, startUs, endUs), manifest);
int count = mediaPeriods.size();
for (int i = 0; i < count; i++) {
mediaPeriods.get(i).setClipping(startUs, endUs);

View File

@ -40,10 +40,10 @@ public final class ConcatenatingMediaSource implements MediaSource {
private final Map<MediaPeriod, Integer> sourceIndexByMediaPeriod;
private final boolean[] duplicateFlags;
private final boolean isAtomic;
private final ShuffleOrder shuffleOrder;
private Listener listener;
private ConcatenatedTimeline timeline;
private ShuffleOrder shuffleOrder;
/**
* @param mediaSources The {@link MediaSource}s to concatenate. It is valid for the same

View File

@ -19,7 +19,6 @@ import android.net.Uri;
import android.os.Handler;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlayer;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
import com.google.android.exoplayer2.extractor.Extractor;
import com.google.android.exoplayer2.extractor.ExtractorsFactory;
@ -84,7 +83,6 @@ public final class ExtractorMediaSource implements MediaSource, ExtractorMediaPe
private final int minLoadableRetryCount;
private final Handler eventHandler;
private final EventListener eventListener;
private final Timeline.Period period;
private final String customCacheKey;
private final int continueLoadingCheckIntervalBytes;
@ -149,7 +147,6 @@ public final class ExtractorMediaSource implements MediaSource, ExtractorMediaPe
this.eventListener = eventListener;
this.customCacheKey = customCacheKey;
this.continueLoadingCheckIntervalBytes = continueLoadingCheckIntervalBytes;
period = new Timeline.Period();
}
@Override
@ -187,7 +184,7 @@ public final class ExtractorMediaSource implements MediaSource, ExtractorMediaPe
public void onSourceInfoRefreshed(long durationUs, boolean isSeekable) {
// If we already have the duration from a previous source info refresh, use it.
durationUs = durationUs == C.TIME_UNSET ? timelineDurationUs : durationUs;
if (timelineDurationUs == durationUs && timelineIsSeekable == isSeekable
if ((timelineDurationUs == durationUs && timelineIsSeekable == isSeekable)
|| (timelineDurationUs != C.TIME_UNSET && durationUs == C.TIME_UNSET)) {
// Suppress no-op source info changes.
return;

View File

@ -82,7 +82,7 @@ public final class CeaUtil {
* number of 0xFF bytes and T is the value of the terminating byte.
*
* @param buffer The buffer from which to read the value.
* @returns The read value, or -1 if the end of the buffer is reached before a value is read.
* @return The read value, or -1 if the end of the buffer is reached before a value is read.
*/
private static int readNon255TerminatedValue(ParsableByteArray buffer) {
int b;

View File

@ -140,7 +140,7 @@ public interface Cache {
* @param key The key of the data being requested.
* @param position The position of the data being requested.
* @return The {@link CacheSpan}.
* @throws InterruptedException
* @throws InterruptedException If the thread was interrupted.
*/
CacheSpan startReadWrite(String key, long position) throws InterruptedException, CacheException;

View File

@ -32,7 +32,7 @@ import junit.framework.TestCase;
*/
public class SsManifestTest extends TestCase {
private static ProtectionElement DUMMY_PROTECTION_ELEMENT =
private static final ProtectionElement DUMMY_PROTECTION_ELEMENT =
new ProtectionElement(C.WIDEVINE_UUID, new byte[] {0, 1, 2});
public void testCopy() throws Exception {

View File

@ -21,6 +21,6 @@
<path
android:fillColor="#FFFFFFFF"
android:pathData="M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20
17.96 7.46 20 9.5V4h-5.5zm.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04
17.96 7.46 20 9.5V4h-5.5zm0.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04
2.04-3.13-3.13z" />
</vector>

View File

@ -170,7 +170,7 @@ public final class DashDownloadTest extends ActivityInstrumentationTestCase2<Hos
private static class TestProgressListener implements ProgressListener {
private float stopAt;
private final float stopAt;
private TestProgressListener(float stopAt) {
this.stopAt = stopAt;

View File

@ -134,7 +134,7 @@ public class FakeSimpleExoPlayer extends SimpleExoPlayer {
@Override
public void setPlayWhenReady(boolean playWhenReady) {
if (playWhenReady != true) {
if (!playWhenReady) {
throw new UnsupportedOperationException();
}
}
@ -339,7 +339,7 @@ public class FakeSimpleExoPlayer extends SimpleExoPlayer {
@Override
public void prepare(final MediaSource mediaSource, boolean resetPosition, boolean resetState) {
if (resetPosition != true || resetState != true) {
if (!resetPosition || !resetState) {
throw new UnsupportedOperationException();
}
this.mediaSource = mediaSource;