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

Commit 7762d936 authored by Paul Westbrook's avatar Paul Westbrook
Browse files

Unbundling work

Moved AndroidHttpClient, Rfc822InputFilter, Rfc822Validator
NumberPicker, NumberPickerButton to android-common
---
parent b6ddc7ae
Loading
Loading
Loading
Loading
+6 −17
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package android.net.http;
package com.android.common;

import org.apache.http.Header;
import org.apache.http.HttpEntity;
@@ -59,11 +59,12 @@ import java.util.zip.GZIPOutputStream;
import java.net.URI;
import java.security.KeyManagementException;

import android.util.Log;
import android.content.ContentResolver;
import android.os.Looper;
import android.os.SystemProperties;
import android.provider.Settings;
import android.text.TextUtils;
import android.os.SystemProperties;
import android.util.Log;

/**
 * Subclass of the Apache {@link DefaultHttpClient} that is configured with
@@ -86,15 +87,12 @@ public final class AndroidHttpClient implements HttpClient {
    private static final String TAG = "AndroidHttpClient";


    /** Set if HTTP requests are blocked from being executed on this thread */
    private static final ThreadLocal<Boolean> sThreadBlocked =
            new ThreadLocal<Boolean>();

    /** Interceptor throws an exception if the executing thread is blocked */
    private static final HttpRequestInterceptor sThreadCheckInterceptor =
            new HttpRequestInterceptor() {
        public void process(HttpRequest request, HttpContext context) {
            if (sThreadBlocked.get() != null && sThreadBlocked.get()) {
            // Prevent the HttpRequest from being sent on the main thread
            if (Looper.myLooper() != null && Looper.myLooper() == Looper.getMainLooper() ) {
                throw new RuntimeException("This thread forbids HTTP requests");
            }
        }
@@ -220,15 +218,6 @@ public final class AndroidHttpClient implements HttpClient {
        }
    }

    /**
     * Block this thread from executing HTTP requests.
     * Used to guard against HTTP requests blocking the main application thread.
     * @param blocked if HTTP requests run on this thread should be denied
     */
    public static void setThreadBlocked(boolean blocked) {
        sThreadBlocked.set(blocked);
    }

    /**
     * Modifies a request to indicate to the server that we would like a
     * gzipped response.  (Uses the "Accept-Encoding" HTTP header.)
+17 −1
Original line number Diff line number Diff line
package android.text.util;
/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.common;

import android.text.InputFilter;
import android.text.Spanned;
+5 −3
Original line number Diff line number Diff line
@@ -14,9 +14,11 @@
 * limitations under the License.
 */

package android.text.util;
package com.android.common;

import android.text.TextUtils;
import android.text.util.Rfc822Token;
import android.text.util.Rfc822Tokenizer;
import android.widget.AutoCompleteTextView;

import java.util.regex.Pattern;
+4 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.internal.widget;
package com.android.common.widget;

import android.content.Context;
import android.os.Handler;
@@ -104,7 +104,8 @@ public class NumberPicker extends LinearLayout implements OnClickListener,
    public NumberPicker(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs);
        setOrientation(VERTICAL);
        LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        LayoutInflater inflater =
                (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.number_picker, this, true);
        mHandler = new Handler();
        InputFilter inputFilter = new NumberPickerInputFilter();
+7 −7
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

package com.android.internal.widget;
package com.android.common.widget;

import android.content.Context;
import android.util.AttributeSet;
Loading