Commit Graph

3852 Commits

Author SHA1 Message Date
Changwan Ryu
a9e2ed7bbd webkit: add a note regarding FLAG_SECURE for default dialogs
Child windows do not inherit FLAG_SECURE from parent windows, and
therefore, the default dialogs for JS callbacks do not have this flag
even when the app window has it.

This CL adds a note warning about this behavior to mitigate the
potential vulnerability.

Bug: 120086187
Test: m -j offline-sdk-docs seems not broken
Change-Id: I12f12befd1f303d26ebc866f4817f5184279caeb
2020-06-01 13:56:47 -07:00
Changwan Ryu
a56c69eae0 webkit: Update documentation for onJsBeforeUnload callback
Fix documentation to clearly indicate that the default behavior is to
show WebView's own default dialog, and also describe the default
behavior more clearly and how to customize it.

Bug: 154014645
Test: m -j offline-sdk-docs seems not broken
Change-Id: I7d1e10c5d406ed739fb3963b9099791cfce95063
2020-05-27 12:09:32 -07:00
TreeHugger Robot
a0b41154fe Merge "webkit: Update documentation for onJsConfirm, onJsPrompt callbacks" into rvc-dev 2020-05-20 05:44:33 +00:00
Changwan Ryu
dd4f03d419 webkit: Update documentation for onJsConfirm, onJsPrompt callbacks
Fix documentation to clearly indicate that the default behavior is to
show WebView's own default dialog, and also describing clearly default
dialog behavior and how to customize it.

Note that onJsBeforeUnload is not updated at the moment as I could not
find a way to reproduce it.

Bug: 154014645
Test: m -j offline-sdk-docs seems not broken

Change-Id: I5ee09ea35340eb8d17353eda1786dcebcff4a29e
2020-05-19 14:30:44 -07:00
Torne (Richard Coles)
fc23be81bd Update deprecation note for Application Cache.
Update the deprecation note for WebSettings.setAppCacheEnabled and
related to mention the public blog post about the feature being removed.

Fixes: 156409857
Test: m offline-sdk-docs
Change-Id: I0481937d665f3f16b61b921aa19e306ba8bb16e0
2020-05-18 13:40:40 -04:00
Changwan Ryu
31e2db92ce webkit: Update documentation for onJsAlert callback method
Fix documentation to clearly indicate that the default behavior is to
show WebView's own default dialog.

Also, change some wording to avoid confusion.

Bug: 154014645
Test: m -j offline-sdk-docs seems unbroken
Change-Id: I3f6676094e5472aa99bb014cf2b489f59133d094
2020-05-13 16:52:24 +00:00
Torne (Richard Coles)
76752c8f02 Deprecate WebSettings.setAppCacheEnabled and related.
Chrome will be removing the Application Cache API in future; deprecate
the APIs in WebView which allow Android apps to enable it.

Test: make offline-sdk-docs
Fixes: 156266477
Change-Id: I0feff5289706b5f7985013a18d9cf0e3e6b3ba78
2020-05-12 11:57:30 -04:00
Hazem Ashmawy
7536c2bda0 Android WebView: Deprecate unsafe file urls APIs
Deprecate unsafe:
- WebSettings#setAllowUniversalAccessFromFileURLs
- WebSettings#setAllowFileAccessFromFileURLs
- CookieManager#setAcceptFileSchemeCookies

And direct the users to use WebViewAssetLoader instead.

Bug: 148841999
Test: m offline-sdk-docs -j20
Change-Id: I607d1343cb2aa5baead49ceff6dbac4a4474009c
2020-03-05 19:56:07 +00:00
Hazem Ashmawy
ee824f006b WebView: Update setAllowFileAccess doc to reflect new default value
Update setAllowFileAccess java docs to reflect that it's now disabled by
default after merging crrev.com/c/2056824. Also add a note to use
androidx WebViewAssetLoader instead.

Bug: 148840827
Test: m offline-sdk-docs -j20
Change-Id: I15866ab63818771fd91f40828846d6b4c39d278e
(cherry picked from commit 47a4c2da51)
2020-02-26 12:26:36 +00:00
TreeHugger Robot
d73f4e387c Merge "WebView: deprecate 'Secure' cookies for insecure schemes" 2020-02-17 10:56:03 +00:00
Nate Fischer
bc22d8638b WebView: deprecate 'Secure' cookies for insecure schemes
No change to logic, only docs. This announces 'Secure' cookies are
deprecated for insecure URL schemes (only "https://" is considered
secure). This doesn't mention target SDK, because apps should follow
this guidance for all WebView versions, target SDKs, and OS levels.

