Merge "Switch frameworks/base over from @hidden Charsets to public StandardCharsets."

This commit is contained in:
Elliott Hughes
2013-06-28 23:31:35 +00:00
committed by Gerrit Code Review

View File

@@ -28,12 +28,12 @@ import android.util.Slog;
import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting;
import com.google.android.collect.Lists; import com.google.android.collect.Lists;
import java.nio.charset.Charsets;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ArrayBlockingQueue;
@@ -142,7 +142,7 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
if (buffer[i] == 0) { if (buffer[i] == 0) {
final String rawEvent = new String( final String rawEvent = new String(
buffer, start, i - start, Charsets.UTF_8); buffer, start, i - start, StandardCharsets.UTF_8);
log("RCV <- {" + rawEvent + "}"); log("RCV <- {" + rawEvent + "}");
try { try {
@@ -163,7 +163,7 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo
} }
} }
if (start == 0) { 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 + "}"); log("RCV incomplete <- {" + rawEvent + "}");
} }
@@ -319,7 +319,7 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo
throw new NativeDaemonConnectorException("missing output stream"); throw new NativeDaemonConnectorException("missing output stream");
} else { } else {
try { try {
mOutputStream.write(sentCmd.getBytes(Charsets.UTF_8)); mOutputStream.write(sentCmd.getBytes(StandardCharsets.UTF_8));
} catch (IOException e) { } catch (IOException e) {
throw new NativeDaemonConnectorException("problem sending command", e); throw new NativeDaemonConnectorException("problem sending command", e);
} }