Skip to content

Commit 939e504

Browse files
author
Jonathan Dixon
committed
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
1 parent f804ba1 commit 939e504

File tree

7 files changed

+17
-24
lines changed

7 files changed

+17
-24
lines changed

api/16.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24806,7 +24806,7 @@ package android.webkit {
2480624806
enum_constant public static final android.webkit.ConsoleMessage.MessageLevel WARNING;
2480724807
}
2480824808

24809-
public final class CookieManager {
24809+
public class CookieManager {
2481024810
method public synchronized boolean acceptCookie();
2481124811
method public static boolean allowFileSchemeCookies();
2481224812
method public java.lang.String getCookie(java.lang.String);
@@ -24838,7 +24838,7 @@ package android.webkit {
2483824838
method public abstract void onDownloadStart(java.lang.String, java.lang.String, java.lang.String, java.lang.String, long);
2483924839
}
2484024840

24841-
public final class GeolocationPermissions {
24841+
public class GeolocationPermissions {
2484224842
method public void allow(java.lang.String);
2484324843
method public void clear(java.lang.String);
2484424844
method public void clearAll();
@@ -24864,8 +24864,6 @@ package android.webkit {
2486424864
public class JsResult {
2486524865
method public final void cancel();
2486624866
method public final void confirm();
24867-
method protected final void wakeUp();
24868-
field protected boolean mResult;
2486924867
}
2487024868

2487124869
public class MimeTypeMap {
@@ -24958,7 +24956,7 @@ package android.webkit {
2495824956
method public java.lang.String getUrl();
2495924957
}
2496024958

24961-
public final class WebIconDatabase {
24959+
public class WebIconDatabase {
2496224960
method public void close();
2496324961
method public static android.webkit.WebIconDatabase getInstance();
2496424962
method public void open(java.lang.String);
@@ -25127,7 +25125,7 @@ package android.webkit {
2512725125
enum_constant public static final android.webkit.WebSettings.ZoomDensity MEDIUM;
2512825126
}
2512925127

25130-
public final class WebStorage {
25128+
public class WebStorage {
2513125129
method public void deleteAllData();
2513225130
method public void deleteOrigin(java.lang.String);
2513325131
method public static android.webkit.WebStorage getInstance();

api/current.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25459,7 +25459,7 @@ package android.webkit {
2545925459
enum_constant public static final android.webkit.ConsoleMessage.MessageLevel WARNING;
2546025460
}
2546125461

25462-
public final class CookieManager {
25462+
public class CookieManager {
2546325463
method public synchronized boolean acceptCookie();
2546425464
method public static boolean allowFileSchemeCookies();
2546525465
method public java.lang.String getCookie(java.lang.String);
@@ -25491,7 +25491,7 @@ package android.webkit {
2549125491
method public abstract void onDownloadStart(java.lang.String, java.lang.String, java.lang.String, java.lang.String, long);
2549225492
}
2549325493

25494-
public final class GeolocationPermissions {
25494+
public class GeolocationPermissions {
2549525495
method public void allow(java.lang.String);
2549625496
method public void clear(java.lang.String);
2549725497
method public void clearAll();
@@ -25517,8 +25517,6 @@ package android.webkit {
2551725517
public class JsResult {
2551825518
method public final void cancel();
2551925519
method public final void confirm();
25520-
method protected final void wakeUp();
25521-
field protected boolean mResult;
2552225520
}
2552325521

2552425522
public class MimeTypeMap {
@@ -25611,7 +25609,7 @@ package android.webkit {
2561125609
method public java.lang.String getUrl();
2561225610
}
2561325611

25614-
public final class WebIconDatabase {
25612+
public class WebIconDatabase {
2561525613
method public void close();
2561625614
method public static android.webkit.WebIconDatabase getInstance();
2561725615
method public void open(java.lang.String);
@@ -25780,7 +25778,7 @@ package android.webkit {
2578025778
enum_constant public static final android.webkit.WebSettings.ZoomDensity MEDIUM;
2578125779
}
2578225780

25783-
public final class WebStorage {
25781+
public class WebStorage {
2578425782
method public void deleteAllData();
2578525783
method public void deleteOrigin(java.lang.String);
2578625784
method public static android.webkit.WebStorage getInstance();

core/java/android/webkit/CookieManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* Manages the cookies used by an application's {@link WebView} instances.
2727
* Cookies are manipulated according to RFC2109.
2828
*/
29-
public final class CookieManager {
29+
public class CookieManager {
3030

3131
private static CookieManager sRef;
3232

core/java/android/webkit/GeolocationPermissions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
// Within WebKit, Geolocation permissions may be applied either temporarily
5151
// (for the duration of the page) or permanently. This class deals only with
5252
// permanent permissions.
53-
public final class GeolocationPermissions {
53+
public class GeolocationPermissions {
5454
/**
5555
* A callback interface used by the host application to set the Geolocation
5656
* permission state for an origin.

core/java/android/webkit/JsResult.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
* and provides a means for the client to indicate whether this action should proceed.
2323
*/
2424
public class JsResult {
25-
// This is a basic result of a confirm or prompt dialog.
26-
protected boolean mResult;
2725
/**
2826
* Callback interface, implemented by the WebViewProvider implementation to receive
2927
* notifications when the JavaScript result represented by a JsResult instance has
@@ -32,11 +30,10 @@ public class JsResult {
3230
public interface ResultReceiver {
3331
public void onJsResultComplete(JsResult result);
3432
}
35-
/**
36-
* This is the caller of the prompt and is the object that is waiting.
37-
* @hide
38-
*/
39-
protected final ResultReceiver mReceiver;
33+
// This is the caller of the prompt and is the object that is waiting.
34+
private final ResultReceiver mReceiver;
35+
// This is a basic result of a confirm or prompt dialog.
36+
private boolean mResult;
4037

4138
/**
4239
* Handle the result if the user cancelled the dialog.
@@ -69,7 +66,7 @@ public final boolean getResult() {
6966
}
7067

7168
/* Notify the caller that the JsResult has completed */
72-
protected final void wakeUp() {
69+
private final void wakeUp() {
7370
mReceiver.onJsResultComplete(this);
7471
}
7572
}

core/java/android/webkit/WebIconDatabase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* WebIconDatabase object is a single instance and all methods operate on that
3636
* single object.
3737
*/
38-
public final class WebIconDatabase {
38+
public class WebIconDatabase {
3939
private static final String LOGTAG = "WebIconDatabase";
4040
// Global instance of a WebIconDatabase
4141
private static WebIconDatabase sIconDatabase;

core/java/android/webkit/WebStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/**
2828
* Functionality for manipulating the webstorage databases.
2929
*/
30-
public final class WebStorage {
30+
public class WebStorage {
3131

3232
/**
3333
* Encapsulates a callback function to be executed when a new quota is made

0 commit comments

Comments
 (0)