Bug: 149589092
Test: m offline-sdk-docs -j4
Change-Id: I07c2b5341588d354f7f8219ce71a3d2ca04bc982
2020-02-14 15:04:56 -08:00
Anna Malova
4454e20081 Switch to WebViewFactoryProviderForR.
Test: n/a
Change-Id: I855463395044045b0ad1c7904a9aeb6fd32eaf54
2020-02-13 17:45:09 +00:00
Torne (Richard Coles)
51c221ab4e Mark nullability in WebViewProviderResponse.
The packageInfo can be null when the system is in a bad state and has no
WebView implementation; mark it @Nullable to make this clear.

Test: m
Change-Id: I9f87adf46809b9f1d4d6e68f35ec0fa18617834d
2020-02-12 13:39:14 +00:00
Torne (Richard Coles)
a528189652 Clarify WebResourceRequest.isForMainFrame docs.
Make it more explicit that isForMainFrame() returns true only for the
actual main frame document, and not for any subresources, even if they
are subresources of the main frame.

Test: make ds-docs
Change-Id: I942cbe6a8f50d2f3af00b99b14a8503c8c4556de
2020-02-07 13:36:44 +00:00
Anna Malova
113d302b49 Rename PacProcessor#makeProxyRequest to PacProcessor#findProxyForUrl.
This name corresponds to the name of PAC script function.

Bug: 148068051
Test: N/A
Change-Id: I722318988367d86d149ddd7d5020022f7734adff
2020-01-21 16:24:53 +00:00
Anna Malova
09f00a48c3 Add PacProcessor system API.
PacProcessor is intended to be used as an internal implementation detail of
com.android.pacprocessor.PacService, which in turn implements the java.net.ProxySelector interface.

Processing the PAC file requires starting up an instance of V8
so is expected to be handled by the central system service and queried over IPC (PacService),
not for apps to try to run it themselves.

Bug: 147578322
Test: N/A.

Change-Id: I857bb3616d7029fa0d42bf25def50f46094ec1d9
2020-01-13 13:57:59 +00:00
Artur Satayev
ad9254cb1d Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I5be7335b23a92b8ac80d2fd890198273b66ad644
2019-12-18 16:27:02 +00:00
Laís Minchillo
c1360b215e [webview] Annotate API parameters as @Nullable or @NonNull
Annotate WebView API parameters as either @Nullable or @NonNull. When a
method returns a nullable type, add this to the javadoc as well.

Deprecated methods were ignored.

Bug: 119254822
Test: none (only changes annotations, no change in logic)
Change-Id: I701108240fd5905e1085a9e8bcce44567e517892
2019-12-03 11:14:45 +00:00
Artur Satayev
751e55114c Add @UnsupportedAppUsage annotations for greylist.
go/cleanup-greylist-txt

These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.

This is partial merge of aosp/Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09. Telephony greylist cleanup has been done separately. Note that annotations outside of frameworks/base/ have been merged from AOSP.

Bug: 137350495
Test: m
Exempt-From-Owner-Approval: merge
Change-Id: I015c466e8b69cc0fed5e9d394ba865aad11d8ba6
2019-11-19 15:05:35 +00:00
Torne (Richard Coles)
ef3c3020b5 Merge "WebView: note deprecation of onscreen zoom controls." into qt-dev am: b0bcbb0c35 am: 016ee6777e am: 30c6079772
am: a9395a3a0b

Change-Id: If96046f0446e0f3f05ec605ce3cd33759401b19a
2019-11-05 15:32:34 -08:00
Torne (Richard Coles)
a9395a3a0b Merge "WebView: note deprecation of onscreen zoom controls." into qt-dev am: b0bcbb0c35 am: 016ee6777e
am: 30c6079772

Change-Id: I0fbdb26b176e4f30738923618dd063341017b7c1
2019-11-05 15:26:29 -08:00
Torne (Richard Coles)
016ee6777e Merge "WebView: note deprecation of onscreen zoom controls." into qt-dev
am: b0bcbb0c35

