summaryrefslogtreecommitdiffstats
path: root/src/org
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-01-23 15:31:00 +0000
committerNarayan Kamath <narayan@google.com>2015-02-04 18:11:43 +0000
commit3e387462b084cf0c62e89c21cfd071df50163e39 (patch)
tree1ca339b380e52f2b09253a6286fde4976332ba90 /src/org
parenta8b46a3d3b6ed1488df10740653829283572903b (diff)
downloadandroid_external_apache-http-3e387462b084cf0c62e89c21cfd071df50163e39.tar.gz
android_external_apache-http-3e387462b084cf0c62e89c21cfd071df50163e39.tar.bz2
android_external_apache-http-3e387462b084cf0c62e89c21cfd071df50163e39.zip
Unbundle org.apache.http.legacy.
Lets us build it from source on both unbundled and platform branches. The main changes are : - We need a placeholder "WebAddress" class that's used internally. The class will be deleted from the frameworks once the webview stops using it (sigh...) - Use TrafficStats instead of SocketTagger. - Remove @hide annotations because they don't matter any more. We're not building stubs any more, and apps in both unbundled and platform branches will compile directly against the jar. We don't care about any of that because this is all deprecated API and deleted from the API specification. bug: 18027885. Change-Id: I6b5f06db2e3e0e34ccd7264c15e1fe594e61862e
Diffstat (limited to 'src/org')
-rw-r--r--src/org/apache/http/impl/conn/DefaultClientConnectionOperator.java9
-rw-r--r--src/org/apache/http/impl/conn/SingleClientConnManager.java6
-rw-r--r--src/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java6
-rw-r--r--src/org/apache/http/impl/io/SocketInputBuffer.java2
4 files changed, 13 insertions, 10 deletions
diff --git a/src/org/apache/http/impl/conn/DefaultClientConnectionOperator.java b/src/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
index 9567eb1..62169bc 100644
--- a/src/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
+++ b/src/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
@@ -183,8 +183,13 @@ public class DefaultClientConnectionOperator
// catch SocketException to cover any kind of connect failure
} catch (SocketException ex) {
if (i == addresses.length - 1) {
- ConnectException cause = ex instanceof ConnectException
- ? (ConnectException) ex : new ConnectException(ex.getMessage(), ex);
+ final ConnectException cause;
+ if (ex instanceof ConnectException) {
+ cause = (ConnectException) ex;
+ } else {
+ cause = new ConnectException(ex.getMessage());
+ cause.initCause(ex);
+ }
throw new HttpHostConnectException(target, cause);
}
// END android-changed
diff --git a/src/org/apache/http/impl/conn/SingleClientConnManager.java b/src/org/apache/http/impl/conn/SingleClientConnManager.java
index 55e9757..d8fb956 100644
--- a/src/org/apache/http/impl/conn/SingleClientConnManager.java
+++ b/src/org/apache/http/impl/conn/SingleClientConnManager.java
@@ -31,11 +31,11 @@
package org.apache.http.impl.conn;
-import dalvik.system.SocketTagger;
import java.io.IOException;
import java.net.Socket;
import java.util.concurrent.TimeUnit;
+import android.net.TrafficStats;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.conn.ClientConnectionManager;
@@ -261,7 +261,7 @@ public class SingleClientConnManager implements ClientConnectionManager {
try {
final Socket socket = uniquePoolEntry.connection.getSocket();
if (socket != null) {
- SocketTagger.get().tag(socket);
+ TrafficStats.tagSocket(socket);
}
} catch (IOException iox) {
log.debug("Problem tagging socket.", iox);
@@ -303,7 +303,7 @@ public class SingleClientConnManager implements ClientConnectionManager {
// statistics from future users.
final Socket socket = uniquePoolEntry.connection.getSocket();
if (socket != null) {
- SocketTagger.get().untag(socket);
+ TrafficStats.untagSocket(socket);
}
// END android-changed
diff --git a/src/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java b/src/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
index e9c11b0..7d6a560 100644
--- a/src/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
+++ b/src/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
@@ -30,11 +30,11 @@
package org.apache.http.impl.conn.tsccm;
-import dalvik.system.SocketTagger;
import java.io.IOException;
import java.net.Socket;
import java.util.concurrent.TimeUnit;
+import android.net.TrafficStats;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.conn.routing.HttpRoute;
@@ -185,7 +185,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
try {
final Socket socket = entry.getConnection().getSocket();
if (socket != null) {
- SocketTagger.get().tag(socket);
+ TrafficStats.tagSocket(socket);
}
} catch (IOException iox) {
log.debug("Problem tagging socket.", iox);
@@ -220,7 +220,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
final BasicPoolEntry entry = (BasicPoolEntry) hca.getPoolEntry();
final Socket socket = entry.getConnection().getSocket();
if (socket != null) {
- SocketTagger.get().untag(socket);
+ TrafficStats.untagSocket(socket);
}
// END android-changed
diff --git a/src/org/apache/http/impl/io/SocketInputBuffer.java b/src/org/apache/http/impl/io/SocketInputBuffer.java
index f525833..5e1869c 100644
--- a/src/org/apache/http/impl/io/SocketInputBuffer.java
+++ b/src/org/apache/http/impl/io/SocketInputBuffer.java
@@ -101,8 +101,6 @@ public class SocketInputBuffer extends AbstractSessionInputBuffer {
* to rely on isDataAvailable() returning normally; that approach cannot
* distinguish between an exhausted stream and a stream with zero bytes
* buffered.
- *
- * @hide
*/
public boolean isStale() throws IOException {
if (hasBufferedData()) {