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

Commit bbb043ae authored by Tobias Sargeant's avatar Tobias Sargeant
Browse files

[webview] Rename force dark WebView settings.

Per API council request, remove setForceDarkMode -> setForceDark to
align with other framework naming.

Bug: 120599879
Test: None
Change-Id: I3f4ed00303d7e4b7d0651a384324a8b265663290
parent 8e0fb7d8
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -54509,7 +54509,7 @@ package android.webkit {
    method public abstract boolean getDomStorageEnabled();
    method public abstract String getFantasyFontFamily();
    method public abstract String getFixedFontFamily();
    method public int getForceDarkMode();
    method public int getForceDark();
    method public abstract boolean getJavaScriptCanOpenWindowsAutomatically();
    method public abstract boolean getJavaScriptEnabled();
    method public abstract android.webkit.WebSettings.LayoutAlgorithm getLayoutAlgorithm();
@@ -54556,7 +54556,7 @@ package android.webkit {
    method @Deprecated public abstract void setEnableSmoothTransition(boolean);
    method public abstract void setFantasyFontFamily(String);
    method public abstract void setFixedFontFamily(String);
    method public void setForceDarkMode(int);
    method public void setForceDark(int);
    method @Deprecated public abstract void setGeolocationDatabasePath(String);
    method public abstract void setGeolocationEnabled(boolean);
    method public abstract void setJavaScriptCanOpenWindowsAutomatically(boolean);
@@ -54587,9 +54587,9 @@ package android.webkit {
    method public abstract void setUserAgentString(@Nullable String);
    method public abstract boolean supportMultipleWindows();
    method public abstract boolean supportZoom();
    field public static final int FORCE_DARK_AUTO = 0; // 0x0
    field public static final int FORCE_DARK_OFF = -1; // 0xffffffff
    field public static final int FORCE_DARK_ON = 1; // 0x1
    field public static final int FORCE_DARK_AUTO = 1; // 0x1
    field public static final int FORCE_DARK_OFF = 0; // 0x0
    field public static final int FORCE_DARK_ON = 2; // 0x2
    field public static final int LOAD_CACHE_ELSE_NETWORK = 1; // 0x1
    field public static final int LOAD_CACHE_ONLY = 3; // 0x3
    field public static final int LOAD_DEFAULT = -1; // 0xffffffff
+9 −9
Original line number Diff line number Diff line
@@ -231,34 +231,34 @@ public abstract class WebSettings {
            FORCE_DARK_ON
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface ForceDarkMode {}
    public @interface ForceDark {}

    /**
     * Used with {@link #setForceDarkMode}
     * Used with {@link #setForceDark}
     *
     * Disable force dark, irrespective of the force dark mode of the WebView parent. In this mode,
     * WebView content will always be rendered as-is, regardless of whether native views are being
     * automatically darkened.
     */
    public static final int FORCE_DARK_OFF = -1;
    public static final int FORCE_DARK_OFF = 0;

    /**
     * Used with {@link #setForceDarkMode}
     * Used with {@link #setForceDark}
     *
     * Enable force dark, dependent on the state of the WebView parent. If the WebView parent view
     * is being automatically rendered in dark mode, then WebView content will be rendered so as to
     * emulate a dark theme. WebViews that are not attached to the view hierarchy will not be
     * inverted.
     */
    public static final int FORCE_DARK_AUTO = 0;
    public static final int FORCE_DARK_AUTO = 1;

    /**
     * Used with {@link #setForceDarkMode}
     * Used with {@link #setForceDark}
     *
     * Unconditionally enable force dark. In this mode WebView content will always be rendered so
     * as to emulate a dark theme.
     */
    public static final int FORCE_DARK_ON = +1;
    public static final int FORCE_DARK_ON = 2;

    /**
     * Enables dumping the pages navigation cache to a text file. The default
@@ -1467,7 +1467,7 @@ public abstract class WebSettings {
    /**
     * Set the force dark mode for this WebView.
     */
    public void setForceDarkMode(@ForceDarkMode int forceDarkMode) {
    public void setForceDark(@ForceDark int forceDark) {
        // Stub implementation to satisfy Roboelectrc shadows that don't override this yet.
    }

@@ -1476,7 +1476,7 @@ public abstract class WebSettings {
     *
     * @return the currently set force dark mode.
     */
    public @ForceDarkMode int getForceDarkMode() {
    public @ForceDark int getForceDark() {
        // Stub implementation to satisfy Roboelectrc shadows that don't override this yet.
        return FORCE_DARK_AUTO;
    }