Change-Id: If316cbd120ac807313f4d89a212be01b5e4a313e
2019-11-05 15:14:34 -08:00
TreeHugger Robot
b0bcbb0c35 Merge "WebView: note deprecation of onscreen zoom controls." into qt-dev 2019-11-05 22:57:36 +00:00
Torne (Richard Coles)
c1661db644 Merge "Clarify CookieManager RFC reference." into qt-dev am: 7186df9e6f am: 45a9d4bc79 am: 04be94e23e
am: c1c1a5e7d7

Change-Id: I4dcb73c107e1c1a8e4f8c3fa68dc529f634df9ef
2019-10-30 10:11:11 -07:00
Torne (Richard Coles)
c1c1a5e7d7 Merge "Clarify CookieManager RFC reference." into qt-dev am: 7186df9e6f am: 45a9d4bc79
am: 04be94e23e

Change-Id: I4b40d40281753e10408d41114490794734002d72
2019-10-30 10:03:58 -07:00
Torne (Richard Coles)
45a9d4bc79 Merge "Clarify CookieManager RFC reference." into qt-dev
am: 7186df9e6f

Change-Id: I91a6a53d029b8ec2567eaac93056c91642b5177e
2019-10-30 09:51:40 -07:00
TreeHugger Robot
7186df9e6f Merge "Clarify CookieManager RFC reference." into qt-dev 2019-10-30 16:31:03 +00:00
Nate Fischer
502711d460 WebView: clarify docs for onShowCustomView am: aaaa660a44 am: 3ea1a6d6ff am: b2bc8ddcfb
am: a906395b9e

Change-Id: I3285728d0692fb16d611d6b18fc826c3ce87f238
2019-10-29 00:47:07 -07:00
Nate Fischer
b2bc8ddcfb WebView: clarify docs for onShowCustomView am: aaaa660a44
am: 3ea1a6d6ff

Change-Id: Id1a2fc32030f8a5aed8af4dfd6c7046a65d51a6e
2019-10-29 00:32:55 -07:00
Nate Fischer
3ea1a6d6ff WebView: clarify docs for onShowCustomView
am: aaaa660a44

Change-Id: Idaa495f908c914057ac785bfeca1f2f15a0a5fd8
2019-10-29 00:26:23 -07:00
Nate Fischer
aaaa660a44 WebView: clarify docs for onShowCustomView
No change to logic, only docs.

This clarifies the docs for onShowCustomView. This @links to
FLAG_FULLSCREEN, reminds the developer they must override both
onShowCustomView and onHideCustomView, and provides guidance for
CustomViewCallback.

Bug: 143247282
Test: make -j4 docs
Change-Id: I64de3723674da5c138438921cc8232c4bf2a3d98
2019-10-28 20:46:39 +00:00
Torne (Richard Coles)
41c6486351 WebView: note deprecation of onscreen zoom controls.
Inform developers that having onscreen zoom controls is deprecated and
that it's therefore not recommended to enable them in WebView, with
reference to ZoomButtonsController (which is what WebView uses to
implement them).

Bug: 141732094
Test: make ds-docs
Change-Id: I134551b87d3a93072e28aef56667507214b3e9c4
2019-10-25 16:41:47 -04:00
Torne (Richard Coles)
22a92de6d5 Clarify CookieManager RFC reference.
RFC2109 has been obsolete for a long time, and the docs aren't very
clear what exactly the RFC has to do with CookieManager; the RFC is
about HTTP and it's not immediately clear how this would apply to a Java
API.

Update the reference to the current cookie spec (and hyperlink it), and
clarify the text to explain that the HTTP header formats from the RFC
are the formats used to get/set set cookies.

Fixes: 143086151
Test: make ds-docs
Change-Id: I5e5838d3435b74516847b63e485fdd93810284aa
2019-10-21 14:58:17 -04:00
Tobias Sargeant
e067f04821 Merge "[webview] Fix handling of unicode digits in address detection." am: 8abff6b4d0 am: e71eaf3f5e am: dd702a3a54
am: bac5527166

Change-Id: Ieaa0a8da2eba7b0469b2ba707899818c1ccf0264
2019-10-11 04:33:43 -07:00
Tobias Sargeant
dd702a3a54 Merge "[webview] Fix handling of unicode digits in address detection." am: 8abff6b4d0
am: e71eaf3f5e

Change-Id: I4d972bdbd6709bc414a4220aa700e3bab97536b9
2019-10-11 04:09:20 -07:00
Tobias Sargeant
e71eaf3f5e Merge "[webview] Fix handling of unicode digits in address detection."
am: 8abff6b4d0

