This is in preparation for a patch which with bigger changes for
WebViewLibraryLoader (including tests).
Bug: 28736099
Test: ensure relro loaded into app process on 32-bit device.
Change-Id: Ic1aef697c1010380d8bce466ee14627d9cdff9e7
There's no need to send both 32-bit and 64-bit paths to the native side
of the relro-creation/loading logic, we can check which one to send on
the java side instead.
Bug: 28736099
Test: Load WebView app, ensure relro file is loaded into the app
process.
Change-Id: Ia3fb4b3ed686c3e70c26a384aae966bda179d225
There's no context available in the relro creator process, resulting in
a NPE and crash when it tries to see if WebView is supported. Skip the
check in this case, because we know it's supported if we ran the relro
creation process at all.
Change-Id: I95e9aad7407b8f73dddf8a8b685d41d2f500736a
Fixes: 67398770
Test: boot, make sure no crash dialog from "android"
Use the presence of FEATURE_WEBVIEW to determine whether a device is
intended to have a WebView implementation or not, instead of trying to
fall back to NullWebViewFactoryProvider after loading WebView fails.
This removes the need for nullwebview entirely, and eliminates a class
of possible bug where unexpected exceptions during loading cause the
fallback mechanism not to work reliably.
On devices which don't have the feature, don't start
WebViewUpdateService at all. Guard all the places which try to access
the service to return reasonable (empty/null) results when this is the
case, instead of throwing exceptions.
Change-Id: I839adaaf0abee28f4989e3fbc0c49c0732d0ec1c
Bug: 31849211
Fixes: 28529980
Test: on wear and non-wear, cts-tradefed run cts -m CtsWebkitTestCases
Javadocs need to start with "/**", not "/*". This can unexpectedly
trigger a presubmit failure if someone changes something else in these
methods.
This also fixes an import-order presubmit error.
Bug: 65553544
Test: make -j30 docs (no visible change)
Change-Id: I1bc8ef479e3dc9378e58904d0b317c4775117390
This adds @Nullable and @NonNull annotations where the docs previously
stated this. This change should be safe, since we already disallowed
null values for the @NonNull parameters via documentation.
I verified that documentation changes for APIs which previously did not
mention null-ness in @param or @return Javadocs (if the API already
mentioned it in these spots, then DroidDoc prefers the hand-written
description).
This also fixes various lint errors.
Bug: 65465498
Test: make update-api and manually verify docs
Change-Id: I4751508d0e72be8ddfc3d6b601db8c307c9df60e
The change to handling of the deprecated Apache HTTP library means that
the WebView implementation package might have a non-empty shared library
list. Make sure to fetch shared libraries when querying WebView
implementations, and take them into account when constructing both the
actual classpath to be used to precreate the classloader, and when
deciding what the cache key for the precreated classloader should be.
Change-Id: I5e1409358d935e1c9f325db434bc6d4ef8ead759
Fixes: 65574359
Test: launch anything that uses WebView
No change to logic, docs only.
This documents shouldInterceptRequest request behavior when Safe
Browsing is enabled, with recommendations for how this can be avoided
depending on the application's needs.
Bug: 65555402
Test: make docs (manually verify links all work)
Change-Id: I055254bfae3a06061402c519e8740ec4d9779e8f
Docs change only, no change to logic.
This removes closing "</p>" tags from WebView API docs, as per API
guidelines.
This also adds a trailing newline to a <pre> block for consistency.
Other than the modified <pre> block, this has no reader-visible change,
it merely complies with best practices from Android API guidelines.
Bug: 65381884
Test: make docs (and manually compare before/after for differences)
Change-Id: I2f911a43b88a8897d9d1b5c7945360580491883d
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
WebChromeClient#onShowFileChooser was incorrectly referred to as
"showFileChooser" in two locations. Now these locations use the correct
name and the spot using "<code>" has been fixed to use "{@link}".
This also fixes a grammar error in the docs.
Bug: 65213653
Test: make docs (and manually verify the link works)
Change-Id: I17ba8ac3f76371a8b8a12b998ce4c956b6237119
No change to logic, only docs changes.
The documentation for setSafeBrowsingWhitelist uses a table to describe
whitelist rules. However, this table was previously formatted
incorrectly (it uses <th> elements for each cell, when normal data cells
should use <td> according to Android API guidelines).
This fixes the table to conform to the guidelines, adjusts white space
for consistency, and removes an unnecessary <p> element.
Bug: 65173825
Test: make docs (and manually verify the table looks correct)
Change-Id: I5d7390a44613aaa3acb147a69f8e0ce741e817ed
This disallows WebView/Monochrome APKs targeting O or below to be chosen
as WebView providers.
Bug: 65080651
Test: Open WebView shell with webview from system image, no crash
Test: Install Monochrome compiled for O, it's not in the webview provider list
Change-Id: I79162cedaa801ce227ad4c2eb3cbea9c08704da8
Docs change only, no change in logic.
We do not support calling #addJavascriptInterface until after JavaScript
is enabled via WebSettings#setJavaScriptEnabled. Calling these methods
in the wrong order is undefined behavior (and we've seen that it's buggy
under certain conditions, e.g. if the DOM includes an <img> element).
This clarifies the point in the docs and code example.
Bug: 64899039
Test: make -j40 docs (everything looks good)
Change-Id: I8ef9eec7f038037e6b898286e4dad8a57ecad472
(cherry picked from commit aaef6827ca)
Docs change only, no change in logic.
We do not support calling #addJavascriptInterface until after JavaScript
is enabled via WebSettings#setJavaScriptEnabled. Calling these methods
in the wrong order is undefined behavior (and we've seen that it's buggy
under certain conditions, e.g. if the DOM includes an <img> element).
This clarifies the point in the docs and code example.
Bug: 64899039
Test: make -j40 docs (everything looks good)
Change-Id: I8ef9eec7f038037e6b898286e4dad8a57ecad472
This renames the method as follows:
* initSafeBrowsing -> startSafeBrowsing
This also updates documentation to fix javadoc references, and to
clarify that Safe Browsing checks are not guaranteed until after
startSafeBrowsing() invokes its callback.
This does not change the method name in WebViewFactoryProvider, because
changing this would break CTS tests (since the WebView APK implements
this under the old name).
This also removes shutdownSafeBrowsing, because we found there was no
good use for this (it's meaningless for AOSP, and we were recommended to
avoid calling the underlying GMSCore API for GoogleWebView). More
significantly, there's no good place for an application to call it from.
Bug: 64331900
Test: make update-api (docs are correct)
Change-Id: Idf2b9390306052f5c5dfb92909fca4cfeec74aef
We now fetch the *ForOMR1 class instead of *ForO, which enables
OMR1-specific code in the WebView APK.
Bug: 63687088
Test: N/A
Change-Id: Ia36a00cd26aff8b87d7aeae859c72cb2fb364d2c
This adds a dedicated API for fetching a URL for the Safe Browsing
reporting privacy policy.
This URL should be displayed by applications on custom Safe Browsing
interstitials.
Bug: 64077668
Test: make update-api (it compiles and javadocs look good)
Change-Id: I2873260edcaa924e68517c8679079e147b9995f4
Docs change only.
This fixes javadoc errors in SafeBrowsingResponse.java:
* Typo: capital "B" in "onSafeBrowsingHit"
* Add full package names
* Add parameter lists to all linked methods
Bug: 64077668
Test: make update-api and check javadocs manually
Change-Id: I5e7b0e59ba865619b252f7e9e431ffac6e1bab1f
This API was unused. We're removing this under recommendation from the
API council.
Bug: 62425491
Test: make -j40 update-api
Change-Id: If869305b46b2dd2c5c4ab269e3544d4e2156ddd7
No change in logic, only docs changes:
* Docs about Safe Browsing feature as a whole.
* Expand the docs for initSafeBrowsing/shutdownSafeBrowsing
Bug: 63660204
Bug: 62192626
Test: make update-api and manually check javadocs
Change-Id: I6526a0f1ce1327f6eff416c27ded89866587f173