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

@@ -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}
*/