Commit db991873 by olly Committed by Oliver Woodman

Fix some lint warnings

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164105662
parent 78cdd086
......@@ -95,7 +95,7 @@ import com.google.android.exoplayer2.util.Assertions;
* of the on-demand stream ends, playback of the live stream will start from its default position
* near the live edge.
*
* <h3 id="single-file">On-demand stream with mid-roll ads</h3>
* <h3 id="single-file-midrolls">On-demand stream with mid-roll ads</h3>
* <p align="center">
* <img src="doc-files/timeline-single-file-midrolls.svg" alt="Example timeline for an on-demand
* stream with mid-roll ad groups">
......
......@@ -23,6 +23,7 @@ import com.google.android.exoplayer2.text.SimpleSubtitleDecoder;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.LongArray;
import com.google.android.exoplayer2.util.ParsableByteArray;
import com.google.android.exoplayer2.util.Util;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
......@@ -132,7 +133,7 @@ public final class SsaDecoder extends SimpleSubtitleDecoder {
formatEndIndex = C.INDEX_UNSET;
formatTextIndex = C.INDEX_UNSET;
for (int i = 0; i < formatKeyCount; i++) {
String key = values[i].trim().toLowerCase();
String key = Util.toLowerInvariant(values[i].trim());
switch (key) {
case "start":
formatStartIndex = i;
......
......@@ -290,7 +290,7 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
String displayAlign = XmlPullParserUtil.getAttributeValue(xmlParser,
TtmlNode.ATTR_TTS_DISPLAY_ALIGN);
if (displayAlign != null) {
switch (displayAlign.toLowerCase()) {
switch (Util.toLowerInvariant(displayAlign)) {
case "center":
lineAnchor = Cue.ANCHOR_TYPE_MIDDLE;
line += height / 2;
......
......@@ -895,7 +895,7 @@ public final class Util {
*/
@C.ContentType
public static int inferContentType(String fileName) {
fileName = fileName.toLowerCase();
fileName = Util.toLowerInvariant(fileName);
if (fileName.endsWith(".mpd")) {
return C.TYPE_DASH;
} else if (fileName.endsWith(".m3u8")) {
......
......@@ -39,7 +39,6 @@ import java.io.IOException;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
/**
* Source of Hls (possibly adaptive) chunks.
......@@ -366,7 +365,7 @@ import java.util.Locale;
private void setEncryptionData(Uri keyUri, String iv, byte[] secretKey) {
String trimmedIv;
if (iv.toLowerCase(Locale.getDefault()).startsWith("0x")) {
if (Util.toLowerInvariant(iv).startsWith("0x")) {
trimmedIv = iv.substring(2);
} else {
trimmedIv = iv;
......
......@@ -15,6 +15,7 @@
*/
package com.google.android.exoplayer2.ui;
import android.annotation.SuppressLint;
import android.widget.TextView;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.Format;
......@@ -25,6 +26,7 @@ import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.decoder.DecoderCounters;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
import java.util.Locale;
/**
* A helper class for periodically updating a {@link TextView} with debug information obtained from
......@@ -125,6 +127,7 @@ public final class DebugTextViewHelper implements Runnable, Player.EventListener
// Private methods.
@SuppressLint("SetTextI18n")
private void updateAndPost() {
textView.setText(getPlayerStateString() + getPlayerWindowIndexString() + getVideoString()
+ getAudioString());
......@@ -192,7 +195,7 @@ public final class DebugTextViewHelper implements Runnable, Player.EventListener
private static String getPixelAspectRatioString(float pixelAspectRatio) {
return pixelAspectRatio == Format.NO_VALUE || pixelAspectRatio == 1f ? ""
: (" par:" + String.format("%.02f", pixelAspectRatio));
: (" par:" + String.format(Locale.US, "%.02f", pixelAspectRatio));
}
}
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