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

Commit 30ccec72 authored by The Android Automerger's avatar The Android Automerger
Browse files

Merge branch 'froyo' into froyo-release

parents 1075b3e5 69ec5c22
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -112,8 +112,8 @@ public class SntpClient
            //             = (transit + skew - transit + skew)/2
            //             = (2 * skew)/2 = skew
            long clockOffset = ((receiveTime - originateTime) + (transmitTime - responseTime))/2;
            if (Config.LOGD) Log.d(TAG, "round trip: " + roundTripTime + " ms");
            if (Config.LOGD) Log.d(TAG, "clock offset: " + clockOffset + " ms");
            // if (Config.LOGD) Log.d(TAG, "round trip: " + roundTripTime + " ms");
            // if (Config.LOGD) Log.d(TAG, "clock offset: " + clockOffset + " ms");

            // save our results - use the times on this side of the network latency
            // (response rather than request time)
+24 −2
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.HttpVersion;
import org.apache.http.ParseException;
import org.apache.http.ProtocolVersion;

@@ -72,6 +73,10 @@ class Request {

    int mFailCount = 0;

    // This will be used to set the Range field if we retry a connection. This
    // is http/1.1 feature.
    private int mReceivedBytes = 0;

    private InputStream mBodyProvider;
    private int mBodyLength;

@@ -241,7 +246,6 @@ class Request {

        StatusLine statusLine = null;
        boolean hasBody = false;
        boolean reuse = false;
        httpClientConnection.flush();
        int statusCode = 0;

@@ -264,6 +268,8 @@ class Request {
        if (hasBody)
            entity = httpClientConnection.receiveResponseEntity(header);

        boolean supportPartialContent = v.greaterEquals(HttpVersion.HTTP_1_1);

        if (entity != null) {
            InputStream is = entity.getContent();

@@ -306,6 +312,7 @@ class Request {

                    if (len != -1) {
                        count += len;
                        if (supportPartialContent) mReceivedBytes += len;
                    }
                    if (len == -1 || count >= lowWater) {
                        if (HttpLog.LOGV) HttpLog.v("Request.readResponse() " + count);
@@ -324,7 +331,13 @@ class Request {
                if (HttpLog.LOGV) HttpLog.v( "readResponse() handling " + e);
            } catch(IOException e) {
                // don't throw if we have a non-OK status code
                if (statusCode == HttpStatus.SC_OK) {
                if (statusCode == HttpStatus.SC_OK
                        || statusCode == HttpStatus.SC_PARTIAL_CONTENT) {
                    if (supportPartialContent && count > 0) {
                        // if there is uncommited content, we should commit them
                        // as we will continue the request
                        mEventHandler.data(buf, count);
                    }
                    throw e;
                }
            } finally {
@@ -411,6 +424,15 @@ class Request {
            }
            setBodyProvider(mBodyProvider, mBodyLength);
        }

        if (mReceivedBytes > 0) {
            // reset the fail count as we continue the request
            mFailCount = 0;
            // set the "Range" header to indicate that the retry will continue
            // instead of restarting the request
            HttpLog.v("*** Request.reset() to range:" + mReceivedBytes);
            mHttpRequest.setHeader("Range", "bytes=" + mReceivedBytes + "-");
        }
    }

    /**
+12 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ class LoadListener extends Handler implements EventHandler {

    // Standard HTTP status codes in a more representative format
    private static final int HTTP_OK = 200;
    private static final int HTTP_PARTIAL_CONTENT = 206;
    private static final int HTTP_MOVED_PERMANENTLY = 301;
    private static final int HTTP_FOUND = 302;
    private static final int HTTP_SEE_OTHER = 303;
@@ -328,6 +329,17 @@ class LoadListener extends Handler implements EventHandler {
    // Does the header parsing work on the WebCore thread.
    private void handleHeaders(Headers headers) {
        if (mCancelled) return;

        // Note: the headers we care in LoadListeners, like
        // content-type/content-length, should not be updated for partial
        // content. Just skip here and go ahead with adding data.
        if (mStatusCode == HTTP_PARTIAL_CONTENT) {
            // we don't support cache for partial content yet
            WebViewWorker.getHandler().obtainMessage(
                    WebViewWorker.MSG_REMOVE_CACHE, this).sendToTarget();
            return;
        }

        mHeaders = headers;

        long contentLength = headers.getContentLength();
+8 −1
Original line number Diff line number Diff line
@@ -205,7 +205,14 @@ class ViewManager {
                if (sView.getVisibility() == View.VISIBLE) {
                    sView.setVisibility(View.INVISIBLE);
                    sView.getHolder().setSizeFromLayout();
                    // setLayoutParams() only requests the layout. If we set it
                    // to VISIBLE now, it will use the old dimension to set the
                    // size. Post a message to ensure that it shows the new size.
                    mWebView.mPrivateHandler.post(new Runnable() {
                        public void run() {
                            sView.setVisibility(View.VISIBLE);
                        }
                    });
                } else {
                    sView.getHolder().setSizeFromLayout();
                }
+17 −0
Original line number Diff line number Diff line
@@ -300,6 +300,23 @@ import java.util.ArrayList;
        return connection;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        // onDraw should only be called for password fields.  If WebTextView is
        // still drawing, but is no longer corresponding to a password field,
        // remove it.
        if (mWebView == null || !mWebView.nativeFocusCandidateIsPassword()
                || !isSameTextField(mWebView.nativeFocusCandidatePointer())) {
            // Although calling remove() would seem to make more sense here,
            // changing it to not be a password field will make it not draw.
            // Other code will make sure that it is removed completely, but this
            // way the user will not see it.
            setInPassword(false);
        } else {
            super.onDraw(canvas);
        }
    }

    @Override
    public void onEditorAction(int actionCode) {
        switch (actionCode) {
Loading