Change-Id: I08b798ac8867c14098a48dd2782ceab794360683
2019-10-11 03:57:24 -07:00
Treehugger Robot
8abff6b4d0 Merge "[webview] Fix handling of unicode digits in address detection." 2019-10-11 10:30:36 +00:00
Tobias Thierer
0cfa891678 Merge "Track MimeMap moving to libcore.content.type." am: 0801b7c222 am: 093c1e4eaa am: b43f746cdc
am: 0935b64e5b

Change-Id: I13997bf4f330d2ceb2d871b291729b4d78569ba2
2019-10-04 06:46:14 -07:00
Tobias Thierer
b43f746cdc Merge "Track MimeMap moving to libcore.content.type." am: 0801b7c222
am: 093c1e4eaa

Change-Id: If2b46820dc9ba3d8ba6b8f542521f3818b0074c9
2019-10-04 06:20:07 -07:00
Tobias Thierer
093c1e4eaa Merge "Track MimeMap moving to libcore.content.type."
am: 0801b7c222

Change-Id: I63889b3eedb8f98c99d71172dc5cc32025a8afd4
2019-10-04 06:07:03 -07:00
Tobias Thierer
8edd837b79 Track MimeMap moving to libcore.content.type.
Another CL in this topic moves libcore.net.MimeMap to package
libcore.content.type. This CL updates associated references.

Bug: 136256059
Bug: 124232146
Test: Treehugger
Test: CtsMimeMapTestCases
Exempt-From-Owner-Approval: move affecting imports only
Change-Id: I30aac8b28a1740180ea01834a2bb66b61cb255d4
2019-10-04 12:52:38 +00:00
Tobias Sargeant
fdebc611b6 [webview] Fix handling of unicode digits in address detection.
Restrict the set of digits recognised to ASCII to avoid throwing a
NumberFormatException

Bug: 141534831
Test: atest CtsWebkitTestCases
Change-Id: Ifc39fef9b8e2b66b3e0a9a6590b5817136cccd2f
2019-09-30 13:29:45 +01:00
Anna Malova
77ff146c82 Merge "[WebView] Minor javadoc fix for WebSettings." into qt-dev am: 63c65616ae am: e4cbd008c0 am: 47e276ed96
am: e2e66d2e31

Change-Id: Ibe951e7aa2fe49dea3cab081b4febe24e1ddb257
2019-09-30 04:42:14 -07:00
Anna Malova
e2e66d2e31 Merge "[WebView] Minor javadoc fix for WebSettings." into qt-dev am: 63c65616ae am: e4cbd008c0
am: 47e276ed96

Change-Id: I639c6d1befa12d6b477e25878040a5fedea6738e
2019-09-30 04:28:45 -07:00
Anna Malova
225c0d2a26 Merge "[WebView] Minor javadoc fix for WebSettings." into qt-dev am: 63c65616ae
am: e4cbd008c0

Change-Id: I69a175d140f2d6cb081e2c4b4eda050b397e8be1
2019-09-30 04:21:51 -07:00
Anna Malova
e4cbd008c0 Merge "[WebView] Minor javadoc fix for WebSettings." into qt-dev
am: 63c65616ae

Change-Id: I3ee0487212dfb139da111e9a7314dc781db66b63
2019-09-30 04:08:44 -07:00
Anna Malova
7374ce19ac [WebView] Minor javadoc fix for WebSettings.
No change to logic.

Test: N/A
Bug:132394762
Change-Id: I957b0d8a03cd937b38611e32f6c012b01a6ad7da
2019-09-25 12:19:27 +01:00
Aurimas Liutikas
4d1699da48 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-29 17:15:44 -07:00
Shimi Zhang
cc7628964c Merge "aw: Correct doc of addJavascriptInterface()" into qt-dev am: 62c764e29b am: d081f1064d am: 0922cc17be
am: 3446691be1

Change-Id: I8d7b836d8582fd63cc5bedfa4c7961f2c6603672
2019-08-27 19:56:22 -07:00
Shimi Zhang
0922cc17be Merge "aw: Correct doc of addJavascriptInterface()" into qt-dev am: 62c764e29b
am: d081f1064d

Change-Id: I2c02ba4da3494dfda62f13e5891a9a24e474abc7
2019-08-27 19:11:46 -07:00