summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nate Fischer <ntfschr@google.com> 2017-09-05 12:37:49 -0700
committer Nate Fischer <ntfschr@google.com> 2017-09-05 13:37:37 -0700
commit0a6140d2173052b4fa753c9ea61f92814cbced6e (patch)
tree63408f25ea2a352dd8beb14cd6aad723048ad08e
parent55828dd06d63e75b1f98f2c7ed150dd7b7fec78a (diff)
WebView: wrap Java literals with {@code}
Docs change only. This wraps some Java literals (true, false, null) with {@code} blocks, as per Android API guidelines. This also addresses other presubmit errors: * fix lines that have become too long * fix broken import order and unused imports Bug: 65213517 Test: make docs (and manually verify things look better) Change-Id: Idc7fe28d40bea7bd1edcad539b75fa9c689b8d46
-rw-r--r--core/java/android/webkit/CacheManager.java22
-rw-r--r--core/java/android/webkit/ClientCertRequest.java4
-rw-r--r--core/java/android/webkit/CookieManager.java12
-rw-r--r--core/java/android/webkit/FindActionModeCallback.java4
-rw-r--r--core/java/android/webkit/MimeTypeMap.java18
-rw-r--r--core/java/android/webkit/RenderProcessGoneDetail.java2
-rw-r--r--core/java/android/webkit/SafeBrowsingResponse.java6
-rw-r--r--core/java/android/webkit/ServiceWorkerClient.java4
-rw-r--r--core/java/android/webkit/ServiceWorkerWebSettings.java5
-rw-r--r--core/java/android/webkit/TokenBindingService.java11
-rw-r--r--core/java/android/webkit/URLUtil.java40
-rw-r--r--core/java/android/webkit/UrlInterceptHandler.java9
-rw-r--r--core/java/android/webkit/UrlInterceptRegistry.java10
-rw-r--r--core/java/android/webkit/UserPackage.java2
-rw-r--r--core/java/android/webkit/WebBackForwardList.java2
-rw-r--r--core/java/android/webkit/WebChromeClient.java67
-rw-r--r--core/java/android/webkit/WebHistoryItem.java4
-rw-r--r--core/java/android/webkit/WebMessage.java2
-rw-r--r--core/java/android/webkit/WebResourceRequest.java7
-rw-r--r--core/java/android/webkit/WebSettings.java120
-rw-r--r--core/java/android/webkit/WebView.java100
-rw-r--r--core/java/android/webkit/WebViewClient.java44
-rw-r--r--core/java/android/webkit/WebViewDatabase.java4
-rw-r--r--core/java/android/webkit/WebViewDelegate.java8
-rw-r--r--core/java/android/webkit/WebViewFactory.java2
-rw-r--r--core/java/android/webkit/WebViewProvider.java7
-rw-r--r--core/java/android/webkit/WebViewZygote.java7
27 files changed, 264 insertions, 259 deletions
diff --git a/core/java/android/webkit/CacheManager.java b/core/java/android/webkit/CacheManager.java
index 45e6eb308788..b8394203c61f 100644
--- a/core/java/android/webkit/CacheManager.java
+++ b/core/java/android/webkit/CacheManager.java
@@ -230,7 +230,7 @@ public final class CacheManager {
* {@link CacheManager.CacheResult#getLocalPath CacheManager.CacheResult.getLocalPath()}.
*
* @return the base directory of the cache
- * @deprecated This method no longer has any effect and always returns null.
+ * @deprecated This method no longer has any effect and always returns {@code null}.
*/
@Deprecated
public static File getCacheFileBaseDir() {
@@ -240,8 +240,8 @@ public final class CacheManager {
/**
* Gets whether the HTTP cache is disabled.
*
- * @return true if the HTTP cache is disabled
- * @deprecated This method no longer has any effect and always returns false.
+ * @return {@code true} if the HTTP cache is disabled
+ * @deprecated This method no longer has any effect and always returns {@code false}.
*/
@Deprecated
public static boolean cacheDisabled() {
@@ -249,12 +249,12 @@ public final class CacheManager {
}
/**
- * Starts a cache transaction. Returns true if this is the only running
+ * Starts a cache transaction. Returns {@code true} if this is the only running
* transaction. Otherwise, this transaction is nested inside currently
- * running transactions and false is returned.
+ * running transactions and {@code false} is returned.
*
- * @return true if this is the only running transaction
- * @deprecated This method no longer has any effect and always returns false.
+ * @return {@code true} if this is the only running transaction
+ * @deprecated This method no longer has any effect and always returns {@code false}.
*/
@Deprecated
public static boolean startCacheTransaction() {
@@ -265,8 +265,8 @@ public final class CacheManager {
* Ends the innermost cache transaction and returns whether this was the
* only running transaction.
*
- * @return true if this was the only running transaction
- * @deprecated This method no longer has any effect and always returns false.
+ * @return {@code true} if this was the only running transaction
+ * @deprecated This method no longer has any effect and always returns {@code false}.
*/
@Deprecated
public static boolean endCacheTransaction() {
@@ -274,7 +274,7 @@ public final class CacheManager {
}
/**
- * Gets the cache entry for the specified URL, or null if none is found.
+ * Gets the cache entry for the specified URL, or {@code null} if none is found.
* If a non-null value is provided for the HTTP headers map, and the cache
* entry needs validation, appropriate headers will be added to the map.
* The input stream of the CacheEntry object should be closed by the caller
@@ -284,7 +284,7 @@ public final class CacheManager {
* @param headers a map from HTTP header name to value, to be populated
* for the returned cache entry
* @return the cache entry for the specified URL
- * @deprecated This method no longer has any effect and always returns null.
+ * @deprecated This method no longer has any effect and always returns {@code null}.
*/
@Deprecated
public static CacheResult getCacheFile(String url,
diff --git a/core/java/android/webkit/ClientCertRequest.java b/core/java/android/webkit/ClientCertRequest.java
index 4a7f5fdf1f66..de17534b959b 100644
--- a/core/java/android/webkit/ClientCertRequest.java
+++ b/core/java/android/webkit/ClientCertRequest.java
@@ -42,13 +42,13 @@ public abstract class ClientCertRequest {
public ClientCertRequest() { }
/**
- * Returns the acceptable types of asymmetric keys (can be null).
+ * Returns the acceptable types of asymmetric keys (can be {@code null}).
*/
public abstract String[] getKeyTypes();
/**
* Returns the acceptable certificate issuers for the certificate
- * matching the private key (can be null).
+ * matching the private key (can be {@code null}).
*/
public abstract Principal[] getPrincipals();
diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java
index 67289c28e7a1..89892930ea89 100644
--- a/core/java/android/webkit/CookieManager.java
+++ b/core/java/android/webkit/CookieManager.java
@@ -42,9 +42,9 @@ public abstract class CookieManager {
/**
* Sets whether the application's {@link WebView} instances should send and
* accept cookies.
- * By default this is set to true and the WebView accepts cookies.
+ * By default this is set to {@code true} and the WebView accepts cookies.
* <p>
- * When this is true
+ * When this is {@code true}
* {@link CookieManager#setAcceptThirdPartyCookies setAcceptThirdPartyCookies} and
* {@link CookieManager#setAcceptFileSchemeCookies setAcceptFileSchemeCookies}
* can be used to control the policy for those specific types of cookie.
@@ -58,7 +58,7 @@ public abstract class CookieManager {
* Gets whether the application's {@link WebView} instances send and accept
* cookies.
*
- * @return true if {@link WebView} instances send and accept cookies
+ * @return {@code true} if {@link WebView} instances send and accept cookies
*/
public abstract boolean acceptCookie();
@@ -82,7 +82,7 @@ public abstract class CookieManager {
* Gets whether the {@link WebView} should allow third party cookies to be set.
*
* @param webview the {@link WebView} instance to get the cookie policy for
- * @return true if the {@link WebView} accepts third party cookies
+ * @return {@code true} if the {@link WebView} accepts third party cookies
*/
public abstract boolean acceptThirdPartyCookies(WebView webview);
@@ -202,7 +202,7 @@ public abstract class CookieManager {
/**
* Gets whether there are stored cookies.
*
- * @return true if there are stored cookies
+ * @return {@code true} if there are stored cookies
*/
public abstract boolean hasCookies();
@@ -233,7 +233,7 @@ public abstract class CookieManager {
* Gets whether the application's {@link WebView} instances send and accept
* cookies for file scheme URLs.
*
- * @return true if {@link WebView} instances send and accept cookies for
+ * @return {@code true} if {@link WebView} instances send and accept cookies for
* file scheme URLs
*/
// Static for backward compatibility.
diff --git a/core/java/android/webkit/FindActionModeCallback.java b/core/java/android/webkit/FindActionModeCallback.java
index f31389350519..71f85d70e30d 100644
--- a/core/java/android/webkit/FindActionModeCallback.java
+++ b/core/java/android/webkit/FindActionModeCallback.java
@@ -109,8 +109,8 @@ public class FindActionModeCallback implements ActionMode.Callback, TextWatcher,
/*
* Move the highlight to the next match.
- * @param next If true, find the next match further down in the document.
- * If false, find the previous match, up in the document.
+ * @param next If {@code true}, find the next match further down in the document.
+ * If {@code false}, find the previous match, up in the document.
*/
private void findNext(boolean next) {
if (mWebView == null) {
diff --git a/core/java/android/webkit/MimeTypeMap.java b/core/java/android/webkit/MimeTypeMap.java
index da8901a0e633..e172c02e2466 100644
--- a/core/java/android/webkit/MimeTypeMap.java
+++ b/core/java/android/webkit/MimeTypeMap.java
@@ -17,9 +17,11 @@
package android.webkit;
import android.text.TextUtils;
-import java.util.regex.Pattern;
+
import libcore.net.MimeUtils;
+import java.util.regex.Pattern;
+
/**
* Two-way map that maps MIME-types to file extensions and vice versa.
*
@@ -71,9 +73,9 @@ public class MimeTypeMap {
}
/**
- * Return true if the given MIME type has an entry in the map.
+ * Return {@code true} if the given MIME type has an entry in the map.
* @param mimeType A MIME type (i.e. text/plain)
- * @return True iff there is a mimeType entry in the map.
+ * @return {@code true} iff there is a mimeType entry in the map.
*/
public boolean hasMimeType(String mimeType) {
return MimeUtils.hasMimeType(mimeType);
@@ -82,7 +84,7 @@ public class MimeTypeMap {
/**
* Return the MIME type for the given extension.
* @param extension A file extension without the leading '.'
- * @return The MIME type for the given extension or null iff there is none.
+ * @return The MIME type for the given extension or {@code null} iff there is none.
*/
public String getMimeTypeFromExtension(String extension) {
return MimeUtils.guessMimeTypeFromExtension(extension);
@@ -94,9 +96,9 @@ public class MimeTypeMap {
}
/**
- * Return true if the given extension has a registered MIME type.
+ * Return {@code true} if the given extension has a registered MIME type.
* @param extension A file extension without the leading '.'
- * @return True iff there is an extension entry in the map.
+ * @return {@code true} iff there is an extension entry in the map.
*/
public boolean hasExtension(String extension) {
return MimeUtils.hasExtension(extension);
@@ -107,14 +109,14 @@ public class MimeTypeMap {
* MIME types map to multiple extensions. This call will return the most
* common extension for the given MIME type.
* @param mimeType A MIME type (i.e. text/plain)
- * @return The extension for the given MIME type or null iff there is none.
+ * @return The extension for the given MIME type or {@code null} iff there is none.
*/
public String getExtensionFromMimeType(String mimeType) {
return MimeUtils.guessExtensionFromMimeType(mimeType);
}
/**
- * If the given MIME type is null, or one of the "generic" types (text/plain
+ * If the given MIME type is {@code null}, or one of the "generic" types (text/plain
* or application/octet-stream) map it to a type that Android can deal with.
* If the given type is not generic, return it unchanged.
*
diff --git a/core/java/android/webkit/RenderProcessGoneDetail.java b/core/java/android/webkit/RenderProcessGoneDetail.java
index 1c793993909d..0843e26ea19c 100644
--- a/core/java/android/webkit/RenderProcessGoneDetail.java
+++ b/core/java/android/webkit/RenderProcessGoneDetail.java
@@ -28,7 +28,7 @@ public abstract class RenderProcessGoneDetail {
* If the render process was killed, this is most likely caused by the
* system being low on memory.
*
- * @return True if render process crashed, otherwise it was killed by
+ * @return {@code true} if render process crashed, otherwise it was killed by
* system.
**/
public abstract boolean didCrash();
diff --git a/core/java/android/webkit/SafeBrowsingResponse.java b/core/java/android/webkit/SafeBrowsingResponse.java
index 0d0f1cce2dfc..4750dfb81108 100644
--- a/core/java/android/webkit/SafeBrowsingResponse.java
+++ b/core/java/android/webkit/SafeBrowsingResponse.java
@@ -32,21 +32,21 @@ public abstract class SafeBrowsingResponse {
/**
* Display the default interstitial.
*
- * @param allowReporting True if the interstitial should show a reporting checkbox.
+ * @param allowReporting {@code true} if the interstitial should show a reporting checkbox.
*/
public abstract void showInterstitial(boolean allowReporting);
/**
* Act as if the user clicked "visit this unsafe site."
*
- * @param report True to enable Safe Browsing reporting.
+ * @param report {@code true} to enable Safe Browsing reporting.
*/
public abstract void proceed(boolean report);
/**
* Act as if the user clicked "back to safety."
*
- * @param report True to enable Safe Browsing reporting.
+ * @param report {@code true} to enable Safe Browsing reporting.
*/
public abstract void backToSafety(boolean report);
}
diff --git a/core/java/android/webkit/ServiceWorkerClient.java b/core/java/android/webkit/ServiceWorkerClient.java
index 23340550def3..b4964fd2fea0 100644
--- a/core/java/android/webkit/ServiceWorkerClient.java
+++ b/core/java/android/webkit/ServiceWorkerClient.java
@@ -24,7 +24,7 @@ public class ServiceWorkerClient {
/**
* Notify the host application of a resource request and allow the
- * application to return the data. If the return value is null, the
+ * application to return the data. If the return value is {@code null}, the
* Service Worker will continue to load the resource as usual.
* Otherwise, the return response and data will be used.
* NOTE: This method is called on a thread other than the UI thread
@@ -33,7 +33,7 @@ public class ServiceWorkerClient {
*
* @param request Object containing the details of the request.
* @return A {@link android.webkit.WebResourceResponse} containing the
- * response information or null if the WebView should load the
+ * response information or {@code null} if the WebView should load the
* resource itself.
* @see WebViewClient#shouldInterceptRequest(WebView, WebResourceRequest)
*/
diff --git a/core/java/android/webkit/ServiceWorkerWebSettings.java b/core/java/android/webkit/ServiceWorkerWebSettings.java
index 92e9fbe29b55..25058da4cd92 100644
--- a/core/java/android/webkit/ServiceWorkerWebSettings.java
+++ b/core/java/android/webkit/ServiceWorkerWebSettings.java
@@ -76,14 +76,15 @@ public abstract class ServiceWorkerWebSettings {
* Sets whether Service Workers should not load resources from the network,
* see {@link WebSettings#setBlockNetworkLoads}.
*
- * @param flag true means block network loads by the Service Workers
+ * @param flag {@code true} means block network loads by the Service Workers
*/
public abstract void setBlockNetworkLoads(boolean flag);
/**
* Gets whether Service Workers are prohibited from loading any resources from the network.
*
- * @return true if the Service Workers are not allowed to load any resources from the network
+ * @return {@code true} if the Service Workers are not allowed to load any resources from the
+ * network
* @see #setBlockNetworkLoads
*/
public abstract boolean getBlockNetworkLoads();
diff --git a/core/java/android/webkit/TokenBindingService.java b/core/java/android/webkit/TokenBindingService.java
index f7caac7d5254..43565c23355d 100644
--- a/core/java/android/webkit/TokenBindingService.java
+++ b/core/java/android/webkit/TokenBindingService.java
@@ -20,7 +20,6 @@ import android.annotation.SystemApi;
import android.net.Uri;
import java.security.KeyPair;
-import java.security.spec.AlgorithmParameterSpec;
/**
* Enables the token binding procotol, and provides access to the keys. See
@@ -82,13 +81,13 @@ public abstract class TokenBindingService {
* If no key pair exists, WebView chooses an algorithm from the list, in
* the order given, to generate a key.
*
- * The user can pass a null if any algorithm is acceptable.
+ * The user can pass {@code null} if any algorithm is acceptable.
*
* @param origin The origin for the server.
- * @param algorithm The list of algorithms. Can be null. An
+ * @param algorithm The list of algorithms. Can be {@code null}. An
* IllegalArgumentException is thrown if array is empty.
* @param callback The callback that will be called when key is available.
- * Cannot be null.
+ * Cannot be {@code null}.
*/
public abstract void getKey(Uri origin,
String[] algorithm,
@@ -99,7 +98,7 @@ public abstract class TokenBindingService {
* @param origin The origin of the server.
* @param callback The callback that will be called when key is deleted. The
* callback parameter (Boolean) will indicate if operation is
- * successful or if failed. The callback can be null.
+ * successful or if failed. The callback can be {@code null}.
*/
public abstract void deleteKey(Uri origin,
ValueCallback<Boolean> callback);
@@ -109,7 +108,7 @@ public abstract class TokenBindingService {
*
* @param callback The callback that will be called when keys are deleted.
* The callback parameter (Boolean) will indicate if operation is
- * successful or if failed. The callback can be null.
+ * successful or if failed. The callback can be {@code null}.
*/
public abstract void deleteAllKeys(ValueCallback<Boolean> callback);
}
diff --git a/core/java/android/webkit/URLUtil.java b/core/java/android/webkit/URLUtil.java
index f5233b611dce..c8bfb77992f1 100644
--- a/core/java/android/webkit/URLUtil.java
+++ b/core/java/android/webkit/URLUtil.java
@@ -16,16 +16,16 @@
package android.webkit;
+import android.net.ParseException;
+import android.net.Uri;
+import android.net.WebAddress;
+import android.util.Log;
+
import java.io.UnsupportedEncodingException;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import android.net.Uri;
-import android.net.ParseException;
-import android.net.WebAddress;
-import android.util.Log;
-
public final class URLUtil {
private static final String LOGTAG = "webkit";
@@ -136,7 +136,7 @@ public final class URLUtil {
}
/**
- * @return True iff the url is correctly URL encoded
+ * @return {@code true} iff the url is correctly URL encoded
*/
static boolean verifyURLEncoding(String url) {
int count = url.length();
@@ -170,14 +170,14 @@ public final class URLUtil {
}
/**
- * @return True iff the url is an asset file.
+ * @return {@code true} iff the url is an asset file.
*/
public static boolean isAssetUrl(String url) {
return (null != url) && url.startsWith(ASSET_BASE);
}
/**
- * @return True iff the url is a resource file.
+ * @return {@code true} iff the url is a resource file.
* @hide
*/
public static boolean isResourceUrl(String url) {
@@ -185,7 +185,7 @@ public final class URLUtil {
}
/**
- * @return True iff the url is a proxy url to allow cookieless network
+ * @return {@code true} iff the url is a proxy url to allow cookieless network
* requests from a file url.
* @deprecated Cookieless proxy is no longer supported.
*/
@@ -195,7 +195,7 @@ public final class URLUtil {
}
/**
- * @return True iff the url is a local file.
+ * @return {@code true} iff the url is a local file.
*/
public static boolean isFileUrl(String url) {
return (null != url) && (url.startsWith(FILE_BASE) &&
@@ -204,28 +204,28 @@ public final class URLUtil {
}
/**
- * @return True iff the url is an about: url.
+ * @return {@code true} iff the url is an about: url.
*/
public static boolean isAboutUrl(String url) {
return (null != url) && url.startsWith("about:");
}
/**
- * @return True iff the url is a data: url.
+ * @return {@code true} iff the url is a data: url.
*/
public static boolean isDataUrl(String url) {
return (null != url) && url.startsWith("data:");
}
/**
- * @return True iff the url is a javascript: url.
+ * @return {@code true} iff the url is a javascript: url.
*/
public static boolean isJavaScriptUrl(String url) {
return (null != url) && url.startsWith("javascript:");
}
/**
- * @return True iff the url is an http: url.
+ * @return {@code true} iff the url is an http: url.
*/
public static boolean isHttpUrl(String url) {
return (null != url) &&
@@ -234,7 +234,7 @@ public final class URLUtil {
}
/**
- * @return True iff the url is an https: url.
+ * @return {@code true} iff the url is an https: url.
*/
public static boolean isHttpsUrl(String url) {
return (null != url) &&
@@ -243,7 +243,7 @@ public final class URLUtil {
}
/**
- * @return True iff the url is a network url.
+ * @return {@code true} iff the url is a network url.
*/
public static boolean isNetworkUrl(String url) {
if (url == null || url.length() == 0) {
@@ -253,14 +253,14 @@ public final class URLUtil {
}
/**
- * @return True iff the url is a content: url.
+ * @return {@code true} iff the url is a content: url.
*/
public static boolean isContentUrl(String url) {
return (null != url) && url.startsWith(CONTENT_BASE);
}
/**
- * @return True iff the url is valid.
+ * @return {@code true} iff the url is valid.
*/
public static boolean isValidUrl(String url) {
if (url == null || url.length() == 0) {
@@ -293,8 +293,8 @@ public final class URLUtil {
* the URL and contentDisposition. File extension, if not defined,
* is added based on the mimetype
* @param url Url to the content
- * @param contentDisposition Content-Disposition HTTP header or null
- * @param mimeType Mime-type of the content or null
+ * @param contentDisposition Content-Disposition HTTP header or {@code null}
+ * @param mimeType Mime-type of the content or {@code null}
*
* @return suggested filename
*/
diff --git a/core/java/android/webkit/UrlInterceptHandler.java b/core/java/android/webkit/UrlInterceptHandler.java
index 59fc0cba1fd3..aa5c6dc76753 100644
--- a/core/java/android/webkit/UrlInterceptHandler.java
+++ b/core/java/android/webkit/UrlInterceptHandler.java
@@ -18,6 +18,7 @@ package android.webkit;
import android.webkit.CacheManager.CacheResult;
import android.webkit.PluginData;
+
import java.util.Map;
/**
@@ -30,11 +31,11 @@ public interface UrlInterceptHandler {
/**
* Given an URL, returns the CacheResult which contains the
- * surrogate response for the request, or null if the handler is
+ * surrogate response for the request, or {@code null} if the handler is
* not interested.
*
* @param url URL string.
- * @param headers The headers associated with the request. May be null.
+ * @param headers The headers associated with the request. May be {@code null}.
* @return The CacheResult containing the surrogate response.
*
* @hide
@@ -45,11 +46,11 @@ public interface UrlInterceptHandler {
/**
* Given an URL, returns the PluginData which contains the
- * surrogate response for the request, or null if the handler is
+ * surrogate response for the request, or {@code null} if the handler is
* not interested.
*
* @param url URL string.
- * @param headers The headers associated with the request. May be null.
+ * @param headers The headers associated with the request. May be {@code null}.
* @return The PluginData containing the surrogate response.
*
* @hide
diff --git a/core/java/android/webkit/UrlInterceptRegistry.java b/core/java/android/webkit/UrlInterceptRegistry.java
index bdf6747aa5a4..67af2ad015c7 100644
--- a/core/java/android/webkit/UrlInterceptRegistry.java
+++ b/core/java/android/webkit/UrlInterceptRegistry.java
@@ -47,7 +47,7 @@ public final class UrlInterceptRegistry {
/**
* set the flag to control whether url intercept is enabled or disabled
*
- * @param disabled true to disable the cache
+ * @param disabled {@code true} to disable the cache
*
* @hide
* @deprecated This class was intended to be used by Gears. Since Gears was
@@ -77,7 +77,7 @@ public final class UrlInterceptRegistry {
* before any that were previously registered.
*
* @param handler The new UrlInterceptHandler object
- * @return true if the handler was not previously registered.
+ * @return {@code true} if the handler was not previously registered.
*
* @hide
* @deprecated This class was intended to be used by Gears. Since Gears was
@@ -98,7 +98,7 @@ public final class UrlInterceptRegistry {
* Unregister a previously registered UrlInterceptHandler.
*
* @param handler A previously registered UrlInterceptHandler.
- * @return true if the handler was found and removed from the list.
+ * @return {@code true} if the handler was found and removed from the list.
*
* @hide
* @deprecated This class was intended to be used by Gears. Since Gears was
@@ -112,7 +112,7 @@ public final class UrlInterceptRegistry {
/**
* Given an url, returns the CacheResult of the first
- * UrlInterceptHandler interested, or null if none are.
+ * UrlInterceptHandler interested, or {@code null} if none are.
*
* @return A CacheResult containing surrogate content.
*
@@ -139,7 +139,7 @@ public final class UrlInterceptRegistry {
/**
* Given an url, returns the PluginData of the first
- * UrlInterceptHandler interested, or null if none are or if
+ * UrlInterceptHandler interested, or {@code null} if none are or if
* intercepts are disabled.
*
* @return A PluginData instance containing surrogate content.
diff --git a/core/java/android/webkit/UserPackage.java b/core/java/android/webkit/UserPackage.java
index 9da64559d0fe..4cf34618a0b1 100644
--- a/core/java/android/webkit/UserPackage.java
+++ b/core/java/android/webkit/UserPackage.java
@@ -69,7 +69,7 @@ public class UserPackage {
}
/**
- * Return true if the package is installed and not hidden
+ * Return {@code true} if the package is installed and not hidden
*/
public boolean isInstalledPackage() {
if (mPackageInfo == null) return false;
diff --git a/core/java/android/webkit/WebBackForwardList.java b/core/java/android/webkit/WebBackForwardList.java
index 6f763dcfc072..3349b06538d1 100644
--- a/core/java/android/webkit/WebBackForwardList.java
+++ b/core/java/android/webkit/WebBackForwardList.java
@@ -25,7 +25,7 @@ import java.io.Serializable;
*/
public abstract class WebBackForwardList implements Cloneable, Serializable {
/**
- * Return the current history item. This method returns null if the list is
+ * Return the current history item. This method returns {@code null} if the list is
* empty.
* @return The current history item.
*/
diff --git a/core/java/android/webkit/WebChromeClient.java b/core/java/android/webkit/WebChromeClient.java
index 81aa2f3a05fc..3444d49c05e5 100644
--- a/core/java/android/webkit/WebChromeClient.java
+++ b/core/java/android/webkit/WebChromeClient.java
@@ -52,7 +52,7 @@ public class WebChromeClient {
* Notify the host application of the url for an apple-touch-icon.
* @param view The WebView that initiated the callback.
* @param url The icon url.
- * @param precomposed True if the url is for a precomposed touch icon.
+ * @param precomposed {@code true} if the url is for a precomposed touch icon.
*/
public void onReceivedTouchIconUrl(WebView view, String url,
boolean precomposed) {}
@@ -106,17 +106,17 @@ public class WebChromeClient {
/**
* Request the host application to create a new window. If the host
- * application chooses to honor this request, it should return true from
+ * application chooses to honor this request, it should return {@code true} from
* this method, create a new WebView to host the window, insert it into the
* View system and send the supplied resultMsg message to its target with
* the new WebView as an argument. If the host application chooses not to
- * honor the request, it should return false from this method. The default
- * implementation of this method does nothing and hence returns false.
+ * honor the request, it should return {@code false} from this method. The default
+ * implementation of this method does nothing and hence returns {@code false}.
* @param view The WebView from which the request for a new window
* originated.
- * @param isDialog True if the new window should be a dialog, rather than
+ * @param isDialog {@code true} if the new window should be a dialog, rather than
* a full-size window.
- * @param isUserGesture True if the request was initiated by a user gesture,
+ * @param isUserGesture {@code true} if the request was initiated by a user gesture,
* such as the user clicking a link.
* @param resultMsg The message to send when once a new WebView has been
* created. resultMsg.obj is a
@@ -124,10 +124,10 @@ public class WebChromeClient {
* used to transport the new WebView, by calling
* {@link WebView.WebViewTransport#setWebView(WebView)
* WebView.WebViewTransport.setWebView(WebView)}.
- * @return This method should return true if the host application will
+ * @return This method should return {@code true} if the host application will
* create a new window, in which case resultMsg should be sent to
- * its target. Otherwise, this method should return false. Returning
- * false from this method but also sending resultMsg will result in
+ * its target. Otherwise, this method should return {@code false}. Returning
+ * {@code false} from this method but also sending resultMsg will result in
* undefined behavior.
*/
public boolean onCreateWindow(WebView view, boolean isDialog,
@@ -154,8 +154,8 @@ public class WebChromeClient {
/**
* Tell the client to display a javascript alert dialog. If the client
- * returns true, WebView will assume that the client will handle the
- * dialog. If the client returns false, it will continue execution.
+ * returns {@code true}, WebView will assume that the client will handle the
+ * dialog. If the client returns {@code false}, it will continue execution.
* @param view The WebView that initiated the callback.
* @param url The url of the page requesting the dialog.
* @param message Message to be displayed in the window.
@@ -169,10 +169,10 @@ public class WebChromeClient {
/**
* Tell the client to display a confirm dialog to the user. If the client
- * returns true, WebView will assume that the client will handle the
+ * returns {@code true}, WebView will assume that the client will handle the
* confirm dialog and call the appropriate JsResult method. If the
- * client returns false, a default value of false will be returned to
- * javascript. The default behavior is to return false.
+ * client returns false, a default value of {@code false} will be returned to
+ * javascript. The default behavior is to return {@code false}.
* @param view The WebView that initiated the callback.
* @param url The url of the page requesting the dialog.
* @param message Message to be displayed in the window.
@@ -187,10 +187,10 @@ public class WebChromeClient {
/**
* Tell the client to display a prompt dialog to the user. If the client
- * returns true, WebView will assume that the client will handle the
+ * returns {@code true}, WebView will assume that the client will handle the
* prompt dialog and call the appropriate JsPromptResult method. If the
- * client returns false, a default value of false will be returned to to
- * javascript. The default behavior is to return false.
+ * client returns false, a default value of {@code false} will be returned to to
+ * javascript. The default behavior is to return {@code false}.
* @param view The WebView that initiated the callback.
* @param url The url of the page requesting the dialog.
* @param message Message to be displayed in the window.
@@ -207,12 +207,12 @@ public class WebChromeClient {
/**
* Tell the client to display a dialog to confirm navigation away from the
* current page. This is the result of the onbeforeunload javascript event.
- * If the client returns true, WebView will assume that the client will
+ * If the client returns {@code true}, WebView will assume that the client will
* handle the confirm dialog and call the appropriate JsResult method. If
- * the client returns false, a default value of true will be returned to
+ * the client returns {@code false}, a default value of {@code true} will be returned to
* javascript to accept navigation away from the current page. The default
- * behavior is to return false. Setting the JsResult to true will navigate
- * away from the current page, false will cancel the navigation.
+ * behavior is to return {@code false}. Setting the JsResult to {@code true} will navigate
+ * away from the current page, {@code false} will cancel the navigation.
* @param view The WebView that initiated the callback.
* @param url The url of the page requesting the dialog.
* @param message Message to be displayed in the window.
@@ -332,8 +332,8 @@ public class WebChromeClient {
/**
* Tell the client that a JavaScript execution timeout has occured. And the
* client may decide whether or not to interrupt the execution. If the
- * client returns true, the JavaScript will be interrupted. If the client
- * returns false, the execution will continue. Note that in the case of
+ * client returns {@code true}, the JavaScript will be interrupted. If the client
+ * returns {@code false}, the execution will continue. Note that in the case of
* continuing execution, the timeout counter will be reset, and the callback
* will continue to occur if the script does not finish at the next check
* point.
@@ -365,7 +365,7 @@ public class WebChromeClient {
* Report a JavaScript console message to the host application. The ChromeClient
* should override this to process the log message as they see fit.
* @param consoleMessage Object containing details of the console message.
- * @return true if the message is handled by the client.
+ * @return {@code true} if the message is handled by the client.
*/
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
// Call the old version of this function for backwards compatability.
@@ -380,7 +380,7 @@ public class WebChromeClient {
* HTML. If the attribute is absent, then a default poster will be used. This
* method allows the ChromeClient to provide that default image.
*
- * @return Bitmap The image to use as a default poster, or null if no such image is
+ * @return Bitmap The image to use as a default poster, or {@code null} if no such image is
* available.
*/
public Bitmap getDefaultVideoPoster() {
@@ -409,15 +409,16 @@ public class WebChromeClient {
* This is called to handle HTML forms with 'file' input type, in response to the
* user pressing the "Select File" button.
* To cancel the request, call <code>filePathCallback.onReceiveValue(null)</code> and
- * return true.
+ * return {@code true}.
*
* @param webView The WebView instance that is initiating the request.
* @param filePathCallback Invoke this callback to supply the list of paths to files to upload,
- * or NULL to cancel. Must only be called if the
- * {@link #onShowFileChooser} implementation returns true.
+ * or {@code null} to cancel. Must only be called if the
+ * {@link #onShowFileChooser} implementation returns {@code true}.
* @param fileChooserParams Describes the mode of file chooser to be opened, and options to be
* used with it.
- * @return true if filePathCallback will be invoked, false to use default handling.
+ * @return {@code true} if filePathCallback will be invoked, {@code false} to use default
+ * handling.
*
* @see FileChooserParams
*/
@@ -448,7 +449,7 @@ public class WebChromeClient {
*
* @param resultCode the integer result code returned by the file picker activity.
* @param data the intent returned by the file picker activity.
- * @return the Uris of selected file(s) or null if the resultCode indicates
+ * @return the Uris of selected file(s) or {@code null} if the resultCode indicates
* activity canceled or any other error.
*/
public static Uri[] parseResult(int resultCode, Intent data) {
@@ -469,20 +470,20 @@ public class WebChromeClient {
/**
* Returns preference for a live media captured value (e.g. Camera, Microphone).
- * True indicates capture is enabled, false disabled.
+ * True indicates capture is enabled, {@code false} disabled.
*
* Use <code>getAcceptTypes</code> to determine suitable capture devices.
*/
public abstract boolean isCaptureEnabled();
/**
- * Returns the title to use for this file selector, or null. If null a default
+ * Returns the title to use for this file selector, or null. If {@code null} a default
* title should be used.
*/
public abstract CharSequence getTitle();
/**
- * The file name of a default selection if specified, or null.
+ * The file name of a default selection if specified, or {@code null}.
*/
public abstract String getFilenameHint();
diff --git a/core/java/android/webkit/WebHistoryItem.java b/core/java/android/webkit/WebHistoryItem.java
index 569fccd565cc..1591833eee96 100644
--- a/core/java/android/webkit/WebHistoryItem.java
+++ b/core/java/android/webkit/WebHistoryItem.java
@@ -65,8 +65,8 @@ public abstract class WebHistoryItem implements Cloneable {
public abstract String getTitle();
/**
- * Return the favicon of this history item or null if no favicon was found.
- * @return A Bitmap containing the favicon for this history item or null.
+ * Return the favicon of this history item or {@code null} if no favicon was found.
+ * @return A Bitmap containing the favicon for this history item or {@code null}.
* Note: The VM ensures 32-bit atomic read/write operations so we don't have
* to synchronize this method.
*/
diff --git a/core/java/android/webkit/WebMessage.java b/core/java/android/webkit/WebMessage.java
index 7683a40d114a..7fe66dc84e10 100644
--- a/core/java/android/webkit/WebMessage.java
+++ b/core/java/android/webkit/WebMessage.java
@@ -53,7 +53,7 @@ public class WebMessage {
}
/**
- * Returns the ports that are sent with the message, or null if no port
+ * Returns the ports that are sent with the message, or {@code null} if no port
* is sent.
*/
public WebMessagePort[] getPorts() {
diff --git a/core/java/android/webkit/WebResourceRequest.java b/core/java/android/webkit/WebResourceRequest.java
index ab935050eb73..964b6f8e259d 100644
--- a/core/java/android/webkit/WebResourceRequest.java
+++ b/core/java/android/webkit/WebResourceRequest.java
@@ -34,7 +34,7 @@ public interface WebResourceRequest {
/**
* Gets whether the request was made for the main frame.
*
- * @return whether the request was made for the main frame. Will be false for iframes,
+ * @return whether the request was made for the main frame. Will be {@code false} for iframes,
* for example.
*/
boolean isForMainFrame();
@@ -48,8 +48,9 @@ public interface WebResourceRequest {
/**
* Gets whether a gesture (such as a click) was associated with the request.
- * For security reasons in certain situations this method may return false even though the
- * sequence of events which caused the request to be created was initiated by a user gesture.
+ * For security reasons in certain situations this method may return {@code false} even though
+ * the sequence of events which caused the request to be created was initiated by a user
+ * gesture.
*
* @return whether a gesture was associated with the request.
*/
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index 82cff7c13e47..36a00ab40e46 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -217,7 +217,7 @@ public abstract class WebSettings {
/**
* Enables dumping the pages navigation cache to a text file. The default
- * is false.
+ * is {@code false}.
*
* @deprecated This method is now obsolete.
* @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
@@ -243,7 +243,7 @@ public abstract class WebSettings {
* controls and gestures. The particular zoom mechanisms that should be used
* can be set with {@link #setBuiltInZoomControls}. This setting does not
* affect zooming performed using the {@link WebView#zoomIn()} and
- * {@link WebView#zoomOut()} methods. The default is true.
+ * {@link WebView#zoomOut()} methods. The default is {@code true}.
*
* @param support whether the WebView should support zoom
*/
@@ -252,14 +252,14 @@ public abstract class WebSettings {
/**
* Gets whether the WebView supports zoom.
*
- * @return true if the WebView supports zoom
+ * @return {@code true} if the WebView supports zoom
* @see #setSupportZoom
*/
public abstract boolean supportZoom();
/**
* Sets whether the WebView requires a user gesture to play media.
- * The default is true.
+ * The default is {@code true}.
*
* @param require whether the WebView requires a user gesture to play media
*/
@@ -268,7 +268,7 @@ public abstract class WebSettings {
/**
* Gets whether the WebView requires a user gesture to play media.
*
- * @return true if the WebView requires a user gesture to play media
+ * @return {@code true} if the WebView requires a user gesture to play media
* @see #setMediaPlaybackRequiresUserGesture
*/
public abstract boolean getMediaPlaybackRequiresUserGesture();
@@ -278,7 +278,7 @@ public abstract class WebSettings {
* built-in zoom mechanisms comprise on-screen zoom controls, which are
* displayed over the WebView's content, and the use of a pinch gesture to
* control zooming. Whether or not these on-screen controls are displayed
- * can be set with {@link #setDisplayZoomControls}. The default is false.
+ * can be set with {@link #setDisplayZoomControls}. The default is {@code false}.
* <p>
* The built-in mechanisms are the only currently supported zoom
* mechanisms, so it is recommended that this setting is always enabled.
@@ -293,7 +293,7 @@ public abstract class WebSettings {
/**
* Gets whether the zoom mechanisms built into WebView are being used.
*
- * @return true if the zoom mechanisms built into WebView are being used
+ * @return {@code true} if the zoom mechanisms built into WebView are being used
* @see #setBuiltInZoomControls
*/
public abstract boolean getBuiltInZoomControls();
@@ -301,7 +301,7 @@ public abstract class WebSettings {
/**
* Sets whether the WebView should display on-screen zoom controls when
* using the built-in zoom mechanisms. See {@link #setBuiltInZoomControls}.
- * The default is true.
+ * The default is {@code true}.
*
* @param enabled whether the WebView should display on-screen zoom controls
*/
@@ -311,7 +311,7 @@ public abstract class WebSettings {
* Gets whether the WebView displays on-screen zoom controls when using
* the built-in zoom mechanisms.
*
- * @return true if the WebView displays on-screen zoom controls when using
+ * @return {@code true} if the WebView displays on-screen zoom controls when using
* the built-in zoom mechanisms
* @see #setDisplayZoomControls
*/
@@ -351,7 +351,7 @@ public abstract class WebSettings {
* zooms out the content to fit on screen by width. This setting is
* taken into account when the content width is greater than the width
* of the WebView control, for example, when {@link #getUseWideViewPort}
- * is enabled. The default is false.
+ * is enabled. The default is {@code false}.
*/
public abstract void setLoadWithOverviewMode(boolean overview);
@@ -366,9 +366,9 @@ public abstract class WebSettings {
/**
* Sets whether the WebView will enable smooth transition while panning or
* zooming or while the window hosting the WebView does not have focus.
- * If it is true, WebView will choose a solution to maximize the performance.
+ * If it is {@code true}, WebView will choose a solution to maximize the performance.
* e.g. the WebView's content may not be updated during the transition.
- * If it is false, WebView will keep its fidelity. The default value is false.
+ * If it is false, WebView will keep its fidelity. The default value is {@code false}.
*
* @deprecated This method is now obsolete, and will become a no-op in future.
*/
@@ -388,8 +388,8 @@ public abstract class WebSettings {
/**
* Sets whether the WebView uses its background for over scroll background.
- * If true, it will use the WebView's background. If false, it will use an
- * internal pattern. Default is true.
+ * If {@code true}, it will use the WebView's background. If {@code false}, it will use an
+ * internal pattern. Default is {@code true}.
*
* @deprecated This method is now obsolete.
* @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
@@ -433,7 +433,7 @@ public abstract class WebSettings {
public abstract boolean getSaveFormData();
/**
- * Sets whether the WebView should save passwords. The default is true.
+ * Sets whether the WebView should save passwords. The default is {@code true}.
* @deprecated Saving passwords in WebView will not be supported in future versions.
*/
@Deprecated
@@ -627,9 +627,9 @@ public abstract class WebSettings {
/**
* Sets whether the WebView should enable support for the &quot;viewport&quot;
* HTML meta tag or should use a wide viewport.
- * When the value of the setting is false, the layout width is always set to the
+ * When the value of the setting is {@code false}, the layout width is always set to the
* width of the WebView control in device-independent (CSS) pixels.
- * When the value is true and the page contains the viewport meta tag, the value
+ * When the value is {@code true} and the page contains the viewport meta tag, the value
* of the width specified in the tag is used. If the page does not contain the tag or
* does not provide a width, then a wide viewport will be used.
*
@@ -641,7 +641,7 @@ public abstract class WebSettings {
* Gets whether the WebView supports the &quot;viewport&quot;
* HTML meta tag or will use a wide viewport.
*
- * @return true if the WebView supports the viewport meta tag
+ * @return {@code true} if the WebView supports the viewport meta tag
* @see #setUseWideViewPort
*/
public abstract boolean getUseWideViewPort();
@@ -649,7 +649,7 @@ public abstract class WebSettings {
/**
* Sets whether the WebView whether supports multiple windows. If set to
* true, {@link WebChromeClient#onCreateWindow} must be implemented by the
- * host application. The default is false.
+ * host application. The default is {@code false}.
*
* @param support whether to suport multiple windows
*/
@@ -658,7 +658,7 @@ public abstract class WebSettings {
/**
* Gets whether the WebView supports multiple windows.
*
- * @return true if the WebView supports multiple windows
+ * @return {@code true} if the WebView supports multiple windows
* @see #setSupportMultipleWindows
*/
public abstract boolean supportMultipleWindows();
@@ -838,9 +838,9 @@ public abstract class WebSettings {
* controls loading of all images, including those embedded using the data
* URI scheme. Use {@link #setBlockNetworkImage} to control loading only
* of images specified using network URI schemes. Note that if the value of this
- * setting is changed from false to true, all images resources referenced
+ * setting is changed from {@code false} to {@code true}, all images resources referenced
* by content currently displayed by the WebView are loaded automatically.
- * The default is true.
+ * The default is {@code true}.
*
* @param flag whether the WebView should load image resources
*/
@@ -850,7 +850,7 @@ public abstract class WebSettings {
* Gets whether the WebView loads image resources. This includes
* images embedded using the data URI scheme.
*
- * @return true if the WebView loads image resources
+ * @return {@code true} if the WebView loads image resources
* @see #setLoadsImagesAutomatically
*/
public abstract boolean getLoadsImagesAutomatically();
@@ -859,12 +859,12 @@ public abstract class WebSettings {
* Sets whether the WebView should not load image resources from the
* network (resources accessed via http and https URI schemes). Note
* that this method has no effect unless
- * {@link #getLoadsImagesAutomatically} returns true. Also note that
+ * {@link #getLoadsImagesAutomatically} returns {@code true}. Also note that
* disabling all network loads using {@link #setBlockNetworkLoads}
* will also prevent network images from loading, even if this flag is set
- * to false. When the value of this setting is changed from true to false,
+ * to false. When the value of this setting is changed from {@code true} to {@code false},
* network images resources referenced by content currently displayed by
- * the WebView are fetched automatically. The default is false.
+ * the WebView are fetched automatically. The default is {@code false}.
*
* @param flag whether the WebView should not load image resources from the
* network
@@ -875,7 +875,7 @@ public abstract class WebSettings {
/**
* Gets whether the WebView does not load image resources from the network.
*
- * @return true if the WebView does not load image resources from the network
+ * @return {@code true} if the WebView does not load image resources from the network
* @see #setBlockNetworkImage
*/
public abstract boolean getBlockNetworkImage();
@@ -884,17 +884,17 @@ public abstract class WebSettings {
* Sets whether the WebView should not load resources from the network.
* Use {@link #setBlockNetworkImage} to only avoid loading
* image resources. Note that if the value of this setting is
- * changed from true to false, network resources referenced by content
+ * changed from {@code true} to {@code false}, network resources referenced by content
* currently displayed by the WebView are not fetched until
* {@link android.webkit.WebView#reload} is called.
* If the application does not have the
* {@link android.Manifest.permission#INTERNET} permission, attempts to set
- * a value of false will cause a {@link java.lang.SecurityException}
- * to be thrown. The default value is false if the application has the
+ * a value of {@code false} will cause a {@link java.lang.SecurityException}
+ * to be thrown. The default value is {@code false} if the application has the
* {@link android.Manifest.permission#INTERNET} permission, otherwise it is
- * true.
+ * {@code true}.
*
- * @param flag true means block network loads by the WebView
+ * @param flag {@code true} means block network loads by the WebView
* @see android.webkit.WebView#reload
*/
public abstract void setBlockNetworkLoads(boolean flag);
@@ -902,16 +902,16 @@ public abstract class WebSettings {
/**
* Gets whether the WebView does not load any resources from the network.
*
- * @return true if the WebView does not load any resources from the network
+ * @return {@code true} if the WebView does not load any resources from the network
* @see #setBlockNetworkLoads
*/
public abstract boolean getBlockNetworkLoads();
/**
* Tells the WebView to enable JavaScript execution.
- * <b>The default is false.</b>
+ * <b>The default is {@code false}.</b>
*
- * @param flag true if the WebView should execute JavaScript
+ * @param flag {@code true} if the WebView should execute JavaScript
*/
public abstract void setJavaScriptEnabled(boolean flag);
@@ -927,9 +927,9 @@ public abstract class WebSettings {
* on {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH} and earlier
* devices, you should explicitly set this value to {@code false}.
* <p>
- * The default value is true for API level
+ * The default value is {@code true} for API level
* {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1} and below,
- * and false for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
+ * and {@code false} for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
* and above.
*
* @param flag whether JavaScript running in the context of a file scheme
@@ -942,16 +942,16 @@ public abstract class WebSettings {
* should be allowed to access content from other file scheme URLs. To
* enable the most restrictive, and therefore secure policy, this setting
* should be disabled. Note that the value of this setting is ignored if
- * the value of {@link #getAllowUniversalAccessFromFileURLs} is true.
+ * the value of {@link #getAllowUniversalAccessFromFileURLs} is {@code true}.
* Note too, that this setting affects only JavaScript access to file scheme
* resources. Other access to such resources, for example, from image HTML
* elements, is unaffected. To prevent possible violation of same domain policy
* on {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH} and earlier
* devices, you should explicitly set this value to {@code false}.
* <p>
- * The default value is true for API level
+ * The default value is {@code true} for API level
* {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1} and below,
- * and false for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
+ * and {@code false} for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
* and above.
*
* @param flag whether JavaScript running in the context of a file scheme
@@ -961,9 +961,9 @@ public abstract class WebSettings {
public abstract void setAllowFileAccessFromFileURLs(boolean flag);
/**
- * Sets whether the WebView should enable plugins. The default is false.
+ * Sets whether the WebView should enable plugins. The default is {@code false}.
*
- * @param flag true if plugins should be enabled
+ * @param flag {@code true} if plugins should be enabled
* @deprecated This method has been deprecated in favor of
* {@link #setPluginState}
* @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}
@@ -1028,11 +1028,11 @@ public abstract class WebSettings {
/**
* Sets whether the Application Caches API should be enabled. The default
- * is false. Note that in order for the Application Caches API to be
+ * is {@code false}. Note that in order for the Application Caches API to be
* enabled, a valid database path must also be supplied to
* {@link #setAppCachePath}.
*
- * @param flag true if the WebView should enable Application Caches
+ * @param flag {@code true} if the WebView should enable Application Caches
*/
public abstract void setAppCacheEnabled(boolean flag);
@@ -1072,21 +1072,21 @@ public abstract class WebSettings {
* page load within a given process, as the WebView implementation may ignore
* changes to this setting after that point.
*
- * @param flag true if the WebView should use the database storage API
+ * @param flag {@code true} if the WebView should use the database storage API
*/
public abstract void setDatabaseEnabled(boolean flag);
/**
- * Sets whether the DOM storage API is enabled. The default value is false.
+ * Sets whether the DOM storage API is enabled. The default value is {@code false}.
*
- * @param flag true if the WebView should use the DOM storage API
+ * @param flag {@code true} if the WebView should use the DOM storage API
*/
public abstract void setDomStorageEnabled(boolean flag);
/**
* Gets whether the DOM Storage APIs are enabled.
*
- * @return true if the DOM Storage APIs are enabled
+ * @return {@code true} if the DOM Storage APIs are enabled
* @see #setDomStorageEnabled
*/
public abstract boolean getDomStorageEnabled();
@@ -1104,13 +1104,13 @@ public abstract class WebSettings {
/**
* Gets whether the database storage API is enabled.
*
- * @return true if the database storage API is enabled
+ * @return {@code true} if the database storage API is enabled
* @see #setDatabaseEnabled
*/
public abstract boolean getDatabaseEnabled();
/**
- * Sets whether Geolocation is enabled. The default is true.
+ * Sets whether Geolocation is enabled. The default is {@code true}.
* <p>
* Please note that in order for the Geolocation API to be usable
* by a page in the WebView, the following requirements must be met:
@@ -1132,7 +1132,7 @@ public abstract class WebSettings {
/**
* Gets whether JavaScript is enabled.
*
- * @return true if JavaScript is enabled
+ * @return {@code true} if JavaScript is enabled
* @see #setJavaScriptEnabled
*/
public abstract boolean getJavaScriptEnabled();
@@ -1161,7 +1161,7 @@ public abstract class WebSettings {
/**
* Gets whether plugins are enabled.
*
- * @return true if plugins are enabled
+ * @return {@code true} if plugins are enabled
* @see #setPluginsEnabled
* @deprecated This method has been replaced by {@link #getPluginState}
* @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2}
@@ -1197,16 +1197,16 @@ public abstract class WebSettings {
/**
* Tells JavaScript to open windows automatically. This applies to the
- * JavaScript function window.open(). The default is false.
+ * JavaScript function window.open(). The default is {@code false}.
*
- * @param flag true if JavaScript can open windows automatically
+ * @param flag {@code true} if JavaScript can open windows automatically
*/
public abstract void setJavaScriptCanOpenWindowsAutomatically(boolean flag);
/**
* Gets whether JavaScript can open windows automatically.
*
- * @return true if JavaScript can open windows automatically during
+ * @return {@code true} if JavaScript can open windows automatically during
* window.open()
* @see #setJavaScriptCanOpenWindowsAutomatically
*/
@@ -1229,7 +1229,7 @@ public abstract class WebSettings {
public abstract String getDefaultTextEncodingName();
/**
- * Sets the WebView's user-agent string. If the string is null or empty,
+ * Sets the WebView's user-agent string. If the string is {@code null} or empty,
* the system default value will be used.
*
* Note that starting from {@link android.os.Build.VERSION_CODES#KITKAT} Android
@@ -1262,7 +1262,7 @@ public abstract class WebSettings {
/**
* Tells the WebView whether it needs to set a node to have focus when
* {@link WebView#requestFocus(int, android.graphics.Rect)} is called. The
- * default value is true.
+ * default value is {@code true}.
*
* @param flag whether the WebView needs to set a node
*/
@@ -1355,7 +1355,7 @@ public abstract class WebSettings {
/**
* Gets whether a video overlay will be used for embedded encrypted video.
*
- * @return true if WebView uses a video overlay for embedded encrypted video.
+ * @return {@code true} if WebView uses a video overlay for embedded encrypted video.
* @see #setVideoOverlayForEmbeddedEncryptedVideoEnabled
* @hide
*/
@@ -1380,7 +1380,7 @@ public abstract class WebSettings {
/**
* Gets whether this WebView should raster tiles when it is
* offscreen but attached to a window.
- * @return true if this WebView will raster tiles when it is
+ * @return {@code true} if this WebView will raster tiles when it is
* offscreen but attached to a window.
*/
public abstract boolean getOffscreenPreRaster();
@@ -1408,7 +1408,7 @@ public abstract class WebSettings {
* Gets whether Safe browsing is enabled.
* See {@link #setSafeBrowsingEnabled}.
*
- * @return true if Safe browsing is enabled and false otherwise.
+ * @return {@code true} if Safe browsing is enabled and {@code false} otherwise.
*/
public abstract boolean getSafeBrowsingEnabled();
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index f918cadde87c..a930fa80e035 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -196,7 +196,7 @@ import java.util.Map;
* </p>
*
* <p>By default, requests by the HTML to open new windows are
- * ignored. This is true whether they be opened by JavaScript or by
+ * ignored. This is {@code true} whether they be opened by JavaScript or by
* the target attribute on a link. You can customize your
* {@link WebChromeClient} to provide your own behavior for opening multiple windows,
* and render them in whatever manner you want.</p>
@@ -405,7 +405,7 @@ public class WebView extends AbsoluteLayout
* may be notified multiple times while the
* operation is underway, and the numberOfMatches
* value should not be considered final unless
- * isDoneCounting is true.
+ * isDoneCounting is {@code true}.
*/
public void onFindResultReceived(int activeMatchOrdinal, int numberOfMatches,
boolean isDoneCounting);
@@ -439,7 +439,7 @@ public class WebView extends AbsoluteLayout
* @param view the WebView that owns the picture
* @param picture the new picture. Applications targeting
* {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR2} or above
- * will always receive a null Picture.
+ * will always receive a {@code null} Picture.
* @deprecated Deprecated due to internal changes.
*/
@Deprecated
@@ -529,7 +529,7 @@ public class WebView extends AbsoluteLayout
/**
* Gets additional type-dependant information about the result. See
- * {@link WebView#getHitTestResult()} for details. May either be null
+ * {@link WebView#getHitTestResult()} for details. May either be {@code null}
* or contain extra information about this result.
*
* @return additional type-dependant information about the result
@@ -664,7 +664,7 @@ public class WebView extends AbsoluteLayout
* Specifies whether the horizontal scrollbar has overlay style.
*
* @deprecated This method has no effect.
- * @param overlay true if horizontal scrollbar should have overlay style
+ * @param overlay {@code true} if horizontal scrollbar should have overlay style
*/
@Deprecated
public void setHorizontalScrollbarOverlay(boolean overlay) {
@@ -674,7 +674,7 @@ public class WebView extends AbsoluteLayout
* Specifies whether the vertical scrollbar has overlay style.
*
* @deprecated This method has no effect.
- * @param overlay true if vertical scrollbar should have overlay style
+ * @param overlay {@code true} if vertical scrollbar should have overlay style
*/
@Deprecated
public void setVerticalScrollbarOverlay(boolean overlay) {
@@ -684,7 +684,7 @@ public class WebView extends AbsoluteLayout
* Gets whether horizontal scrollbar has overlay style.
*
* @deprecated This method is now obsolete.
- * @return true
+ * @return {@code true}
*/
@Deprecated
public boolean overlayHorizontalScrollbar() {
@@ -696,7 +696,7 @@ public class WebView extends AbsoluteLayout
* Gets whether vertical scrollbar has overlay style.
*
* @deprecated This method is now obsolete.
- * @return false
+ * @return {@code false}
*/
@Deprecated
public boolean overlayVerticalScrollbar() {
@@ -717,7 +717,7 @@ public class WebView extends AbsoluteLayout
}
/**
- * Gets the SSL certificate for the main top-level page or null if there is
+ * Gets the SSL certificate for the main top-level page or {@code null} if there is
* no certificate (the site is not secure).
*
* @return the SSL certificate for the main top-level page
@@ -785,7 +785,7 @@ public class WebView extends AbsoluteLayout
* @param host the host to which the credentials apply
* @param realm the realm to which the credentials apply
* @return the credentials as a String array, if found. The first element
- * is the username and the second element is the password. Null if
+ * is the username and the second element is the password. {@code null} if
* no credentials are found.
* @deprecated Use {@link WebViewDatabase#getHttpAuthUsernamePassword} instead
*/
@@ -859,7 +859,7 @@ public class WebView extends AbsoluteLayout
*
* @param outState the Bundle to store this WebView's state
* @return the same copy of the back/forward list used to save the state. If
- * saveState fails, the returned list will be null.
+ * saveState fails, the returned list will be {@code null}.
*/
public WebBackForwardList saveState(Bundle outState) {
checkThread();
@@ -872,7 +872,7 @@ public class WebView extends AbsoluteLayout
* @param b a Bundle to store the display data
* @param dest the file to store the serialized picture data. Will be
* overwritten with this WebView's picture data.
- * @return true if the picture was successfully saved
+ * @return {@code true} if the picture was successfully saved
* @deprecated This method is now obsolete.
* @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
*/
@@ -889,7 +889,7 @@ public class WebView extends AbsoluteLayout
*
* @param b a Bundle containing the saved display data
* @param src the file where the picture data was stored
- * @return true if the picture was successfully restored
+ * @return {@code true} if the picture was successfully restored
* @deprecated This method is now obsolete.
* @hide Since API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1}
*/
@@ -909,7 +909,7 @@ public class WebView extends AbsoluteLayout
* display data for this WebView.
*
* @param inState the incoming Bundle of state
- * @return the restored back/forward list or null if restoreState failed
+ * @return the restored back/forward list or {@code null} if restoreState failed
*/
public WebBackForwardList restoreState(Bundle inState) {
checkThread();
@@ -977,7 +977,7 @@ public class WebView extends AbsoluteLayout
* The encoding parameter specifies whether the data is base64 or URL
* encoded. If the data is base64 encoded, the value of the encoding
* parameter must be 'base64'. For all other values of the parameter,
- * including null, it is assumed that the data uses ASCII encoding for
+ * including {@code null}, it is assumed that the data uses ASCII encoding for
* octets inside the range of safe URL characters and use the standard %xx
* hex encoding of URLs for octets outside that range. For example, '#',
* '%', '\', '?' should be replaced by %23, %25, %27, %3f respectively.
@@ -1018,13 +1018,13 @@ public class WebView extends AbsoluteLayout
* Note that the baseUrl is sent in the 'Referer' HTTP header when
* requesting subresources (images, etc.) of the page loaded using this method.
*
- * @param baseUrl the URL to use as the page's base URL. If null defaults to
+ * @param baseUrl the URL to use as the page's base URL. If {@code null} defaults to
* 'about:blank'.
* @param data a String of data in the given encoding
- * @param mimeType the MIMEType of the data, e.g. 'text/html'. If null,
+ * @param mimeType the MIMEType of the data, e.g. 'text/html'. If {@code null},
* defaults to 'text/html'.
* @param encoding the encoding of the data
- * @param historyUrl the URL to use as the history entry. If null defaults
+ * @param historyUrl the URL to use as the history entry. If {@code null} defaults
* to 'about:blank'. If non-null, this must be a valid URL.
*/
public void loadDataWithBaseURL(String baseUrl, String data,
@@ -1048,7 +1048,7 @@ public class WebView extends AbsoluteLayout
* @param script the JavaScript to execute.
* @param resultCallback A callback to be invoked when the script execution
* completes with the result of the execution (if any).
- * May be null if no notification of the result is required.
+ * May be {@code null} if no notification of the result is required.
*/
public void evaluateJavascript(String script, ValueCallback<String> resultCallback) {
checkThread();
@@ -1069,12 +1069,12 @@ public class WebView extends AbsoluteLayout
* Saves the current view as a web archive.
*
* @param basename the filename where the archive should be placed
- * @param autoname if false, takes basename to be a file. If true, basename
+ * @param autoname if {@code false}, takes basename to be a file. If {@code true}, basename
* is assumed to be a directory in which a filename will be
* chosen according to the URL of the current page.
* @param callback called after the web archive has been saved. The
* parameter for onReceiveValue will either be the filename
- * under which the file was saved, or null if saving the
+ * under which the file was saved, or {@code null} if saving the
* file failed.
*/
public void saveWebArchive(String basename, boolean autoname, ValueCallback<String> callback) {
@@ -1101,7 +1101,7 @@ public class WebView extends AbsoluteLayout
/**
* Gets whether this WebView has a back history item.
*
- * @return true iff this WebView has a back history item
+ * @return {@code true} iff this WebView has a back history item
*/
public boolean canGoBack() {
checkThread();
@@ -1119,7 +1119,7 @@ public class WebView extends AbsoluteLayout
/**
* Gets whether this WebView has a forward history item.
*
- * @return true iff this WebView has a forward history item
+ * @return {@code true} iff this WebView has a forward history item
*/
public boolean canGoForward() {
checkThread();
@@ -1170,8 +1170,8 @@ public class WebView extends AbsoluteLayout
/**
* Scrolls the contents of this WebView up by half the view size.
*
- * @param top true to jump to the top of the page
- * @return true if the page was scrolled
+ * @param top {@code true} to jump to the top of the page
+ * @return {@code true} if the page was scrolled
*/
public boolean pageUp(boolean top) {
checkThread();
@@ -1181,8 +1181,8 @@ public class WebView extends AbsoluteLayout
/**
* Scrolls the contents of this WebView down by half the page size.
*
- * @param bottom true to jump to bottom of page
- * @return true if the page was scrolled
+ * @param bottom {@code true} to jump to bottom of page
+ * @return {@code true} if the page was scrolled
*/
public boolean pageDown(boolean bottom) {
checkThread();
@@ -1339,7 +1339,7 @@ public class WebView extends AbsoluteLayout
* If the content fits into the WebView control by width, then
* the zoom is set to 100%. For wide content, the behavior
* depends on the state of {@link WebSettings#getLoadWithOverviewMode()}.
- * If its value is true, the content will be zoomed out to be fit
+ * If its value is {@code true}, the content will be zoomed out to be fit
* by width into the WebView control, otherwise not.
*
* If initial scale is greater than 0, WebView starts with this value
@@ -1389,7 +1389,7 @@ public class WebView extends AbsoluteLayout
/**
* Requests the anchor or image element URL at the last tapped point.
- * If hrefMsg is null, this method returns immediately and does not
+ * If hrefMsg is {@code null}, this method returns immediately and does not
* dispatch hrefMsg to its target. If the tapped point hits an image,
* an anchor, or an image in an anchor, the message associates
* strings in named keys in its data. The value paired with the key
@@ -1410,7 +1410,7 @@ public class WebView extends AbsoluteLayout
* to its target with a String representing the URL as its object.
*
* @param msg the message to be dispatched with the result of the request
- * as the data member with "url" as key. The result can be null.
+ * as the data member with "url" as key. The result can be {@code null}.
*/
public void requestImageRef(Message msg) {
checkThread();
@@ -1553,7 +1553,7 @@ public class WebView extends AbsoluteLayout
/**
* Gets whether this WebView is paused, meaning onPause() was called.
- * Calling onResume() sets the paused state back to false.
+ * Calling onResume() sets the paused state back to {@code false}.
*
* @hide
*/
@@ -1577,7 +1577,7 @@ public class WebView extends AbsoluteLayout
* Clears the resource cache. Note that the cache is per-application, so
* this will clear the cache for all WebViews used.
*
- * @param includeDiskFiles if false, only the RAM cache is cleared
+ * @param includeDiskFiles if {@code false}, only the RAM cache is cleared
*/
public void clearCache(boolean includeDiskFiles) {
checkThread();
@@ -1620,7 +1620,7 @@ public class WebView extends AbsoluteLayout
* shared by all the WebViews that are created by the embedder application.
*
* @param onCleared A runnable to be invoked when client certs are cleared.
- * The embedder can pass null if not interested in the
+ * The embedder can pass {@code null} if not interested in the
* callback. The runnable will be called in UI thread.
*/
public static void clearClientCertPreferences(Runnable onCleared) {
@@ -1665,9 +1665,9 @@ public class WebView extends AbsoluteLayout
* All other rules, including wildcards, are invalid.
*
* @param urls the list of URLs
- * @param callback will be called with true if URLs are successfully added to the whitelist.
- * It will be called with false if any URLs are malformed. The callback will be run on
- * the UI thread
+ * @param callback will be called with {@code true} if URLs are successfully added to the
+ * whitelist. It will be called with {@code false} if any URLs are malformed. The callback will
+ * be run on the UI thread
*/
public static void setSafeBrowsingWhitelist(@NonNull List<String> urls,
@Nullable ValueCallback<Boolean> callback) {
@@ -1761,9 +1761,9 @@ public class WebView extends AbsoluteLayout
* @param text if non-null, will be the initial text to search for.
* Otherwise, the last String searched for in this WebView will
* be used to start.
- * @param showIme if true, show the IME, assuming the user will begin typing.
- * If false and text is non-null, perform a find all.
- * @return true if the find dialog is shown, false otherwise
+ * @param showIme if {@code true}, show the IME, assuming the user will begin typing.
+ * If {@code false} and text is non-null, perform a find all.
+ * @return {@code true} if the find dialog is shown, {@code false} otherwise
* @deprecated This method does not work reliably on all Android versions;
* implementing a custom find dialog using WebView.findAllAsync()
* provides a more robust solution.
@@ -1794,7 +1794,7 @@ public class WebView extends AbsoluteLayout
* five digits.
*
* @param addr the string to search for addresses
- * @return the address, or if no address is found, null
+ * @return the address, or if no address is found, {@code null}
*/
public static String findAddress(String addr) {
// TODO: Rewrite this in Java so it is not needed to start up chromium
@@ -1893,7 +1893,7 @@ public class WebView extends AbsoluteLayout
/**
* Gets the chrome handler.
*
- * @return the WebChromeClient, or null if not yet set
+ * @return the WebChromeClient, or {@code null} if not yet set
* @see #setWebChromeClient
*/
public WebChromeClient getWebChromeClient() {
@@ -1963,7 +1963,7 @@ public class WebView extends AbsoluteLayout
* </ul>
*
* @param object the Java object to inject into this WebView's JavaScript
- * context. Null values are ignored.
+ * context. {@code null} values are ignored.
* @param name the name used to expose the object in JavaScript
*/
public void addJavascriptInterface(Object object, String name) {
@@ -2035,7 +2035,7 @@ public class WebView extends AbsoluteLayout
* code running inside WebViews. Please refer to WebView documentation
* for the debugging guide.
*
- * The default is false.
+ * The default is {@code false}.
*
* @param enabled whether to enable web contents debugging
*/
@@ -2105,7 +2105,7 @@ public class WebView extends AbsoluteLayout
}
/**
- * @deprecated Only the default case, true, will be supported in a future version.
+ * @deprecated Only the default case, {@code true}, will be supported in a future version.
*/
@Deprecated
public void setMapTrackballToArrowKeys(boolean setMap) {
@@ -2140,7 +2140,7 @@ public class WebView extends AbsoluteLayout
/**
* Gets whether this WebView can be zoomed in.
*
- * @return true if this WebView can be zoomed in
+ * @return {@code true} if this WebView can be zoomed in
*
* @deprecated This method is prone to inaccuracy due to race conditions
* between the web rendering and UI threads; prefer
@@ -2155,7 +2155,7 @@ public class WebView extends AbsoluteLayout
/**
* Gets whether this WebView can be zoomed out.
*
- * @return true if this WebView can be zoomed out
+ * @return {@code true} if this WebView can be zoomed out
*
* @deprecated This method is prone to inaccuracy due to race conditions
* between the web rendering and UI threads; prefer
@@ -2185,7 +2185,7 @@ public class WebView extends AbsoluteLayout
/**
* Performs zoom in in this WebView.
*
- * @return true if zoom in succeeds, false if no zoom changes
+ * @return {@code true} if zoom in succeeds, {@code false} if no zoom changes
*/
public boolean zoomIn() {
checkThread();
@@ -2195,7 +2195,7 @@ public class WebView extends AbsoluteLayout
/**
* Performs zoom out in this WebView.
*
- * @return true if zoom out succeeds, false if no zoom changes
+ * @return {@code true} if zoom out succeeds, {@code false} if no zoom changes
*/
public boolean zoomOut() {
checkThread();
@@ -2286,7 +2286,7 @@ public class WebView extends AbsoluteLayout
*
* @param rendererRequestedPriority the minimum priority at which
* this WebView desires the renderer process to be bound.
- * @param waivedWhenNotVisible if true, this flag specifies that
+ * @param waivedWhenNotVisible if {@code true}, this flag specifies that
* when this WebView is not visible, it will be treated as
* if it had requested a priority of
* {@link #RENDERER_PRIORITY_WAIVED}.
@@ -2988,7 +2988,7 @@ public class WebView extends AbsoluteLayout
* uninstalled. It can also be changed through a Developer Setting.
* If the WebView package changes, any app process that has loaded WebView will be killed. The
* next time the app starts and loads WebView it will use the new WebView package instead.
- * @return the current WebView package, or null if there is none.
+ * @return the current WebView package, or {@code null} if there is none.
*/
public static PackageInfo getCurrentWebViewPackage() {
PackageInfo webviewPackage = WebViewFactory.getLoadedPackageInfo();
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java
index e7e539c7f01c..b750adadbf5f 100644
--- a/core/java/android/webkit/WebViewClient.java
+++ b/core/java/android/webkit/WebViewClient.java
@@ -33,15 +33,15 @@ public class WebViewClient {
* Give the host application a chance to take over the control when a new
* url is about to be loaded in the current WebView. If WebViewClient is not
* provided, by default WebView will ask Activity Manager to choose the
- * proper handler for the url. If WebViewClient is provided, return true
- * means the host application handles the url, while return false means the
+ * proper handler for the url. If WebViewClient is provided, return {@code true}
+ * means the host application handles the url, while return {@code false} means the
* current WebView handles the url.
* This method is not called for requests using the POST "method".
*
* @param view The WebView that is initiating the callback.
* @param url The url to be loaded.
- * @return True if the host application wants to leave the current WebView
- * and handle the url itself, otherwise return false.
+ * @return {@code true} if the host application wants to leave the current WebView
+ * and handle the url itself, otherwise return {@code false}.
* @deprecated Use {@link #shouldOverrideUrlLoading(WebView, WebResourceRequest)
* shouldOverrideUrlLoading(WebView, WebResourceRequest)} instead.
*/
@@ -54,8 +54,8 @@ public class WebViewClient {
* Give the host application a chance to take over the control when a new
* url is about to be loaded in the current WebView. If WebViewClient is not
* provided, by default WebView will ask Activity Manager to choose the
- * proper handler for the url. If WebViewClient is provided, return true
- * means the host application handles the url, while return false means the
+ * proper handler for the url. If WebViewClient is provided, return {@code true}
+ * means the host application handles the url, while return {@code false} means the
* current WebView handles the url.
*
* <p>Notes:
@@ -63,15 +63,15 @@ public class WebViewClient {
* <li>This method is not called for requests using the POST &quot;method&quot;.</li>
* <li>This method is also called for subframes with non-http schemes, thus it is
* strongly disadvised to unconditionally call {@link WebView#loadUrl(String)}
- * with the request's url from inside the method and then return true,
+ * with the request's url from inside the method and then return {@code true},
* as this will make WebView to attempt loading a non-http url, and thus fail.</li>
* </ul>
* </p>
*
* @param view The WebView that is initiating the callback.
* @param request Object containing the details of the request.
- * @return True if the host application wants to leave the current WebView
- * and handle the url itself, otherwise return false.
+ * @return {@code true} if the host application wants to leave the current WebView
+ * and handle the url itself, otherwise return {@code false}.
*/
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
return shouldOverrideUrlLoading(view, request.getUrl().toString());
@@ -148,7 +148,7 @@ public class WebViewClient {
/**
* Notify the host application of a resource request and allow the
- * application to return the data. If the return value is null, the WebView
+ * application to return the data. If the return value is {@code null}, the WebView
* will continue to load the resource as usual. Otherwise, the return
* response and data will be used. NOTE: This method is called on a thread
* other than the UI thread so clients should exercise caution
@@ -158,7 +158,7 @@ public class WebViewClient {
* resource.
* @param url The raw url of the resource.
* @return A {@link android.webkit.WebResourceResponse} containing the
- * response information or null if the WebView should load the
+ * response information or {@code null} if the WebView should load the
* resource itself.
* @deprecated Use {@link #shouldInterceptRequest(WebView, WebResourceRequest)
* shouldInterceptRequest(WebView, WebResourceRequest)} instead.
@@ -171,7 +171,7 @@ public class WebViewClient {
/**
* Notify the host application of a resource request and allow the
- * application to return the data. If the return value is null, the WebView
+ * application to return the data. If the return value is {@code null}, the WebView
* will continue to load the resource as usual. Otherwise, the return
* response and data will be used. NOTE: This method is called on a thread
* other than the UI thread so clients should exercise caution
@@ -181,7 +181,7 @@ public class WebViewClient {
* resource.
* @param request Object containing the details of the request.
* @return A {@link android.webkit.WebResourceResponse} containing the
- * response information or null if the WebView should load the
+ * response information or {@code null} if the WebView should load the
* resource itself.
*/
public WebResourceResponse shouldInterceptRequest(WebView view,
@@ -326,7 +326,7 @@ public class WebViewClient {
*
* @param view The WebView that is initiating the callback.
* @param url The url being visited.
- * @param isReload True if this url is being reloaded.
+ * @param isReload {@code true} if this url is being reloaded.
*/
public void doUpdateVisitedHistory(WebView view, String url,
boolean isReload) {
@@ -406,14 +406,14 @@ public class WebViewClient {
/**
* Give the host application a chance to handle the key event synchronously.
* e.g. menu shortcut key events need to be filtered this way. If return
- * true, WebView will not handle the key event. If return false, WebView
+ * true, WebView will not handle the key event. If return {@code false}, WebView
* will always handle the key event, so none of the super in the view chain
- * will see the key event. The default behavior returns false.
+ * will see the key event. The default behavior returns {@code false}.
*
* @param view The WebView that is initiating the callback.
* @param event The key event.
- * @return True if the host application wants to handle the key event
- * itself, otherwise return false
+ * @return {@code true} if the host application wants to handle the key event
+ * itself, otherwise return {@code false}
*/
public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) {
return false;
@@ -422,7 +422,7 @@ public class WebViewClient {
/**
* Notify the host application that a key was not handled by the WebView.
* Except system keys, WebView always consumes the keys in the normal flow
- * or if shouldOverrideKeyEvent returns true. This is called asynchronously
+ * or if shouldOverrideKeyEvent returns {@code true}. This is called asynchronously
* from where the key is dispatched. It gives the host application a chance
* to handle the unhandled key events.
*
@@ -436,7 +436,7 @@ public class WebViewClient {
/**
* Notify the host application that a input event was not handled by the WebView.
* Except system keys, WebView always consumes input events in the normal flow
- * or if shouldOverrideKeyEvent returns true. This is called asynchronously
+ * or if shouldOverrideKeyEvent returns {@code true}. This is called asynchronously
* from where the event is dispatched. It gives the host application a chance
* to handle the unhandled input events.
*
@@ -483,7 +483,7 @@ public class WebViewClient {
* user has been processed.
* @param view The WebView requesting the login.
* @param realm The account realm used to look up accounts.
- * @param account An optional account. If not null, the account should be
+ * @param account An optional account. If not {@code null}, the account should be
* checked against accounts on the device. If it is a valid
* account, it should be used to log in the user.
* @param args Authenticator specific arguments used to log in the user.
@@ -512,7 +512,7 @@ public class WebViewClient {
*
* @param view The WebView which needs to be cleaned up.
* @param detail the reason why it exited.
- * @return true if the host application handled the situation that process has
+ * @return {@code true} if the host application handled the situation that process has
* exited, otherwise, application will crash if render process crashed,
* or be killed if render process was killed by the system.
*/
diff --git a/core/java/android/webkit/WebViewDatabase.java b/core/java/android/webkit/WebViewDatabase.java
index 982c57b76b51..de75d5d0feea 100644
--- a/core/java/android/webkit/WebViewDatabase.java
+++ b/core/java/android/webkit/WebViewDatabase.java
@@ -42,7 +42,7 @@ public abstract class WebViewDatabase {
* Gets whether there are any saved username/password pairs for web forms.
* Note that these are unrelated to HTTP authentication credentials.
*
- * @return true if there are any saved username/password pairs
+ * @return {@code true} if there are any saved username/password pairs
* @see WebView#savePassword
* @see #clearUsernamePassword
* @deprecated Saving passwords in WebView will not be supported in future versions.
@@ -129,7 +129,7 @@ public abstract class WebViewDatabase {
* @param host the host to which the credentials apply
* @param realm the realm to which the credentials apply
* @return the credentials as a String array, if found. The first element
- * is the username and the second element is the password. Null if
+ * is the username and the second element is the password. {@code null} if
* no credentials are found.
* @see #setHttpAuthUsernamePassword
* @see #hasHttpAuthUsernamePassword
diff --git a/core/java/android/webkit/WebViewDelegate.java b/core/java/android/webkit/WebViewDelegate.java
index 92d0d7141370..73399313cbb5 100644
--- a/core/java/android/webkit/WebViewDelegate.java
+++ b/core/java/android/webkit/WebViewDelegate.java
@@ -68,22 +68,22 @@ public final class WebViewDelegate {
}
/**
- * Returns true if the WebView trace tag is enabled and false otherwise.
+ * Returns {@code true} if the WebView trace tag is enabled and {@code false} otherwise.
*/
public boolean isTraceTagEnabled() {
return Trace.isTagEnabled(Trace.TRACE_TAG_WEBVIEW);
}
/**
- * Returns true if the draw GL functor can be invoked (see {@link #invokeDrawGlFunctor})
- * and false otherwise.
+ * Returns {@code true} if the draw GL functor can be invoked (see {@link #invokeDrawGlFunctor})
+ * and {@code false} otherwise.
*/
public boolean canInvokeDrawGlFunctor(View containerView) {
return true;
}
/**
- * Invokes the draw GL functor. If waitForCompletion is false the functor
+ * Invokes the draw GL functor. If waitForCompletion is {@code false} the functor
* may be invoked asynchronously.
*
* @param nativeDrawGLFunctor the pointer to the native functor that implements
diff --git a/core/java/android/webkit/WebViewFactory.java b/core/java/android/webkit/WebViewFactory.java
index 668cfba94071..7c4154f5c648 100644
--- a/core/java/android/webkit/WebViewFactory.java
+++ b/core/java/android/webkit/WebViewFactory.java
@@ -222,7 +222,7 @@ public final class WebViewFactory {
}
/**
- * Returns true if the signatures match, false otherwise
+ * Returns {@code true} if the signatures match, {@code false} otherwise
*/
private static boolean signaturesEquals(Signature[] s1, Signature[] s2) {
if (s1 == null) {
diff --git a/core/java/android/webkit/WebViewProvider.java b/core/java/android/webkit/WebViewProvider.java
index 820b49accb65..c46c681c3285 100644
--- a/core/java/android/webkit/WebViewProvider.java
+++ b/core/java/android/webkit/WebViewProvider.java
@@ -19,16 +19,16 @@ package android.webkit;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
-import android.content.res.Configuration;
import android.content.Intent;
+import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Picture;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
-import android.net.http.SslCertificate;
import android.net.Uri;
+import android.net.http.SslCertificate;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -73,7 +73,8 @@ public interface WebViewProvider {
* Initialize this WebViewProvider instance. Called after the WebView has fully constructed.
* @param javaScriptInterfaces is a Map of interface names, as keys, and
* object implementing those interfaces, as values.
- * @param privateBrowsing If true the web view will be initialized in private / incognito mode.
+ * @param privateBrowsing If {@code true} the web view will be initialized in private /
+ * incognito mode.
*/
public void init(Map<String, Object> javaScriptInterfaces,
boolean privateBrowsing);
diff --git a/core/java/android/webkit/WebViewZygote.java b/core/java/android/webkit/WebViewZygote.java
index 0204dff9bf9d..6e65c7a11d2f 100644
--- a/core/java/android/webkit/WebViewZygote.java
+++ b/core/java/android/webkit/WebViewZygote.java
@@ -28,7 +28,6 @@ import android.util.Log;
import com.android.internal.annotations.GuardedBy;
import java.io.File;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -48,8 +47,8 @@ public class WebViewZygote {
private static final Object sLock = new Object();
/**
- * Instance that maintains the socket connection to the zygote. This is null if the zygote
- * is not running or is not connected.
+ * Instance that maintains the socket connection to the zygote. This is {@code null} if the
+ * zygote is not running or is not connected.
*/
@GuardedBy("sLock")
private static ZygoteProcess sZygote;
@@ -75,7 +74,7 @@ public class WebViewZygote {
private static String sPackageCacheKey;
/**
- * Flag for whether multi-process WebView is enabled. If this is false, the zygote
+ * Flag for whether multi-process WebView is enabled. If this is {@code false}, the zygote
* will not be started.
*/
@GuardedBy("sLock")