Redirect developers to use the Support Library
versions of Fragments and Loaders to ensure that
they get consistent behavior across versions of
Android and all devices as well as access to
Lifecycle improvements.
Test: Confirmed APIs deprecated in current.txt
BUG: 68381801
Change-Id: I58ec599e557fc93c8547c45ba7c9ced96b0c8616
No change to logic, just docs updates.
It looks like our documentation for the Safe Browsing manifest tag was
poor. This clarifies that the manifest opt-in should go inside the
application tag.
This also updates the documentation for MetricsOptOut, since this has
the same requirement.
Bug: 69007974
Test: make docs (verify it looks better)
Change-Id: Ieb29932f1460e3aa25c486b47692b63c0b87f509
No change to logic.
This CL has miscellaneous docs changes for WebViewClient.java:
* Spelling
* Codify some terms ({@code } annotations)
* Linkify references to other methods
Test: make docs (all links work, things look better)
Change-Id: Ia748a258a29b467b9655c018b5783b5b22fad0eb
Now that we no longer pass the paths of the native WebView libraries to
the native loading code we can simplify the code for fetching the path
and the size of the native WebView library.
Also add automated tests (WebViewLoadingTests) for loading native
libraries from test APKs where the libraries are stored either on disk
or as uncompressed libraries in the APKs.
Bug: 28736099
Test: start WebView-app, and ensure that the relro file is loaded into
the app process. Do this for both 32-, and 64-bit apps. And both for a
WebView APK where the libraries are loaded onto disk, and an APK where
the libraries are loaded uncompressed from the APK.
Test: make WebViewLoadingTests && make tradefed-all && \
tradefed.sh run template/local_min --template:map test=WebViewLoadingTests
Change-Id: I219dd03aa93de8cf6e64e01f1d8abe38474f5790
This CL rewrites notes to use the 'note' CSS class, to help them stand
out. This isn't every instance of 'note', but it catches the handful
where I think there's a readability benefit to the new format.
This changes a few other non-public notes for the sake of consistency.
Change-Id: Icf62e34a719c79f74e74abdb55f1be42939c2f9e
Fixes: 68324591
Test: make -j40 docs (and manually verify it looks good)
No change to logic, documentation change only.
WebView requires an Activity Context in order to work properly (several
features depend on this).
This CL documents this in each WebView constructor by specifying
"Activity Context" for the Context param. This CL also adds a note in
WebView(Context) to explain the importance of an Activity Context.
Fixes: 67945912
Test: make -j40 docs (manually verify it looks good)
Change-Id: I6f84093f7ce39f6bd924fd6e27737f047348d8a4
Docs change only, no change to logic.
This replaces "iff" (if and only if) with "if". The former term is
unclear, and there's no real benefit to expanding to "if and only if."
Change-Id: I1ac26e24b816f784b6868c8860849d4118b33294
Fixes: 68133964
Test: make -j40 docs (manually verify the change looks good)
Now that we no longer pass the paths of the native WebView libraries to
the native loading code we can simplify the code for fetching the path
and the size of the native WebView library.
Also add automated tests (WebViewLoadingTests) for loading native
libraries from test APKs where the libraries are stored either on disk
or as uncompressed libraries in the APKs.
Bug: 28736099
Test: start WebView-app, and ensure that the relro file is loaded into
the app process. Do this for both 32-, and 64-bit apps. And both for a
WebView APK where the libraries are loaded onto disk, and an APK where
the libraries are loaded uncompressed from the APK.
Test: make WebViewLoadingTests && make tradefed-all && \
tradefed.sh run template/local_min --template:map test=WebViewLoadingTests
Change-Id: I00d9b7f0650fe440ebee971eed8482759c7cbc79
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