Loading core/java/android/net/Uri.java +3 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.Charsets; import java.nio.charset.StandardCharsets; import java.util.AbstractList; import java.util.ArrayList; import java.util.Collections; Loading Loading @@ -1688,7 +1688,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { return ""; } else { String encodedValue = query.substring(separator + 1, end); return UriCodec.decode(encodedValue, true, Charsets.UTF_8, false); return UriCodec.decode(encodedValue, true, StandardCharsets.UTF_8, false); } } Loading Loading @@ -1927,7 +1927,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { if (s == null) { return null; } return UriCodec.decode(s, false, Charsets.UTF_8, false); return UriCodec.decode(s, false, StandardCharsets.UTF_8, false); } /** Loading core/java/android/net/dhcp/DhcpPacket.java +2 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.charset.Charsets; import java.nio.charset.StandardCharsets; import java.nio.ShortBuffer; import java.util.ArrayList; Loading Loading @@ -540,7 +540,7 @@ abstract class DhcpPacket { private static String readAsciiString(ByteBuffer buf, int byteCount) { byte[] bytes = new byte[byteCount]; buf.get(bytes); return new String(bytes, 0, bytes.length, Charsets.US_ASCII); return new String(bytes, 0, bytes.length, StandardCharsets.US_ASCII); } /** Loading core/java/android/nfc/NdefRecord.java +10 −10 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import android.os.Parcel; import android.os.Parcelable; import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.charset.Charsets; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.List; Loading Loading @@ -311,7 +311,7 @@ public final class NdefRecord implements Parcelable { if (packageName.length() == 0) throw new IllegalArgumentException("packageName is empty"); return new NdefRecord(TNF_EXTERNAL_TYPE, RTD_ANDROID_APP, null, packageName.getBytes(Charsets.UTF_8)); packageName.getBytes(StandardCharsets.UTF_8)); } /** Loading Loading @@ -350,7 +350,7 @@ public final class NdefRecord implements Parcelable { break; } } byte[] uriBytes = uriString.getBytes(Charsets.UTF_8); byte[] uriBytes = uriString.getBytes(StandardCharsets.UTF_8); byte[] recordBytes = new byte[uriBytes.length + 1]; recordBytes[0] = prefix; System.arraycopy(uriBytes, 0, recordBytes, 1, uriBytes.length); Loading Loading @@ -422,7 +422,7 @@ public final class NdefRecord implements Parcelable { // missing '/' is allowed // MIME RFCs suggest ASCII encoding for content-type byte[] typeBytes = mimeType.getBytes(Charsets.US_ASCII); byte[] typeBytes = mimeType.getBytes(StandardCharsets.US_ASCII); return new NdefRecord(TNF_MIME_MEDIA, typeBytes, null, mimeData); } Loading Loading @@ -462,8 +462,8 @@ public final class NdefRecord implements Parcelable { if (domain.length() == 0) throw new IllegalArgumentException("domain is empty"); if (type.length() == 0) throw new IllegalArgumentException("type is empty"); byte[] byteDomain = domain.getBytes(Charsets.UTF_8); byte[] byteType = type.getBytes(Charsets.UTF_8); byte[] byteDomain = domain.getBytes(StandardCharsets.UTF_8); byte[] byteType = type.getBytes(StandardCharsets.UTF_8); byte[] b = new byte[byteDomain.length + 1 + byteType.length]; System.arraycopy(byteDomain, 0, b, 0, byteDomain.length); b[byteDomain.length] = ':'; Loading Loading @@ -643,7 +643,7 @@ public final class NdefRecord implements Parcelable { } break; case NdefRecord.TNF_MIME_MEDIA: String mimeType = new String(mType, Charsets.US_ASCII); String mimeType = new String(mType, StandardCharsets.US_ASCII); return Intent.normalizeMimeType(mimeType); } return null; Loading Loading @@ -694,14 +694,14 @@ public final class NdefRecord implements Parcelable { break; case TNF_ABSOLUTE_URI: Uri uri = Uri.parse(new String(mType, Charsets.UTF_8)); Uri uri = Uri.parse(new String(mType, StandardCharsets.UTF_8)); return uri.normalizeScheme(); case TNF_EXTERNAL_TYPE: if (inSmartPoster) { break; } return Uri.parse("vnd.android.nfc://ext/" + new String(mType, Charsets.US_ASCII)); return Uri.parse("vnd.android.nfc://ext/" + new String(mType, StandardCharsets.US_ASCII)); } return null; } Loading @@ -723,7 +723,7 @@ public final class NdefRecord implements Parcelable { } String prefix = URI_PREFIX_MAP[prefixIndex]; String suffix = new String(Arrays.copyOfRange(mPayload, 1, mPayload.length), Charsets.UTF_8); StandardCharsets.UTF_8); return Uri.parse(prefix + suffix); } Loading core/java/com/android/internal/net/VpnProfile.java +3 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import android.text.TextUtils; import android.util.Log; import java.net.InetAddress; import java.nio.charset.Charsets; import java.nio.charset.StandardCharsets; /** * Parcel-like entity class for VPN profiles. To keep things simple, all Loading Loading @@ -117,7 +117,7 @@ public class VpnProfile implements Cloneable, Parcelable { return null; } String[] values = new String(value, Charsets.UTF_8).split("\0", -1); String[] values = new String(value, StandardCharsets.UTF_8).split("\0", -1); // There can be 14 or 15 values in ICS MR1. if (values.length < 14 || values.length > 15) { return null; Loading Loading @@ -167,7 +167,7 @@ public class VpnProfile implements Cloneable, Parcelable { builder.append('\0').append(ipsecUserCert); builder.append('\0').append(ipsecCaCert); builder.append('\0').append(ipsecServerCert); return builder.toString().getBytes(Charsets.UTF_8); return builder.toString().getBytes(StandardCharsets.UTF_8); } /** Loading core/java/com/android/internal/util/ProcFileReader.java +4 −4 Original line number Diff line number Diff line Loading @@ -19,13 +19,13 @@ package com.android.internal.util; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charsets; import java.nio.charset.StandardCharsets; /** * Reader that specializes in parsing {@code /proc/} files quickly. Walks * through the stream using a single space {@code ' '} as token separator, and * requires each line boundary to be explicitly acknowledged using * {@link #finishLine()}. Assumes {@link Charsets#US_ASCII} encoding. * {@link #finishLine()}. Assumes {@link StandardCharsets#US_ASCII} encoding. * <p> * Currently doesn't support formats based on {@code \0}, tabs, or repeated * delimiters. Loading Loading @@ -144,7 +144,7 @@ public class ProcFileReader implements Closeable { */ public String nextString() throws IOException { final int tokenIndex = nextTokenIndex(); final String s = new String(mBuffer, 0, tokenIndex, Charsets.US_ASCII); final String s = new String(mBuffer, 0, tokenIndex, StandardCharsets.US_ASCII); consumeBuf(tokenIndex + 1); return s; } Loading Loading @@ -179,7 +179,7 @@ public class ProcFileReader implements Closeable { private NumberFormatException invalidLong(int tokenIndex) { return new NumberFormatException( "invalid long: " + new String(mBuffer, 0, tokenIndex, Charsets.US_ASCII)); "invalid long: " + new String(mBuffer, 0, tokenIndex, StandardCharsets.US_ASCII)); } /** Loading Loading
core/java/android/net/Uri.java +3 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.Charsets; import java.nio.charset.StandardCharsets; import java.util.AbstractList; import java.util.ArrayList; import java.util.Collections; Loading Loading @@ -1688,7 +1688,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { return ""; } else { String encodedValue = query.substring(separator + 1, end); return UriCodec.decode(encodedValue, true, Charsets.UTF_8, false); return UriCodec.decode(encodedValue, true, StandardCharsets.UTF_8, false); } } Loading Loading @@ -1927,7 +1927,7 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { if (s == null) { return null; } return UriCodec.decode(s, false, Charsets.UTF_8, false); return UriCodec.decode(s, false, StandardCharsets.UTF_8, false); } /** Loading
core/java/android/net/dhcp/DhcpPacket.java +2 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.charset.Charsets; import java.nio.charset.StandardCharsets; import java.nio.ShortBuffer; import java.util.ArrayList; Loading Loading @@ -540,7 +540,7 @@ abstract class DhcpPacket { private static String readAsciiString(ByteBuffer buf, int byteCount) { byte[] bytes = new byte[byteCount]; buf.get(bytes); return new String(bytes, 0, bytes.length, Charsets.US_ASCII); return new String(bytes, 0, bytes.length, StandardCharsets.US_ASCII); } /** Loading
core/java/android/nfc/NdefRecord.java +10 −10 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import android.os.Parcel; import android.os.Parcelable; import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; import java.nio.charset.Charsets; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.List; Loading Loading @@ -311,7 +311,7 @@ public final class NdefRecord implements Parcelable { if (packageName.length() == 0) throw new IllegalArgumentException("packageName is empty"); return new NdefRecord(TNF_EXTERNAL_TYPE, RTD_ANDROID_APP, null, packageName.getBytes(Charsets.UTF_8)); packageName.getBytes(StandardCharsets.UTF_8)); } /** Loading Loading @@ -350,7 +350,7 @@ public final class NdefRecord implements Parcelable { break; } } byte[] uriBytes = uriString.getBytes(Charsets.UTF_8); byte[] uriBytes = uriString.getBytes(StandardCharsets.UTF_8); byte[] recordBytes = new byte[uriBytes.length + 1]; recordBytes[0] = prefix; System.arraycopy(uriBytes, 0, recordBytes, 1, uriBytes.length); Loading Loading @@ -422,7 +422,7 @@ public final class NdefRecord implements Parcelable { // missing '/' is allowed // MIME RFCs suggest ASCII encoding for content-type byte[] typeBytes = mimeType.getBytes(Charsets.US_ASCII); byte[] typeBytes = mimeType.getBytes(StandardCharsets.US_ASCII); return new NdefRecord(TNF_MIME_MEDIA, typeBytes, null, mimeData); } Loading Loading @@ -462,8 +462,8 @@ public final class NdefRecord implements Parcelable { if (domain.length() == 0) throw new IllegalArgumentException("domain is empty"); if (type.length() == 0) throw new IllegalArgumentException("type is empty"); byte[] byteDomain = domain.getBytes(Charsets.UTF_8); byte[] byteType = type.getBytes(Charsets.UTF_8); byte[] byteDomain = domain.getBytes(StandardCharsets.UTF_8); byte[] byteType = type.getBytes(StandardCharsets.UTF_8); byte[] b = new byte[byteDomain.length + 1 + byteType.length]; System.arraycopy(byteDomain, 0, b, 0, byteDomain.length); b[byteDomain.length] = ':'; Loading Loading @@ -643,7 +643,7 @@ public final class NdefRecord implements Parcelable { } break; case NdefRecord.TNF_MIME_MEDIA: String mimeType = new String(mType, Charsets.US_ASCII); String mimeType = new String(mType, StandardCharsets.US_ASCII); return Intent.normalizeMimeType(mimeType); } return null; Loading Loading @@ -694,14 +694,14 @@ public final class NdefRecord implements Parcelable { break; case TNF_ABSOLUTE_URI: Uri uri = Uri.parse(new String(mType, Charsets.UTF_8)); Uri uri = Uri.parse(new String(mType, StandardCharsets.UTF_8)); return uri.normalizeScheme(); case TNF_EXTERNAL_TYPE: if (inSmartPoster) { break; } return Uri.parse("vnd.android.nfc://ext/" + new String(mType, Charsets.US_ASCII)); return Uri.parse("vnd.android.nfc://ext/" + new String(mType, StandardCharsets.US_ASCII)); } return null; } Loading @@ -723,7 +723,7 @@ public final class NdefRecord implements Parcelable { } String prefix = URI_PREFIX_MAP[prefixIndex]; String suffix = new String(Arrays.copyOfRange(mPayload, 1, mPayload.length), Charsets.UTF_8); StandardCharsets.UTF_8); return Uri.parse(prefix + suffix); } Loading
core/java/com/android/internal/net/VpnProfile.java +3 −3 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ import android.text.TextUtils; import android.util.Log; import java.net.InetAddress; import java.nio.charset.Charsets; import java.nio.charset.StandardCharsets; /** * Parcel-like entity class for VPN profiles. To keep things simple, all Loading Loading @@ -117,7 +117,7 @@ public class VpnProfile implements Cloneable, Parcelable { return null; } String[] values = new String(value, Charsets.UTF_8).split("\0", -1); String[] values = new String(value, StandardCharsets.UTF_8).split("\0", -1); // There can be 14 or 15 values in ICS MR1. if (values.length < 14 || values.length > 15) { return null; Loading Loading @@ -167,7 +167,7 @@ public class VpnProfile implements Cloneable, Parcelable { builder.append('\0').append(ipsecUserCert); builder.append('\0').append(ipsecCaCert); builder.append('\0').append(ipsecServerCert); return builder.toString().getBytes(Charsets.UTF_8); return builder.toString().getBytes(StandardCharsets.UTF_8); } /** Loading
core/java/com/android/internal/util/ProcFileReader.java +4 −4 Original line number Diff line number Diff line Loading @@ -19,13 +19,13 @@ package com.android.internal.util; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charsets; import java.nio.charset.StandardCharsets; /** * Reader that specializes in parsing {@code /proc/} files quickly. Walks * through the stream using a single space {@code ' '} as token separator, and * requires each line boundary to be explicitly acknowledged using * {@link #finishLine()}. Assumes {@link Charsets#US_ASCII} encoding. * {@link #finishLine()}. Assumes {@link StandardCharsets#US_ASCII} encoding. * <p> * Currently doesn't support formats based on {@code \0}, tabs, or repeated * delimiters. Loading Loading @@ -144,7 +144,7 @@ public class ProcFileReader implements Closeable { */ public String nextString() throws IOException { final int tokenIndex = nextTokenIndex(); final String s = new String(mBuffer, 0, tokenIndex, Charsets.US_ASCII); final String s = new String(mBuffer, 0, tokenIndex, StandardCharsets.US_ASCII); consumeBuf(tokenIndex + 1); return s; } Loading Loading @@ -179,7 +179,7 @@ public class ProcFileReader implements Closeable { private NumberFormatException invalidLong(int tokenIndex) { return new NumberFormatException( "invalid long: " + new String(mBuffer, 0, tokenIndex, Charsets.US_ASCII)); "invalid long: " + new String(mBuffer, 0, tokenIndex, StandardCharsets.US_ASCII)); } /** Loading