summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jonathan Dixon <joth@google.com> 2012-03-28 12:27:36 +0100
committer Jonathan Dixon <joth@google.com> 2012-04-12 20:23:37 +0100
commita3dc86e637873be115e68be50bd1b281beff7994 (patch)
tree180df30ef6d537212c18efefa29b6002e220b98b
parent39edeeefe7778162e3b0c4c584a43b4bb6c0c788 (diff)
Hide the public constructors for singleton classes
WebStorage and GeolocationPermissions are not intended for direct use by application code. Existing APKs using this will still work (as well as they ever could have), but this change will cause a compile break if they move to SDK >= 16, which should be fixed by using getInstance() instead. Bug: 6238010 Change-Id: I75789cc260c8fe005c42942bc81483193cc54f17
-rw-r--r--api/16.txt2
-rw-r--r--api/current.txt2
-rwxr-xr-xcore/java/android/webkit/GeolocationPermissions.java10
-rw-r--r--core/java/android/webkit/WebStorage.java10
4 files changed, 20 insertions, 4 deletions
diff --git a/api/16.txt b/api/16.txt
index aa23b4d19ee6..de99eee3e976 100644
--- a/api/16.txt
+++ b/api/16.txt
@@ -24839,7 +24839,6 @@ package android.webkit {
}
public final class GeolocationPermissions {
- ctor public GeolocationPermissions();
method public void allow(java.lang.String);
method public void clear(java.lang.String);
method public void clearAll();
@@ -25129,7 +25128,6 @@ package android.webkit {
}
public final class WebStorage {
- ctor public WebStorage();
method public void deleteAllData();
method public void deleteOrigin(java.lang.String);
method public static android.webkit.WebStorage getInstance();
diff --git a/api/current.txt b/api/current.txt
index bb313cd016ab..b00008814256 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -25430,7 +25430,6 @@ package android.webkit {
}
public final class GeolocationPermissions {
- ctor public GeolocationPermissions();
method public void allow(java.lang.String);
method public void clear(java.lang.String);
method public void clearAll();
@@ -25720,7 +25719,6 @@ package android.webkit {
}
public final class WebStorage {
- ctor public WebStorage();
method public void deleteAllData();
method public void deleteOrigin(java.lang.String);
method public static android.webkit.WebStorage getInstance();
diff --git a/core/java/android/webkit/GeolocationPermissions.java b/core/java/android/webkit/GeolocationPermissions.java
index 93eb082349d4..1160d5797d18 100755
--- a/core/java/android/webkit/GeolocationPermissions.java
+++ b/core/java/android/webkit/GeolocationPermissions.java
@@ -293,6 +293,16 @@ public final class GeolocationPermissions {
postMessage(Message.obtain(null, CLEAR_ALL));
}
+ /**
+ * This class should not be instantiated directly, applications must only use
+ * {@link #getInstance()} to obtain the instance.
+ * Note this constructor was erroneously public and published in SDK levels prior to 16, but
+ * applications using it would receive a non-functional instance of this class (there was no
+ * way to call createHandler() and createUIHandler(), so it would not work).
+ * @hide
+ */
+ public GeolocationPermissions() {}
+
// Native functions, run on the WebKit thread.
private static native Set nativeGetOrigins();
private static native boolean nativeGetAllowed(String origin);
diff --git a/core/java/android/webkit/WebStorage.java b/core/java/android/webkit/WebStorage.java
index 2300c2eca897..3745258d6f2d 100644
--- a/core/java/android/webkit/WebStorage.java
+++ b/core/java/android/webkit/WebStorage.java
@@ -418,6 +418,16 @@ public final class WebStorage {
}
}
+ /**
+ * This class should not be instantiated directly, applications must only use
+ * {@link #getInstance()} to obtain the instance.
+ * Note this constructor was erroneously public and published in SDK levels prior to 16, but
+ * applications using it would receive a non-functional instance of this class (there was no
+ * way to call createHandler() and createUIHandler(), so it would not work).
+ * @hide
+ */
+ public WebStorage() {}
+
// Native functions
private static native Set nativeGetOrigins();
private static native long nativeGetUsageForOrigin(String origin);