Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3bdd327f authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Move apache specific portions of android.net.http to external/apache-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
parent 8b0c8ffb
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -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.
@@ -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 \
@@ -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))
+0 −3345

File changed.

Preview size limit exceeded, changes collapsed.

+0 −3345

File changed.

Preview size limit exceeded, changes collapsed.

+24 −4
Original line number Diff line number Diff line
@@ -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;
@@ -417,10 +415,32 @@ public class DatabaseUtils {
     */
    public static String getHexCollationKey(String name) {
        byte[] arr = getCollationKeyInBytes(name);
        char[] keys = Hex.encodeHex(arr);
        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;
+3 −4
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@ import android.os.Parcel;
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;
@@ -31,8 +29,9 @@ import java.util.Locale;
/**
 * 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}.
Loading