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

Commit a6d16993 authored by Selim Gurun's avatar Selim Gurun Committed by Android (Google) Code Review
Browse files

Merge "Small tidy up to getDefaultUserAgent. DO NOT MERGE" into jb-mr1-dev

parents b62999c1 951fcabe
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@
package android.webkit;

import android.content.Context;
import android.os.Message;
import android.os.Build;

/**
 * Manages settings state for a WebView. When a WebView is first created, it
@@ -1248,7 +1246,7 @@ public abstract class WebSettings {
     * @param context a Context object used to access application assets
     */
    public static String getDefaultUserAgent(Context context) {
        return WebView.getFactory().getDefaultUserAgent(context);
        return WebViewFactory.getProvider().getStatics().getDefaultUserAgent(context);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -1821,7 +1821,7 @@ public class WebView extends AbsoluteLayout
        }
    }

    static synchronized WebViewFactoryProvider getFactory() {
    private static synchronized WebViewFactoryProvider getFactory() {
        // For now the main purpose of this function (and the factory abstration) is to keep
        // us honest and minimize usage of WebViewClassic internals when binding the proxy.
        checkThread();
+6 −10
Original line number Diff line number Diff line
@@ -42,6 +42,12 @@ public interface WebViewFactoryProvider {
         * {@link android.webkit.WebView#disablePlatformNotifications()}
         */
        void setPlatformNotificationsEnabled(boolean enable);

        /**
         * Implements the API method:
         * {@link android.webkit.WebSettings#getDefaultUserAgent(Context) }
         */
        String getDefaultUserAgent(Context context);
    }

    Statics getStatics();
@@ -93,14 +99,4 @@ public interface WebViewFactoryProvider {
     * @return the singleton WebViewDatabase instance
     */
    WebViewDatabase getWebViewDatabase(Context context);

    /**
     * Returns the default User-Agent used by a WebView.
     * An instance of WebView could use a different User-Agent if a call
     * is made to {@link WebSettings#setUserAgent(int)} or
     * {@link WebSettings#setUserAgentString(String)}.
     *
     * @param context a Context object used to access application assets
     */
    String getDefaultUserAgent(Context context);
}