WebView: deprecate accidentally-exposed constructors

This deprecates public-exposed constructors. These constructors were
exposed by accident. These classes shouldn't be instantiated by
applications, but should only be instantiated by WebView.

In some cases, the app should get a singleton instance using
a #getInstance method. In these cases, we document this explicitly in
the deprecation note.

Bug: 110807530
Test: make docs, manually verify docs look good.
Change-Id: Ibe73b3399c9ced0cf4fbb01e1df13564476df252
This commit is contained in:
Nate Fischer
2018-09-25 18:27:25 -07:00
parent abdaf5b51f
commit 1e13fae31c
7 changed files with 49 additions and 6 deletions

View File

@@ -51406,7 +51406,7 @@ package android.webkit {
}
public abstract class CookieManager {
ctor public CookieManager();
ctor public deprecated CookieManager();
method public abstract boolean acceptCookie();
method public abstract boolean acceptThirdPartyCookies(android.webkit.WebView);
method public static boolean allowFileSchemeCookies();
@@ -51506,13 +51506,13 @@ package android.webkit {
}
public abstract class RenderProcessGoneDetail {
ctor public RenderProcessGoneDetail();
ctor public deprecated RenderProcessGoneDetail();
method public abstract boolean didCrash();
method public abstract int rendererPriorityAtExit();
}
public abstract class SafeBrowsingResponse {
ctor public SafeBrowsingResponse();
ctor public deprecated SafeBrowsingResponse();
method public abstract void backToSafety(boolean);
method public abstract void proceed(boolean);
method public abstract void showInterstitial(boolean);
@@ -51524,7 +51524,7 @@ package android.webkit {
}
public abstract class ServiceWorkerController {
ctor public ServiceWorkerController();
ctor public deprecated ServiceWorkerController();
method public static android.webkit.ServiceWorkerController getInstance();
method public abstract android.webkit.ServiceWorkerWebSettings getServiceWorkerWebSettings();
method public abstract void setServiceWorkerClient(android.webkit.ServiceWorkerClient);
@@ -51573,7 +51573,7 @@ package android.webkit {
}
public abstract class TracingController {
ctor public TracingController();
ctor public deprecated TracingController();
method public static android.webkit.TracingController getInstance();
method public abstract boolean isTracing();
method public abstract void start(android.webkit.TracingConfig);
@@ -52113,7 +52113,7 @@ package android.webkit {
}
public abstract class WebViewDatabase {
ctor public WebViewDatabase();
ctor public deprecated WebViewDatabase();
method public abstract deprecated void clearFormData();
method public abstract void clearHttpAuthUsernamePassword();
method public abstract deprecated void clearUsernamePassword();

View File

@@ -25,6 +25,13 @@ import android.net.WebAddress;
* Cookies are manipulated according to RFC2109.
*/
public abstract class CookieManager {
/**
* @deprecated This class should not be constructed by applications, use {@link #getInstance}
* instead to fetch the singleton instance.
*/
// TODO(ntfschr): mark this as @SystemApi after a year.
@Deprecated
public CookieManager() {}
@Override
protected Object clone() throws CloneNotSupportedException {

View File

@@ -21,6 +21,13 @@ package android.webkit;
* exited. The application may use this to decide how to handle the situation.
**/
public abstract class RenderProcessGoneDetail {
/**
* @deprecated This class should not be constructed by applications.
*/
// TODO(ntfschr): mark this as @SystemApi after a year.
@Deprecated
public RenderProcessGoneDetail() {}
/**
* Indicates whether the render process was observed to crash, or whether
* it was killed by the system.

View File

@@ -27,6 +27,12 @@ package android.webkit;
* {@link android.webkit.WebView#getSafeBrowsingPrivacyPolicyUrl()}.
*/
public abstract class SafeBrowsingResponse {
/**
* @deprecated This class should not be constructed by applications.
*/
// TODO(ntfschr): mark this as @SystemApi after a year.
@Deprecated
public SafeBrowsingResponse() {}
/**
* Display the default interstitial.

View File

@@ -37,6 +37,14 @@ import android.annotation.Nullable;
*/
public abstract class ServiceWorkerController {
/**
* @deprecated This class should not be constructed by applications, use {@link #getInstance()}
* instead to fetch the singleton instance.
*/
// TODO(ntfschr): mark this as @SystemApi after a year.
@Deprecated
public ServiceWorkerController() {}
/**
* Returns the default ServiceWorkerController instance. At present there is
* only one ServiceWorkerController instance for all WebView instances,

View File

@@ -43,6 +43,13 @@ import java.util.concurrent.Executor;
* </pre></p>
*/
public abstract class TracingController {
/**
* @deprecated This class should not be constructed by applications, use {@link #getInstance}
* instead to fetch the singleton instance.
*/
// TODO(ntfschr): mark this as @SystemApi after a year.
@Deprecated
public TracingController() {}
/**
* Returns the default TracingController instance. At present there is

View File

@@ -30,6 +30,14 @@ import android.content.Context;
* </ul>
*/
public abstract class WebViewDatabase {
/**
* @deprecated This class should not be constructed by applications, use {@link
* #getInstance(Context)} instead to fetch the singleton instance.
*/
// TODO(ntfschr): mark this as @SystemApi after a year.
@Deprecated
public WebViewDatabase() {}
/**
* @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
*/