Skip to content

Commit

Permalink
Fix some lint warnings
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164105662
  • Loading branch information
ojw28 committed Aug 3, 2017
1 parent 78cdd08 commit db99187
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
* 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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
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;
Expand Down Expand Up @@ -132,7 +133,7 @@ private void parseFormatLine(String formatLine) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private TtmlRegion parseRegionAttributes(XmlPullParser xmlParser) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ public static int inferContentType(Uri uri) {
*/
@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")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;

/**
* Source of Hls (possibly adaptive) chunks.
Expand Down Expand Up @@ -366,7 +365,7 @@ private EncryptionKeyChunk newEncryptionKeyChunk(Uri keyUri, String iv, int vari

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -25,6 +26,7 @@
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
Expand Down Expand Up @@ -125,6 +127,7 @@ public void run() {

// Private methods.

@SuppressLint("SetTextI18n")
private void updateAndPost() {
textView.setText(getPlayerStateString() + getPlayerWindowIndexString() + getVideoString()
+ getAudioString());
Expand Down Expand Up @@ -192,7 +195,7 @@ private static String getDecoderCountersBufferCountString(DecoderCounters counte

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));
}

}

0 comments on commit db99187

Please sign in to comment.