Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Move apache specific portions of android.net.http to external/apache-…
Browse files Browse the repository at this point in the history
…http.

We continue to compile external/apache-http into ext.jar. This contains
a few changes apart fom the classes moving around :

- Makefile changes to build docs and api-stubs for now. A future change
  will revert these changes and remove these classes from stubs and
  docs.
- Hardcode event IDs in legacyerrorstrings to avoid a dependency between
  the frameworks and apache. These strings are on their way out and will
  never change anyway.
- Remove imports due to {@link} tags and use {@code} instead.
- Remove an accidental(?) dependency on apache commons code that's a
  part of apache-http.

bug: 18027885

Change-Id: I51cd038d846ec7d02c283a4541b10a6a9cf62ecf
  • Loading branch information
narayank committed Feb 12, 2015
1 parent 8b0c8ff commit 3bdd327
Show file tree
Hide file tree
Showing 56 changed files with 1,980 additions and 13,888 deletions.
11 changes: 4 additions & 7 deletions Android.mk
Expand Up @@ -614,7 +614,10 @@ $(gen): $(aidl_files) | $(AIDL)
# TODO: deal with com/google/android/googleapps
packages_to_document := \
android \
javax/microedition/khronos
javax/microedition/khronos \
org/apache/http/conn \
org/apache/http/params


# Search through the base framework dirs for these packages.
# The result will be relative to frameworks/base.
Expand All @@ -635,7 +638,6 @@ include libcore/Docs.mk
include external/junit/Common.mk

non_base_dirs := \
../../external/apache-http/src/org/apache/http \
../opt/telephony/src/java/android/provider \
../opt/telephony/src/java/android/telephony \
../opt/telephony/src/java/android/telephony/gsm \
Expand Down Expand Up @@ -1024,13 +1026,8 @@ include $(BUILD_DROIDDOC)
# Build ext.jar
# ============================================================

# NOTICE notes for non-obvious sections
# apache-http - covered by the Apache Commons section.


ext_dirs := \
../../external/nist-sip/java \
../../external/apache-http/src \
../../external/tagsoup/src \

ext_src_files := $(call all-java-files-under,$(ext_dirs))
Expand Down
3,345 changes: 0 additions & 3,345 deletions api/current.txt

Large diffs are not rendered by default.

3,345 changes: 0 additions & 3,345 deletions api/system-current.txt

Large diffs are not rendered by default.

28 changes: 24 additions & 4 deletions core/java/android/database/DatabaseUtils.java
Expand Up @@ -16,8 +16,6 @@

package android.database;

import org.apache.commons.codec.binary.Hex;

import android.content.ContentValues;
import android.content.Context;
import android.content.OperationApplicationException;
Expand Down Expand Up @@ -416,11 +414,33 @@ public static String getCollationKey(String name) {
* @return the collation key in hex format
*/
public static String getHexCollationKey(String name) {
byte [] arr = getCollationKeyInBytes(name);
char[] keys = Hex.encodeHex(arr);
byte[] arr = getCollationKeyInBytes(name);
char[] keys = encodeHex(arr);
return new String(keys, 0, getKeyLen(arr) * 2);
}


/**
* Used building output as Hex
*/
private static final char[] DIGITS = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
};

private static char[] encodeHex(byte[] input) {
int l = input.length;
char[] out = new char[l << 1];

// two characters form the hex value.
for (int i = 0, j = 0; i < l; i++) {
out[j++] = DIGITS[(0xF0 & input[i]) >>> 4 ];
out[j++] = DIGITS[ 0x0F & input[i] ];
}

return out;
}

private static int getKeyLen(byte[] arr) {
if (arr[arr.length - 1] != 0) {
return arr.length;
Expand Down
7 changes: 3 additions & 4 deletions core/java/android/net/ProxyInfo.java
Expand Up @@ -21,8 +21,6 @@
import android.os.Parcelable;
import android.text.TextUtils;

import org.apache.http.client.HttpClient;

import java.net.InetSocketAddress;
import java.net.URLConnection;
import java.util.List;
Expand All @@ -31,8 +29,9 @@
/**
* Describes a proxy configuration.
*
* Proxy configurations are already integrated within the Apache HTTP stack.
* So {@link URLConnection} and {@link HttpClient} will use them automatically.
* Proxy configurations are already integrated within the {@code java.net} and
* Apache HTTP stack. So {@link URLConnection} and Apache's {@code HttpClient} will use
* them automatically.
*
* Other HTTP stacks will need to obtain the proxy info from
* {@link Proxy#PROXY_CHANGE_ACTION} broadcast as the extra {@link Proxy#EXTRA_PROXY_INFO}.
Expand Down

0 comments on commit 3bdd327

Please sign in to comment.