cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject git commit: [CB-3430] [CB-1413] Remove Old (2.3.3) HTTP Workaround
Date Wed, 10 Jul 2013 16:01:25 GMT
Updated Branches:
  refs/heads/master cdb45cd93 -> e4559a21d


[CB-3430] [CB-1413] Remove Old (2.3.3) HTTP Workaround

Cherry-picked from 2.x branch of cordova-android [01946dd4]


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/e4559a21
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/e4559a21
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/e4559a21

Branch: refs/heads/master
Commit: e4559a21d724b497ab685f869043ff1d3577dc64
Parents: cdb45cd
Author: Ian Clelland <iclelland@chromium.org>
Authored: Wed Jul 10 11:56:29 2013 -0400
Committer: Ian Clelland <iclelland@chromium.org>
Committed: Wed Jul 10 12:01:04 2013 -0400

----------------------------------------------------------------------
 src/android/FileTransfer.java | 36 ------------------------------------
 1 file changed, 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/e4559a21/src/android/FileTransfer.java
----------------------------------------------------------------------
diff --git a/src/android/FileTransfer.java b/src/android/FileTransfer.java
index 94de97a..c24f73d 100644
--- a/src/android/FileTransfer.java
+++ b/src/android/FileTransfer.java
@@ -179,39 +179,6 @@ public class FileTransfer extends CordovaPlugin {
         }
     }
 
-    /**
-     * Works around a bug on Android 2.3.
-     * http://code.google.com/p/android/issues/detail?id=14562
-     */
-    private static final class DoneHandlerInputStream extends TrackingHTTPInputStream {
-        private boolean done;
-        
-        public DoneHandlerInputStream(InputStream stream) {
-            super(stream);
-        }
-        
-        @Override
-        public int read() throws IOException {
-            int result = done ? -1 : super.read();
-            done = (result == -1);
-            return result;
-        }
-
-        @Override
-        public int read(byte[] buffer) throws IOException {
-            int result = done ? -1 : super.read(buffer);
-            done = (result == -1);
-            return result;
-        }
-
-        @Override
-        public int read(byte[] bytes, int offset, int count) throws IOException {
-            int result = done ? -1 : super.read(bytes, offset, count);
-            done = (result == -1);
-            return result;
-        }
-    }
-    
     @Override
     public boolean execute(String action, JSONArray args, final CallbackContext callbackContext)
throws JSONException {
         if (action.equals("upload") || action.equals("download")) {
@@ -566,9 +533,6 @@ public class FileTransfer extends CordovaPlugin {
     }
 
     private static TrackingInputStream getInputStream(URLConnection conn) throws IOException
{
-        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
-            return new DoneHandlerInputStream(conn.getInputStream());
-        }
         String encoding = conn.getContentEncoding();
         if (encoding != null && encoding.equalsIgnoreCase("gzip")) {
         	return new TrackingGZIPInputStream(new ExposedGZIPInputStream(conn.getInputStream()));


Mime
View raw message