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

Commit 69f9f930 authored by Jonathan Dixon's avatar Jonathan Dixon
Browse files

Add tracing to WebView API methods and callbacks

Bug: 10488419

This is useful for debugging numerous SxS issues.

Change-Id: I5d0d2e253499741c5f9454582988c99e42dc0a81
parent 9d7c4d4a
Loading
Loading
Loading
Loading
+40 −3
Original line number Original line Diff line number Diff line
@@ -50,7 +50,9 @@ import java.util.Map;
 */
 */
class CallbackProxy extends Handler {
class CallbackProxy extends Handler {
    // Logging tag
    // Logging tag
    private static final String LOGTAG = "CallbackProxy";
    static final String LOGTAG = "WebViewCallback";
    // Enables API callback tracing
    private static final boolean TRACE = DebugFlags.TRACE_CALLBACK;
    // Instance of WebViewClient that is the client callback.
    // Instance of WebViewClient that is the client callback.
    private volatile WebViewClient mWebViewClient;
    private volatile WebViewClient mWebViewClient;
    // Instance of WebChromeClient for handling all chrome functions.
    // Instance of WebChromeClient for handling all chrome functions.
@@ -258,6 +260,7 @@ class CallbackProxy extends Handler {
        }
        }
        boolean override = false;
        boolean override = false;
        if (mWebViewClient != null) {
        if (mWebViewClient != null) {
            if (TRACE) Log.d(LOGTAG, "shouldOverrideUrlLoading=" + overrideUrl);
            override = mWebViewClient.shouldOverrideUrlLoading(mWebView.getWebView(),
            override = mWebViewClient.shouldOverrideUrlLoading(mWebView.getWebView(),
                    overrideUrl);
                    overrideUrl);
        } else {
        } else {
@@ -307,6 +310,7 @@ class CallbackProxy extends Handler {
                String startedUrl = msg.getData().getString("url");
                String startedUrl = msg.getData().getString("url");
                mWebView.onPageStarted(startedUrl);
                mWebView.onPageStarted(startedUrl);
                if (mWebViewClient != null) {
                if (mWebViewClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onPageStarted=" + startedUrl);
                    mWebViewClient.onPageStarted(mWebView.getWebView(), startedUrl,
                    mWebViewClient.onPageStarted(mWebView.getWebView(), startedUrl,
                            (Bitmap) msg.obj);
                            (Bitmap) msg.obj);
                }
                }
@@ -316,18 +320,21 @@ class CallbackProxy extends Handler {
                String finishedUrl = (String) msg.obj;
                String finishedUrl = (String) msg.obj;
                mWebView.onPageFinished(finishedUrl);
                mWebView.onPageFinished(finishedUrl);
                if (mWebViewClient != null) {
                if (mWebViewClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onPageFinished=" + finishedUrl);
                    mWebViewClient.onPageFinished(mWebView.getWebView(), finishedUrl);
                    mWebViewClient.onPageFinished(mWebView.getWebView(), finishedUrl);
                }
                }
                break;
                break;


            case RECEIVED_ICON:
            case RECEIVED_ICON:
                if (mWebChromeClient != null) {
                if (mWebChromeClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onReceivedIcon");
                    mWebChromeClient.onReceivedIcon(mWebView.getWebView(), (Bitmap) msg.obj);
                    mWebChromeClient.onReceivedIcon(mWebView.getWebView(), (Bitmap) msg.obj);
                }
                }
                break;
                break;


            case RECEIVED_TOUCH_ICON_URL:
            case RECEIVED_TOUCH_ICON_URL:
                if (mWebChromeClient != null) {
                if (mWebChromeClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onReceivedTouchIconUrl");
                    mWebChromeClient.onReceivedTouchIconUrl(mWebView.getWebView(),
                    mWebChromeClient.onReceivedTouchIconUrl(mWebView.getWebView(),
                            (String) msg.obj, msg.arg1 == 1);
                            (String) msg.obj, msg.arg1 == 1);
                }
                }
@@ -335,6 +342,7 @@ class CallbackProxy extends Handler {


            case RECEIVED_TITLE:
            case RECEIVED_TITLE:
                if (mWebChromeClient != null) {
                if (mWebChromeClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onReceivedTitle");
                    mWebChromeClient.onReceivedTitle(mWebView.getWebView(),
                    mWebChromeClient.onReceivedTitle(mWebView.getWebView(),
                            (String) msg.obj);
                            (String) msg.obj);
                }
                }
@@ -345,6 +353,7 @@ class CallbackProxy extends Handler {
                    int reasonCode = msg.arg1;
                    int reasonCode = msg.arg1;
                    final String description  = msg.getData().getString("description");
                    final String description  = msg.getData().getString("description");
                    final String failUrl  = msg.getData().getString("failingUrl");
                    final String failUrl  = msg.getData().getString("failingUrl");
                    if (TRACE) Log.d(LOGTAG, "onReceivedError=" + failUrl);
                    mWebViewClient.onReceivedError(mWebView.getWebView(), reasonCode,
                    mWebViewClient.onReceivedError(mWebView.getWebView(), reasonCode,
                            description, failUrl);
                            description, failUrl);
                }
                }
@@ -356,6 +365,7 @@ class CallbackProxy extends Handler {
                Message dontResend =
                Message dontResend =
                        (Message) msg.getData().getParcelable("dontResend");
                        (Message) msg.getData().getParcelable("dontResend");
                if (mWebViewClient != null) {
                if (mWebViewClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onFormResubmission");
                    mWebViewClient.onFormResubmission(mWebView.getWebView(), dontResend,
                    mWebViewClient.onFormResubmission(mWebView.getWebView(), dontResend,
                            resend);
                            resend);
                } else {
                } else {
@@ -379,6 +389,7 @@ class CallbackProxy extends Handler {
                    HttpAuthHandler handler = (HttpAuthHandler) msg.obj;
                    HttpAuthHandler handler = (HttpAuthHandler) msg.obj;
                    String host = msg.getData().getString("host");
                    String host = msg.getData().getString("host");
                    String realm = msg.getData().getString("realm");
                    String realm = msg.getData().getString("realm");
                    if (TRACE) Log.d(LOGTAG, "onReceivedHttpAuthRequest");
                    mWebViewClient.onReceivedHttpAuthRequest(mWebView.getWebView(), handler,
                    mWebViewClient.onReceivedHttpAuthRequest(mWebView.getWebView(), handler,
                            host, realm);
                            host, realm);
                }
                }
@@ -388,6 +399,7 @@ class CallbackProxy extends Handler {
                if (mWebViewClient != null) {
                if (mWebViewClient != null) {
                    HashMap<String, Object> map =
                    HashMap<String, Object> map =
                        (HashMap<String, Object>) msg.obj;
                        (HashMap<String, Object>) msg.obj;
                    if (TRACE) Log.d(LOGTAG, "onReceivedSslError");
                    mWebViewClient.onReceivedSslError(mWebView.getWebView(),
                    mWebViewClient.onReceivedSslError(mWebView.getWebView(),
                            (SslErrorHandler) map.get("handler"),
                            (SslErrorHandler) map.get("handler"),
                            (SslError) map.get("error"));
                            (SslError) map.get("error"));
@@ -396,6 +408,7 @@ class CallbackProxy extends Handler {


            case PROCEEDED_AFTER_SSL_ERROR:
            case PROCEEDED_AFTER_SSL_ERROR:
                if (mWebViewClient != null && mWebViewClient instanceof WebViewClientClassicExt) {
                if (mWebViewClient != null && mWebViewClient instanceof WebViewClientClassicExt) {
                    if (TRACE) Log.d(LOGTAG, "onProceededAfterSslError");
                    ((WebViewClientClassicExt) mWebViewClient).onProceededAfterSslError(
                    ((WebViewClientClassicExt) mWebViewClient).onProceededAfterSslError(
                            mWebView.getWebView(),
                            mWebView.getWebView(),
                            (SslError) msg.obj);
                            (SslError) msg.obj);
@@ -404,6 +417,7 @@ class CallbackProxy extends Handler {


            case CLIENT_CERT_REQUEST:
            case CLIENT_CERT_REQUEST:
                if (mWebViewClient != null  && mWebViewClient instanceof WebViewClientClassicExt) {
                if (mWebViewClient != null  && mWebViewClient instanceof WebViewClientClassicExt) {
                    if (TRACE) Log.d(LOGTAG, "onReceivedClientCertRequest");
                    HashMap<String, Object> map = (HashMap<String, Object>) msg.obj;
                    HashMap<String, Object> map = (HashMap<String, Object>) msg.obj;
                    ((WebViewClientClassicExt) mWebViewClient).onReceivedClientCertRequest(
                    ((WebViewClientClassicExt) mWebViewClient).onReceivedClientCertRequest(
                            mWebView.getWebView(),
                            mWebView.getWebView(),
@@ -418,6 +432,7 @@ class CallbackProxy extends Handler {
                // changed.
                // changed.
                synchronized (this) {
                synchronized (this) {
                    if (mWebChromeClient != null) {
                    if (mWebChromeClient != null) {
                        if (TRACE) Log.d(LOGTAG, "onProgressChanged=" + mLatestProgress);
                        mWebChromeClient.onProgressChanged(mWebView.getWebView(),
                        mWebChromeClient.onProgressChanged(mWebView.getWebView(),
                                mLatestProgress);
                                mLatestProgress);
                    }
                    }
@@ -427,14 +442,18 @@ class CallbackProxy extends Handler {


            case UPDATE_VISITED:
            case UPDATE_VISITED:
                if (mWebViewClient != null) {
                if (mWebViewClient != null) {
                    String url = (String) msg.obj;
                    if (TRACE) Log.d(LOGTAG, "doUpdateVisitedHistory=" + url);
                    mWebViewClient.doUpdateVisitedHistory(mWebView.getWebView(),
                    mWebViewClient.doUpdateVisitedHistory(mWebView.getWebView(),
                            (String) msg.obj, msg.arg1 != 0);
                            url, msg.arg1 != 0);
                }
                }
                break;
                break;


            case LOAD_RESOURCE:
            case LOAD_RESOURCE:
                if (mWebViewClient != null) {
                if (mWebViewClient != null) {
                    mWebViewClient.onLoadResource(mWebView.getWebView(), (String) msg.obj);
                    String url = (String) msg.obj;
                    if (TRACE) Log.d(LOGTAG, "onLoadResource=" + url);
                    mWebViewClient.onLoadResource(mWebView.getWebView(), url);
                }
                }
                break;
                break;


@@ -448,6 +467,7 @@ class CallbackProxy extends Handler {
                    String referer = msg.getData().getString("referer");
                    String referer = msg.getData().getString("referer");
                    Long contentLength = msg.getData().getLong("contentLength");
                    Long contentLength = msg.getData().getLong("contentLength");


                    if (TRACE) Log.d(LOGTAG, "onDownloadStart");
                    if (mDownloadListener instanceof BrowserDownloadListener) {
                    if (mDownloadListener instanceof BrowserDownloadListener) {
                        ((BrowserDownloadListener) mDownloadListener).onDownloadStart(url,
                        ((BrowserDownloadListener) mDownloadListener).onDownloadStart(url,
                             userAgent, contentDisposition, mimetype, referer, contentLength);
                             userAgent, contentDisposition, mimetype, referer, contentLength);
@@ -460,6 +480,7 @@ class CallbackProxy extends Handler {


            case CREATE_WINDOW:
            case CREATE_WINDOW:
                if (mWebChromeClient != null) {
                if (mWebChromeClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onCreateWindow");
                    if (!mWebChromeClient.onCreateWindow(mWebView.getWebView(),
                    if (!mWebChromeClient.onCreateWindow(mWebView.getWebView(),
                                msg.arg1 == 1, msg.arg2 == 1,
                                msg.arg1 == 1, msg.arg2 == 1,
                                (Message) msg.obj)) {
                                (Message) msg.obj)) {
@@ -473,12 +494,14 @@ class CallbackProxy extends Handler {


            case REQUEST_FOCUS:
            case REQUEST_FOCUS:
                if (mWebChromeClient != null) {
                if (mWebChromeClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onRequestFocus");
                    mWebChromeClient.onRequestFocus(mWebView.getWebView());
                    mWebChromeClient.onRequestFocus(mWebView.getWebView());
                }
                }
                break;
                break;


            case CLOSE_WINDOW:
            case CLOSE_WINDOW:
                if (mWebChromeClient != null) {
                if (mWebChromeClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onCloseWindow");
                    mWebChromeClient.onCloseWindow(((WebViewClassic) msg.obj).getWebView());
                    mWebChromeClient.onCloseWindow(((WebViewClassic) msg.obj).getWebView());
                }
                }
                break;
                break;
@@ -500,6 +523,7 @@ class CallbackProxy extends Handler {


            case ASYNC_KEYEVENTS:
            case ASYNC_KEYEVENTS:
                if (mWebViewClient != null) {
                if (mWebViewClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onUnhandledKeyEvent");
                    mWebViewClient.onUnhandledKeyEvent(mWebView.getWebView(),
                    mWebViewClient.onUnhandledKeyEvent(mWebView.getWebView(),
                            (KeyEvent) msg.obj);
                            (KeyEvent) msg.obj);
                }
                }
@@ -521,6 +545,7 @@ class CallbackProxy extends Handler {
                    WebStorage.QuotaUpdater quotaUpdater =
                    WebStorage.QuotaUpdater quotaUpdater =
                        (WebStorage.QuotaUpdater) map.get("quotaUpdater");
                        (WebStorage.QuotaUpdater) map.get("quotaUpdater");


                    if (TRACE) Log.d(LOGTAG, "onExceededDatabaseQuota");
                    mWebChromeClient.onExceededDatabaseQuota(url,
                    mWebChromeClient.onExceededDatabaseQuota(url,
                            databaseIdentifier, quota, estimatedDatabaseSize,
                            databaseIdentifier, quota, estimatedDatabaseSize,
                            totalQuota, quotaUpdater);
                            totalQuota, quotaUpdater);
@@ -538,6 +563,7 @@ class CallbackProxy extends Handler {
                    WebStorage.QuotaUpdater quotaUpdater =
                    WebStorage.QuotaUpdater quotaUpdater =
                        (WebStorage.QuotaUpdater) map.get("quotaUpdater");
                        (WebStorage.QuotaUpdater) map.get("quotaUpdater");


                    if (TRACE) Log.d(LOGTAG, "onReachedMaxAppCacheSize");
                    mWebChromeClient.onReachedMaxAppCacheSize(requiredStorage,
                    mWebChromeClient.onReachedMaxAppCacheSize(requiredStorage,
                            quota, quotaUpdater);
                            quota, quotaUpdater);
                }
                }
@@ -551,6 +577,7 @@ class CallbackProxy extends Handler {
                    GeolocationPermissions.Callback callback =
                    GeolocationPermissions.Callback callback =
                            (GeolocationPermissions.Callback)
                            (GeolocationPermissions.Callback)
                            map.get("callback");
                            map.get("callback");
                    if (TRACE) Log.d(LOGTAG, "onGeolocationPermissionsShowPrompt");
                    mWebChromeClient.onGeolocationPermissionsShowPrompt(origin,
                    mWebChromeClient.onGeolocationPermissionsShowPrompt(origin,
                            callback);
                            callback);
                }
                }
@@ -558,6 +585,7 @@ class CallbackProxy extends Handler {


            case GEOLOCATION_PERMISSIONS_HIDE_PROMPT:
            case GEOLOCATION_PERMISSIONS_HIDE_PROMPT:
                if (mWebChromeClient != null) {
                if (mWebChromeClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onGeolocationPermissionsHidePrompt");
                    mWebChromeClient.onGeolocationPermissionsHidePrompt();
                    mWebChromeClient.onGeolocationPermissionsHidePrompt();
                }
                }
                break;
                break;
@@ -566,6 +594,7 @@ class CallbackProxy extends Handler {
                if (mWebChromeClient != null) {
                if (mWebChromeClient != null) {
                    final JsResultReceiver receiver = (JsResultReceiver) msg.obj;
                    final JsResultReceiver receiver = (JsResultReceiver) msg.obj;
                    JsDialogHelper helper = new JsDialogHelper(receiver.mJsResult, msg);
                    JsDialogHelper helper = new JsDialogHelper(receiver.mJsResult, msg);
                    if (TRACE) Log.d(LOGTAG, "onJsAlert");
                    if (!helper.invokeCallback(mWebChromeClient, mWebView.getWebView())) {
                    if (!helper.invokeCallback(mWebChromeClient, mWebView.getWebView())) {
                        helper.showDialog(mContext);
                        helper.showDialog(mContext);
                    }
                    }
@@ -577,6 +606,7 @@ class CallbackProxy extends Handler {
                if(mWebChromeClient != null) {
                if(mWebChromeClient != null) {
                    final JsResultReceiver receiver = (JsResultReceiver) msg.obj;
                    final JsResultReceiver receiver = (JsResultReceiver) msg.obj;
                    final JsResult res = receiver.mJsResult;
                    final JsResult res = receiver.mJsResult;
                    if (TRACE) Log.d(LOGTAG, "onJsTimeout");
                    if (mWebChromeClient.onJsTimeout()) {
                    if (mWebChromeClient.onJsTimeout()) {
                        res.confirm();
                        res.confirm();
                    } else {
                    } else {
@@ -598,6 +628,7 @@ class CallbackProxy extends Handler {


            case SCALE_CHANGED:
            case SCALE_CHANGED:
                if (mWebViewClient != null) {
                if (mWebViewClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onScaleChanged");
                    mWebViewClient.onScaleChanged(mWebView.getWebView(), msg.getData()
                    mWebViewClient.onScaleChanged(mWebView.getWebView(), msg.getData()
                            .getFloat("old"), msg.getData().getFloat("new"));
                            .getFloat("old"), msg.getData().getFloat("new"));
                }
                }
@@ -624,6 +655,7 @@ class CallbackProxy extends Handler {
                ConsoleMessage.MessageLevel messageLevel =
                ConsoleMessage.MessageLevel messageLevel =
                        ConsoleMessage.MessageLevel.values()[msgLevel];
                        ConsoleMessage.MessageLevel.values()[msgLevel];


                if (TRACE) Log.d(LOGTAG, "onConsoleMessage");
                if (!mWebChromeClient.onConsoleMessage(new ConsoleMessage(message, sourceID,
                if (!mWebChromeClient.onConsoleMessage(new ConsoleMessage(message, sourceID,
                        lineNumber, messageLevel))) {
                        lineNumber, messageLevel))) {
                    // If false was returned the user did not provide their own console function so
                    // If false was returned the user did not provide their own console function so
@@ -654,12 +686,14 @@ class CallbackProxy extends Handler {


            case GET_VISITED_HISTORY:
            case GET_VISITED_HISTORY:
                if (mWebChromeClient != null) {
                if (mWebChromeClient != null) {
                    if (TRACE) Log.d(LOGTAG, "getVisitedHistory");
                    mWebChromeClient.getVisitedHistory((ValueCallback<String[]>)msg.obj);
                    mWebChromeClient.getVisitedHistory((ValueCallback<String[]>)msg.obj);
                }
                }
                break;
                break;


            case OPEN_FILE_CHOOSER:
            case OPEN_FILE_CHOOSER:
                if (mWebChromeClient != null) {
                if (mWebChromeClient != null) {
                    if (TRACE) Log.d(LOGTAG, "openFileChooser");
                    UploadFileMessageData data = (UploadFileMessageData)msg.obj;
                    UploadFileMessageData data = (UploadFileMessageData)msg.obj;
                    mWebChromeClient.openFileChooser(data.getUploadFile(), data.getAcceptType(),
                    mWebChromeClient.openFileChooser(data.getUploadFile(), data.getAcceptType(),
                            data.getCapture());
                            data.getCapture());
@@ -668,6 +702,7 @@ class CallbackProxy extends Handler {


            case ADD_HISTORY_ITEM:
            case ADD_HISTORY_ITEM:
                if (mWebBackForwardListClient != null) {
                if (mWebBackForwardListClient != null) {
                    if (TRACE) Log.d(LOGTAG, "onNewHistoryItem");
                    mWebBackForwardListClient.onNewHistoryItem(
                    mWebBackForwardListClient.onNewHistoryItem(
                            (WebHistoryItem) msg.obj);
                            (WebHistoryItem) msg.obj);
                }
                }
@@ -693,6 +728,7 @@ class CallbackProxy extends Handler {
                    String realm = msg.getData().getString("realm");
                    String realm = msg.getData().getString("realm");
                    String account = msg.getData().getString("account");
                    String account = msg.getData().getString("account");
                    String args = msg.getData().getString("args");
                    String args = msg.getData().getString("args");
                    if (TRACE) Log.d(LOGTAG, "onReceivedLoginRequest");
                    mWebViewClient.onReceivedLoginRequest(mWebView.getWebView(), realm,
                    mWebViewClient.onReceivedLoginRequest(mWebView.getWebView(), realm,
                            account, args);
                            account, args);
                }
                }
@@ -910,6 +946,7 @@ class CallbackProxy extends Handler {
            return null;
            return null;
        }
        }
        // Note: This method does _not_ send a message.
        // Note: This method does _not_ send a message.
        if (TRACE) Log.d(LOGTAG, "shouldInterceptRequest=" + url);
        WebResourceResponse r =
        WebResourceResponse r =
                mWebViewClient.shouldInterceptRequest(mWebView.getWebView(), url);
                mWebViewClient.shouldInterceptRequest(mWebView.getWebView(), url);
        if (r == null) {
        if (r == null) {
+13 −5
Original line number Original line Diff line number Diff line
@@ -24,25 +24,33 @@ package android.webkit;
 * The name of each flags maps directly to the name of the class in which that
 * The name of each flags maps directly to the name of the class in which that
 * flag is used.
 * flag is used.
 *
 *
 * @hide Only used by WebView implementations.
 */
 */
class DebugFlags {
public class DebugFlags {


    public static final boolean COOKIE_SYNC_MANAGER = false;
    public static final boolean TRACE_API = false;
    public static final boolean TRACE_CALLBACK = false;
    public static final boolean TRACE_JAVASCRIPT_BRIDGE = false;
    public static final boolean URL_UTIL = false;
    public static final boolean WEB_SYNC_MANAGER = false;

    // TODO: Delete these when WebViewClassic is moved
    public static final boolean BROWSER_FRAME = false;
    public static final boolean BROWSER_FRAME = false;
    public static final boolean CACHE_MANAGER = false;
    public static final boolean CACHE_MANAGER = false;
    public static final boolean CALLBACK_PROXY = false;
    public static final boolean CALLBACK_PROXY = false;
    public static final boolean COOKIE_MANAGER = false;
    public static final boolean COOKIE_MANAGER = false;
    public static final boolean COOKIE_SYNC_MANAGER = false;
    public static final boolean FRAME_LOADER = false;
    public static final boolean FRAME_LOADER = false;
    public static final boolean J_WEB_CORE_JAVA_BRIDGE = false;// HIGHLY VERBOSE
    public static final boolean J_WEB_CORE_JAVA_BRIDGE = false;// HIGHLY VERBOSE
    public static final boolean LOAD_LISTENER = false;
    public static final boolean LOAD_LISTENER = false;
    public static final boolean MEASURE_PAGE_SWAP_FPS = false;
    public static final boolean NETWORK = false;
    public static final boolean NETWORK = false;
    public static final boolean SSL_ERROR_HANDLER = false;
    public static final boolean SSL_ERROR_HANDLER = false;
    public static final boolean STREAM_LOADER = false;
    public static final boolean STREAM_LOADER = false;
    public static final boolean URL_UTIL = false;
    public static final boolean WEB_BACK_FORWARD_LIST = false;
    public static final boolean WEB_BACK_FORWARD_LIST = false;
    public static final boolean WEB_SETTINGS = false;
    public static final boolean WEB_SETTINGS = false;
    public static final boolean WEB_SYNC_MANAGER = false;
    public static final boolean WEB_VIEW = false;
    public static final boolean WEB_VIEW = false;
    public static final boolean WEB_VIEW_CORE = false;
    public static final boolean WEB_VIEW_CORE = false;
    public static final boolean MEASURE_PAGE_SWAP_FPS = false;


}
}
+5 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ package android.webkit;
import android.content.Context;
import android.content.Context;
import android.media.MediaPlayer;
import android.media.MediaPlayer;
import android.media.Metadata;
import android.media.Metadata;
import android.util.Log;
import android.view.Gravity;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder;
@@ -293,12 +294,16 @@ public class HTML5VideoFullScreen extends HTML5VideoView
        mLayout.setVisibility(View.VISIBLE);
        mLayout.setVisibility(View.VISIBLE);
        WebChromeClient client = webView.getWebChromeClient();
        WebChromeClient client = webView.getWebChromeClient();
        if (client != null) {
        if (client != null) {
            if (DebugFlags.TRACE_CALLBACK) Log.d(CallbackProxy.LOGTAG, "onShowCustomView");
            client.onShowCustomView(mLayout, mCallback);
            client.onShowCustomView(mLayout, mCallback);
            // Plugins like Flash will draw over the video so hide
            // Plugins like Flash will draw over the video so hide
            // them while we're playing.
            // them while we're playing.
            if (webView.getViewManager() != null)
            if (webView.getViewManager() != null)
                webView.getViewManager().hideAll();
                webView.getViewManager().hideAll();


            if (DebugFlags.TRACE_CALLBACK) {
                Log.d(CallbackProxy.LOGTAG, "getVideoLoadingProgressView");
            }
            mProgressView = client.getVideoLoadingProgressView();
            mProgressView = client.getVideoLoadingProgressView();
            if (mProgressView != null) {
            if (mProgressView != null) {
                mLayout.addView(mProgressView, layoutParams);
                mLayout.addView(mProgressView, layoutParams);
+5 −0
Original line number Original line Diff line number Diff line
@@ -180,6 +180,7 @@ class HTML5VideoViewProxy extends Handler
            if (!mHTML5VideoView.fullScreenExited() && mHTML5VideoView.isFullScreenMode()) {
            if (!mHTML5VideoView.fullScreenExited() && mHTML5VideoView.isFullScreenMode()) {
                WebChromeClient client = webView.getWebChromeClient();
                WebChromeClient client = webView.getWebChromeClient();
                if (client != null) {
                if (client != null) {
                    if (DebugFlags.TRACE_CALLBACK) Log.d(CallbackProxy.LOGTAG, "onHideCustomView");
                    client.onHideCustomView();
                    client.onHideCustomView();
                }
                }
            }
            }
@@ -405,6 +406,7 @@ class HTML5VideoViewProxy extends Handler
            case ERROR: {
            case ERROR: {
                WebChromeClient client = mWebView.getWebChromeClient();
                WebChromeClient client = mWebView.getWebChromeClient();
                if (client != null) {
                if (client != null) {
                    if (DebugFlags.TRACE_CALLBACK) Log.d(CallbackProxy.LOGTAG, "onHideCustomView");
                    client.onHideCustomView();
                    client.onHideCustomView();
                }
                }
                break;
                break;
@@ -412,6 +414,9 @@ class HTML5VideoViewProxy extends Handler
            case LOAD_DEFAULT_POSTER: {
            case LOAD_DEFAULT_POSTER: {
                WebChromeClient client = mWebView.getWebChromeClient();
                WebChromeClient client = mWebView.getWebChromeClient();
                if (client != null) {
                if (client != null) {
                    if (DebugFlags.TRACE_CALLBACK) {
                        Log.d(CallbackProxy.LOGTAG, "getDefaultVideoPoster");
                    }
                    doSetPoster(client.getDefaultVideoPoster());
                    doSetPoster(client.getDefaultVideoPoster());
                }
                }
                break;
                break;
+54 −1

File changed.

Preview size limit exceeded, changes collapsed.

Loading