diff options
Diffstat (limited to 'services/java')
-rw-r--r-- | services/java/com/android/server/NativeDaemonConnector.java | 8 | ||||
-rw-r--r-- | services/java/com/android/server/connectivity/Vpn.java | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/services/java/com/android/server/NativeDaemonConnector.java b/services/java/com/android/server/NativeDaemonConnector.java index 5e94a9f..e423780 100644 --- a/services/java/com/android/server/NativeDaemonConnector.java +++ b/services/java/com/android/server/NativeDaemonConnector.java @@ -28,12 +28,12 @@ import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; import com.google.android.collect.Lists; -import java.nio.charset.Charsets; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.ArrayBlockingQueue; @@ -142,7 +142,7 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo for (int i = 0; i < count; i++) { if (buffer[i] == 0) { final String rawEvent = new String( - buffer, start, i - start, Charsets.UTF_8); + buffer, start, i - start, StandardCharsets.UTF_8); log("RCV <- {" + rawEvent + "}"); try { @@ -163,7 +163,7 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo } } if (start == 0) { - final String rawEvent = new String(buffer, start, count, Charsets.UTF_8); + final String rawEvent = new String(buffer, start, count, StandardCharsets.UTF_8); log("RCV incomplete <- {" + rawEvent + "}"); } @@ -319,7 +319,7 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo throw new NativeDaemonConnectorException("missing output stream"); } else { try { - mOutputStream.write(sentCmd.getBytes(Charsets.UTF_8)); + mOutputStream.write(sentCmd.getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { throw new NativeDaemonConnectorException("problem sending command", e); } diff --git a/services/java/com/android/server/connectivity/Vpn.java b/services/java/com/android/server/connectivity/Vpn.java index bb7334a..48e5e57 100644 --- a/services/java/com/android/server/connectivity/Vpn.java +++ b/services/java/com/android/server/connectivity/Vpn.java @@ -69,7 +69,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.Inet4Address; import java.net.InetAddress; -import java.nio.charset.Charsets; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import libcore.io.IoUtils; @@ -477,15 +477,15 @@ public class Vpn extends BaseNetworkStateTracker { if (!profile.ipsecUserCert.isEmpty()) { privateKey = Credentials.USER_PRIVATE_KEY + profile.ipsecUserCert; byte[] value = keyStore.get(Credentials.USER_CERTIFICATE + profile.ipsecUserCert); - userCert = (value == null) ? null : new String(value, Charsets.UTF_8); + userCert = (value == null) ? null : new String(value, StandardCharsets.UTF_8); } if (!profile.ipsecCaCert.isEmpty()) { byte[] value = keyStore.get(Credentials.CA_CERTIFICATE + profile.ipsecCaCert); - caCert = (value == null) ? null : new String(value, Charsets.UTF_8); + caCert = (value == null) ? null : new String(value, StandardCharsets.UTF_8); } if (!profile.ipsecServerCert.isEmpty()) { byte[] value = keyStore.get(Credentials.USER_CERTIFICATE + profile.ipsecServerCert); - serverCert = (value == null) ? null : new String(value, Charsets.UTF_8); + serverCert = (value == null) ? null : new String(value, StandardCharsets.UTF_8); } if (privateKey == null || userCert == null || caCert == null || serverCert == null) { throw new IllegalStateException("Cannot load credentials"); @@ -756,7 +756,7 @@ public class Vpn extends BaseNetworkStateTracker { // Send over the arguments. OutputStream out = mSockets[i].getOutputStream(); for (String argument : arguments) { - byte[] bytes = argument.getBytes(Charsets.UTF_8); + byte[] bytes = argument.getBytes(StandardCharsets.UTF_8); if (bytes.length >= 0xFFFF) { throw new IllegalArgumentException("Argument is too large"); } |