Replace default locale with US locale on Android.
This fixes a lint warning and also fixes potential bugs on devices running locales where toLowerCase and toUpperCase don't behave as expected. BUG=webrtc:6597 R=magjed@webrtc.org TBR=kjellander@webrtc.org Review-Url: https://codereview.webrtc.org/2624423003 Cr-Commit-Position: refs/heads/master@{#16092}
This commit is contained in:
parent
6deecb2a2f
commit
037b93af17
@ -8,7 +8,6 @@
|
||||
<issue id="NewApi"></issue>
|
||||
|
||||
<issue id="InlinedApi" severity="ignore"/>
|
||||
<issue id="DefaultLocale" severity="ignore"/>
|
||||
<issue id="Assert" severity="ignore"/>
|
||||
<issue id="UseSparseArrays" severity="ignore"/>
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ import android.view.Surface;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@ -678,7 +679,7 @@ public class EglRenderer implements VideoRenderer.Callbacks {
|
||||
+ " Frames received: " + framesReceived + "."
|
||||
+ " Dropped: " + framesDropped + "."
|
||||
+ " Rendered: " + framesRendered + "."
|
||||
+ " Render fps: " + String.format("%.1f", renderFps) + "."
|
||||
+ " Render fps: " + String.format(Locale.US, "%.1f", renderFps) + "."
|
||||
+ " Average render time: " + averageTimeAsString(renderTimeNs, framesRendered) + "."
|
||||
+ " Average swapBuffer time: "
|
||||
+ averageTimeAsString(renderSwapBufferTimeNs, framesRendered) + ".");
|
||||
|
||||
@ -10,6 +10,8 @@
|
||||
|
||||
package org.webrtc;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Description of an RFC 4566 Session.
|
||||
* SDPs are passed as serialized Strings in Java-land and are materialized
|
||||
@ -23,11 +25,11 @@ public class SessionDescription {
|
||||
ANSWER;
|
||||
|
||||
public String canonicalForm() {
|
||||
return name().toLowerCase();
|
||||
return name().toLowerCase(Locale.US);
|
||||
}
|
||||
|
||||
public static Type fromCanonicalForm(String canonical) {
|
||||
return Type.valueOf(Type.class, canonical.toUpperCase());
|
||||
return Type.valueOf(Type.class, canonical.toUpperCase(Locale.US));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user