Bug 1299997 - Can't use API19+ StandardCharsets r=rnewman
authorGrigory Kruglov <gkruglov@mozilla.com>
Thu, 01 Sep 2016 18:48:35 -0700
changeset 312446 617559427df014717596246d8b0bc65ca81d6265
parent 312445 83133b8e14e63f6e9e78daa09a90a1810867060a
child 312447 1e4f5a991728ebf5ba435300406958792d2982d1
push id20447
push userkwierso@gmail.com
push dateFri, 02 Sep 2016 20:36:44 +0000
treeherderfx-team@969397f22187 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1299997
milestone51.0a1
Bug 1299997 - Can't use API19+ StandardCharsets r=rnewman MozReview-Commit-ID: 7UH2bJT3re1
mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/uploaders/RecordUploadRunnable.java
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/uploaders/RecordUploadRunnable.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/uploaders/RecordUploadRunnable.java
@@ -11,31 +11,30 @@ import org.mozilla.gecko.background.comm
 import org.mozilla.gecko.sync.Server11PreviousPostFailedException;
 import org.mozilla.gecko.sync.net.SyncStorageRequest;
 import org.mozilla.gecko.sync.net.SyncStorageRequestDelegate;
 
 import java.io.IOException;
 import java.io.OutputStream;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 
 import ch.boye.httpclientandroidlib.entity.ContentProducer;
 import ch.boye.httpclientandroidlib.entity.EntityTemplate;
 
 /**
  * Responsible for creating and posting a <code>SyncStorageRequest</code> request object.
  */
 public class RecordUploadRunnable implements Runnable {
     public final String LOG_TAG = "RecordUploadRunnable";
 
-    public final static byte[] RECORDS_START = "[".getBytes(StandardCharsets.UTF_8);
-    public final static byte[] RECORD_SEPARATOR = ",".getBytes(StandardCharsets.UTF_8);
-    public final static byte[] RECORDS_END = "]".getBytes(StandardCharsets.UTF_8);
+    public final static byte[] RECORDS_START = { 91 };      // [ in UTF-8
+    public final static byte[] RECORD_SEPARATOR = { 44 };   // , in UTF-8
+    public final static byte[] RECORDS_END = { 93 };        // ] in UTF-8
 
     private static final String QUERY_PARAM_BATCH = "batch";
     private static final String QUERY_PARAM_TRUE = "true";
     private static final String QUERY_PARAM_BATCH_COMMIT = "commit";
 
     private final MayUploadProvider mayUploadProvider;
     private final SyncStorageRequestDelegate uploadDelegate;