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

Commit 939e5040 authored by Jonathan Dixon's avatar Jonathan Dixon
Browse files

Two WebView API cleanups

- remove final from classes which we will need to provide subclasses
  in future: CookieManager, GeolocationPermissions, WebIconDatabase
  and WebStorage. None of these have published constructors,
  so applications cannot subclass them anyway.

- Also convert some protected members of JsResult to private, as its of
  no use to legal subclasses, and applications cannot subclass it.

Change-Id: Iaca9d2db31e25853b6c55feae41d9e7774087479
parent f804ba13
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -24806,7 +24806,7 @@ package android.webkit {
    enum_constant public static final android.webkit.ConsoleMessage.MessageLevel WARNING;
  }
  public final class CookieManager {
  public class CookieManager {
    method public synchronized boolean acceptCookie();
    method public static boolean allowFileSchemeCookies();
    method public java.lang.String getCookie(java.lang.String);
@@ -24838,7 +24838,7 @@ package android.webkit {
    method public abstract void onDownloadStart(java.lang.String, java.lang.String, java.lang.String, java.lang.String, long);
  }
  public final class GeolocationPermissions {
  public class GeolocationPermissions {
    method public void allow(java.lang.String);
    method public void clear(java.lang.String);
    method public void clearAll();
@@ -24864,8 +24864,6 @@ package android.webkit {
  public class JsResult {
    method public final void cancel();
    method public final void confirm();
    method protected final void wakeUp();
    field protected boolean mResult;
  }
  public class MimeTypeMap {
@@ -24958,7 +24956,7 @@ package android.webkit {
    method public java.lang.String getUrl();
  }
  public final class WebIconDatabase {
  public class WebIconDatabase {
    method public void close();
    method public static android.webkit.WebIconDatabase getInstance();
    method public void open(java.lang.String);
@@ -25127,7 +25125,7 @@ package android.webkit {
    enum_constant public static final android.webkit.WebSettings.ZoomDensity MEDIUM;
  }
  public final class WebStorage {
  public class WebStorage {
    method public void deleteAllData();
    method public void deleteOrigin(java.lang.String);
    method public static android.webkit.WebStorage getInstance();
+4 −6
Original line number Diff line number Diff line
@@ -25459,7 +25459,7 @@ package android.webkit {
    enum_constant public static final android.webkit.ConsoleMessage.MessageLevel WARNING;
  }
  public final class CookieManager {
  public class CookieManager {
    method public synchronized boolean acceptCookie();
    method public static boolean allowFileSchemeCookies();
    method public java.lang.String getCookie(java.lang.String);
@@ -25491,7 +25491,7 @@ package android.webkit {
    method public abstract void onDownloadStart(java.lang.String, java.lang.String, java.lang.String, java.lang.String, long);
  }
  public final class GeolocationPermissions {
  public class GeolocationPermissions {
    method public void allow(java.lang.String);
    method public void clear(java.lang.String);
    method public void clearAll();
@@ -25517,8 +25517,6 @@ package android.webkit {
  public class JsResult {
    method public final void cancel();
    method public final void confirm();
    method protected final void wakeUp();
    field protected boolean mResult;
  }
  public class MimeTypeMap {
@@ -25611,7 +25609,7 @@ package android.webkit {
    method public java.lang.String getUrl();
  }
  public final class WebIconDatabase {
  public class WebIconDatabase {
    method public void close();
    method public static android.webkit.WebIconDatabase getInstance();
    method public void open(java.lang.String);
@@ -25780,7 +25778,7 @@ package android.webkit {
    enum_constant public static final android.webkit.WebSettings.ZoomDensity MEDIUM;
  }
  public final class WebStorage {
  public class WebStorage {
    method public void deleteAllData();
    method public void deleteOrigin(java.lang.String);
    method public static android.webkit.WebStorage getInstance();
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ import android.util.Log;
 * Manages the cookies used by an application's {@link WebView} instances.
 * Cookies are manipulated according to RFC2109.
 */
public final class CookieManager {
public class CookieManager {

    private static CookieManager sRef;

+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ import java.util.Vector;
// Within WebKit, Geolocation permissions may be applied either temporarily
// (for the duration of the page) or permanently. This class deals only with
// permanent permissions.
public final class GeolocationPermissions {
public class GeolocationPermissions {
    /**
     * A callback interface used by the host application to set the Geolocation
     * permission state for an origin.
+5 −8
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@ package android.webkit;
 * and provides a means for the client to indicate whether this action should proceed.
 */
public class JsResult {
    // This is a basic result of a confirm or prompt dialog.
    protected boolean mResult;
    /**
     * Callback interface, implemented by the WebViewProvider implementation to receive
     * notifications when the JavaScript result represented by a JsResult instance has
@@ -32,11 +30,10 @@ public class JsResult {
    public interface ResultReceiver {
        public void onJsResultComplete(JsResult result);
    }
    /**
     * This is the caller of the prompt and is the object that is waiting.
     * @hide
     */
    protected final ResultReceiver mReceiver;
    // This is the caller of the prompt and is the object that is waiting.
    private final ResultReceiver mReceiver;
    // This is a basic result of a confirm or prompt dialog.
    private boolean mResult;

    /**
     * Handle the result if the user cancelled the dialog.
@@ -69,7 +66,7 @@ public class JsResult {
    }

    /* Notify the caller that the JsResult has completed */
    protected final void wakeUp() {
    private final void wakeUp() {
        mReceiver.onJsResultComplete(this);
    }
}
Loading