diff options
| author | Torne (Richard Coles) <torne@google.com> | 2021-09-08 13:35:32 -0400 |
|---|---|---|
| committer | Torne (Richard Coles) <torne@google.com> | 2021-09-14 14:05:08 -0400 |
| commit | 13c24022d99370cc2daeb69fe8207ac4b280df87 (patch) | |
| tree | 50951626466245f0374ce29003df374d8ddc3777 /core/java/android | |
| parent | 0a25520f9b1c57a3251e6cb57a50c71457117ce6 (diff) | |
Remove WebView AppCache APIs.
These are no-ops since WebView 95; remove them from the SDK to make it
clear to apps that they're nonfunctional.
Bug: 199287927
Test: atest CtsWebkitTestCases
Change-Id: I498aff6f8a0c2901504d777f597dbf77f982cd3a
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/webkit/WebChromeClient.java | 2 | ||||
| -rw-r--r-- | core/java/android/webkit/WebSettings.java | 15 | ||||
| -rw-r--r-- | core/java/android/webkit/WebStorage.java | 43 |
3 files changed, 30 insertions, 30 deletions
diff --git a/core/java/android/webkit/WebChromeClient.java b/core/java/android/webkit/WebChromeClient.java index 4a6551176198..a07141b260ee 100644 --- a/core/java/android/webkit/WebChromeClient.java +++ b/core/java/android/webkit/WebChromeClient.java @@ -376,6 +376,8 @@ public class WebChromeClient { * must be used to inform the WebView of the new quota. * @deprecated This method is no longer called; WebView now uses the HTML5 / JavaScript Quota * Management API. + * @removed This method is no longer called; WebView now uses the HTML5 / JavaScript Quota + * Management API. */ @Deprecated public void onReachedMaxAppCacheSize(long requiredStorage, long quota, diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index 9b753f1b2d44..364ba505f7b0 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -1131,8 +1131,12 @@ public abstract class WebSettings { * become a no-op on all Android versions once support is * removed in Chromium. Consider using Service Workers instead. * See https://web.dev/appcache-removal/ for more information. + * @removed The Application Cache API is no longer supported and this method + * is a no-op on WebView 95 and later. Consider using Service Workers + * instead. See https://web.dev/appcache-removal/ for more information. */ - public abstract void setAppCacheEnabled(boolean flag); + @Deprecated + public void setAppCacheEnabled(boolean flag) {} /** * Sets the path to the Application Caches files. In order for the @@ -1147,8 +1151,12 @@ public abstract class WebSettings { * become a no-op on all Android versions once support is * removed in Chromium. Consider using Service Workers instead. * See https://web.dev/appcache-removal/ for more information. + * @removed The Application Cache API is no longer supported and this method + * is a no-op on WebView 95 and later. Consider using Service Workers + * instead. See https://web.dev/appcache-removal/ for more information. */ - public abstract void setAppCachePath(String appCachePath); + @Deprecated + public void setAppCachePath(String appCachePath) {} /** * Sets the maximum size for the Application Cache content. The passed size @@ -1160,9 +1168,10 @@ public abstract class WebSettings { * * @param appCacheMaxSize the maximum size in bytes * @deprecated Quota is managed automatically; this method is a no-op. + * @removed Quota is managed automatically; this method is a no-op. */ @Deprecated - public abstract void setAppCacheMaxSize(long appCacheMaxSize); + public void setAppCacheMaxSize(long appCacheMaxSize) {} /** * Sets whether the database storage API is enabled. The default value is diff --git a/core/java/android/webkit/WebStorage.java b/core/java/android/webkit/WebStorage.java index 947d0cbd46a8..cd63810f7dea 100644 --- a/core/java/android/webkit/WebStorage.java +++ b/core/java/android/webkit/WebStorage.java @@ -22,18 +22,12 @@ import java.util.Map; /** * This class is used to manage the JavaScript storage APIs provided by the - * {@link WebView}. It manages the Application Cache API, the Web SQL Database - * API and the HTML5 Web Storage API. - * - * The Application Cache API provides a mechanism to create and maintain an - * application cache to power offline Web applications. Use of the Application - * Cache API can be attributed to an origin {@link WebStorage.Origin}, however - * it is not possible to set per-origin quotas. Note that there can be only - * one application cache per application. + * {@link WebView}. It manages the Web SQL Database API and the HTML5 Web + * Storage API. * * The Web SQL Database API provides storage which is private to a given origin. - * Similar to the Application Cache, use of the Web SQL Database can be attributed - * to an origin. It is also possible to set per-origin quotas. + * Use of the Web SQL Database can be attributed to an origin. It is also + * possible to set per-origin quotas. */ public class WebStorage { @@ -41,8 +35,7 @@ public class WebStorage { * Encapsulates a callback function which is used to provide a new quota * for a JavaScript storage API. * See - * {@link WebChromeClient#onExceededDatabaseQuota} and - * {@link WebChromeClient#onReachedMaxAppCacheSize}. + * {@link WebChromeClient#onExceededDatabaseQuota}. * @deprecated This class is obsolete and no longer used. */ @Deprecated @@ -123,9 +116,9 @@ public class WebStorage { */ /** - * Gets the origins currently using either the Application Cache or Web SQL - * Database APIs. This method operates asynchronously, with the result - * being provided via a {@link ValueCallback}. The origins are provided as + * Gets the origins currently using the Web SQL Database APIs. This method + * operates asynchronously, with the result being provided via a + * {@link ValueCallback}. The origins are provided as * a map, of type {@code Map<String, WebStorage.Origin>}, from the string * representation of the origin to a {@link WebStorage.Origin} object. */ @@ -134,9 +127,9 @@ public class WebStorage { } /** - * Gets the amount of storage currently being used by both the Application - * Cache and Web SQL Database APIs by the given origin. The amount is given - * in bytes and the origin is specified using its string representation. + * Gets the amount of storage currently being used by the Web SQL Database + * APIs by the given origin. The amount is given in bytes and the origin + * is specified using its string representation. * This method operates asynchronously, with the result being provided via * a {@link ValueCallback}. */ @@ -148,8 +141,7 @@ public class WebStorage { * Gets the storage quota for the Web SQL Database API for the given origin. * The quota is given in bytes and the origin is specified using its string * representation. This method operates asynchronously, with the result - * being provided via a {@link ValueCallback}. Note that a quota is not - * enforced on a per-origin basis for the Application Cache API. + * being provided via a {@link ValueCallback}. */ public void getQuotaForOrigin(String origin, ValueCallback<Long> callback) { // Must be a no-op for backward compatibility: see the hidden constructor for reason. @@ -158,8 +150,7 @@ public class WebStorage { /** * Sets the storage quota for the Web SQL Database API for the given origin. * The quota is specified in bytes and the origin is specified using its string - * representation. Note that a quota is not enforced on a per-origin basis - * for the Application Cache API. + * representation. * @deprecated Controlling quota per-origin will not be supported in future. */ @Deprecated @@ -168,9 +159,8 @@ public class WebStorage { } /** - * Clears the storage currently being used by both the Application Cache and - * Web SQL Database APIs by the given origin. The origin is specified using - * its string representation. + * Clears the storage currently being used by the Web SQL Database APIs by + * the given origin. The origin is specified using its string representation. */ public void deleteOrigin(String origin) { // Must be a no-op for backward compatibility: see the hidden constructor for reason. @@ -178,8 +168,7 @@ public class WebStorage { /** * Clears all storage currently being used by the JavaScript storage APIs. - * This includes the Application Cache, Web SQL Database and the HTML5 Web - * Storage APIs. + * This includes Web SQL Database and the HTML5 Web Storage APIs. */ public void deleteAllData() { // Must be a no-op for backward compatibility: see the hidden constructor for reason. |
