Commit Graph

3903 Commits

Author SHA1 Message Date
Anna Malova
3972728a44 Merge "Record WebView startup timestamps and add API to access them." into sc-dev 2021-02-03 11:36:52 +00:00
Automerger Merge Worker
f20f52a304 Merge "Merge "WebView: clarify CookieManager docs" am: 5844882671 am: d2243be46a" into rvc-qpr-dev-plus-aosp am: 8e92545adf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1569302

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9d66b86d7ad4990e3e8910816cfb6d78587b4d83
2021-02-03 00:38:32 +00:00
Nate Fischer
3a9cdb4485 WebView: clarify CookieManager docs
No change to logic, only documentation change. This adds some
clarifications to getCookie()/setCookie():

* getCookie() returns multiple cookies, setCookie() accepts only one
* This briefly describes getCookie()'s output format because it's fairly
  simple
* This summarizes setCookie()'s input format and provides an example,
  but directs the reader to the RFC spec for a full description
* Minor formatting changes, including editing a javadoc link which
  doesn't currently render correctly in kotlin docs (for
  ValueCallback#onReceiveValue)

Fixes: 175471135
Test: m offline-sdk-docs -j4
Change-Id: Id9052fa03584caae5ffc92ed1f6c4d2641d900ce
2021-02-02 03:15:47 +00:00
Anna Malova
416a99d69b Record WebView startup timestamps and add API to access them.
This change records timestamps that happen before the WebView APK's code
is loaded and can record timestamps itself.

Bug: 177895749
Test: n/a
Change-Id: Ibb832fa13e868846625cc02c584a535a11561c66
2021-01-29 14:44:04 +00:00
Anna Malova
4d7d9603e9 Add TEST_MAPPING to run WebView CTS/GTS tests in presubmit.
Bug: 173406791
Test: cd frameworks/base/core/java/android/webkit && atest --test-mapping
Change-Id: Ic75336a7067faf2c9ec10c8b7089eee48b2ec89d
2021-01-08 12:33:56 +00:00
Torne (Richard Coles)
7d70982263 Clean up WebViewFactory.getProvider error handling.
We were catching and ignoring exceptions when looking up the provider
factory method, because in the past the code fell back to calling the
provider constructor instead. However, this case was removed a while
ago, so now if the reflection fails the exception will be lost.

This isn't a big issue as it will still crash with a
NullPointerException when trying to call the method that wasn't found,
but it makes the cause of the problem less clear. Remove the extra
try-catch and just handle all exceptions thrown during the process of
creating the provider the same way.

Test: atest CtsWebkitTestCases
Change-Id: Ib2079e743a830a04a4117d782afa6eaaa26766df
2020-12-01 16:02:45 -05:00
Anna Malova
aedc4ae81c Merge "Give ACCESS_NETWORK_STATE permission to PacProcessor. Fix UnsupportedOperationException for PacProcessor#createInstance." 2020-11-23 11:56:51 +00:00
Anna Malova
f47c1ebc10 Give ACCESS_NETWORK_STATE permission to PacProcessor.
Fix UnsupportedOperationException for PacProcessor#createInstance.

Bug: 169844605
Bug: 171733851
Test: n/a

Change-Id: Ied19cc296c945c8923ffa65452113a87a13e7a25
2020-11-23 11:56:20 +00:00
Aurimas Liutikas
d23189b998 Suppress all hidden abstract methods in constructable classes.
Having a hidden abstract method for a class that can be extended
means that public implementors cannot implement these hidden methods
posing a risk that custom implementations will not have required
abstract methods resulting in an exception.

Bug: 151134792
Test: make update-api
Change-Id: I758d12465fabc671be19bedeeceb16885de23c87
Merged-In: I758d12465fabc671be19bedeeceb16885de23c87
Exempt-From-Owner-Approval: large scale suppression of existing issues,
    no-op in terms of behavior
2020-11-13 02:56:20 +00:00
Aurimas Liutikas
796760c56e Suppress all hidden abstract methods in constructable classes.
Having a hidden abstract method for a class that can be extended
means that public implementors cannot implement these hidden methods
posing a risk that custom implementations will not have required
abstract methods resulting in an exception.

Bug: 151134792
Test: make update-api
Change-Id: I758d12465fabc671be19bedeeceb16885de23c87
Exempt-From-Owner-Approval: large scale suppression of existing issues,
    no-op in terms of behavior
2020-11-11 23:16:32 +00:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Anna Malova
913e00c8c2 Rename PacProcessor#releasePacProcessor to PacProcessor#release.
Bug: 170226229
CTS-Coverage-Bug: 169844605
Test: n/a
Change-Id: Iba954d0a2784e69156dd1be14714a1c53b7bec07
2020-10-14 18:56:27 +00:00
TreeHugger Robot
0936ab496c Merge "Reland "Enable new S APIs for WebView.""" 2020-10-13 21:22:15 +00:00
Richard Coles
2fce8b0e83 Reland "Enable new S APIs for WebView.""
This reverts commit 039e10f76a.

New WebView binary has now been dropped, fixing the strict mode issue that necessitated a revert.

Change-Id: I86644e8a216c7087d7a00294d2b7f9ddb1705968
2020-10-13 19:24:00 +00:00
TreeHugger Robot
838cb845f1 Merge "Revert "Enable new S APIs for WebView."" 2020-10-02 21:02:10 +00:00
Nate Fischer
039e10f76a Revert "Enable new S APIs for WebView."
This reverts commit cfa9b7033c.

Reason for revert: WebView M85+ has a strictmode violation

Bug: 169877920
Change-Id: I46a26c16d83debc548217538200c6736ab8abeae
2020-10-02 18:35:41 +00:00
TreeHugger Robot
87ce51b8ed Merge "Enable new S APIs for WebView." 2020-10-01 23:26:46 +00:00
TreeHugger Robot
b9d481bdaf Merge "WebView: update loadUrl documentation" 2020-10-01 15:28:00 +00:00
Laís Minchillo
883b165d48 WebView: update loadUrl documentation
No change to logic, only docs. Updates loadUrl documentation to make it
clear that some WebView versions require the Map parameter to be
mutable.

Bug: 145881245
Test: m offline-sdk-docs -j4
Change-Id: I15f3c48f02090b8855880ff5d39c02aa28d4dfa8
2020-10-01 09:39:29 +00:00
Anna Malova
351256d16a Update methods of PacProcessor.
See discussion in b/149000014 for more information.

Bug: 168455630
Test: n/a

Change-Id: I3b63a0120b151a41ed219dcec818c6a400d03daa
2020-09-30 12:50:04 +01:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Anna Malova
242def4269 Use Network object instead of network handle and expand documentation.
Bug: 165192953
Bug: 165307632
Test: N/A
Change-Id: I5e2d22d3c332debe33d0cc617f86071b5926c50a
2020-08-19 13:46:02 +01:00
Felipe Leme
b07b092f9e Refactored some UserManager.getUsers(excludeDying) calls.
Replaced by getUsers() when exlcudeDying was hardcoded to false, or
getUsers(true,  excludeDying, true) when it was a variable.

This refactoring will help replacing getUsers(true) to getAliveUsers().

Bug: 157921703

Test: m
Test: atest atest LockscreenFrpTest LockSettingsServiceTests SyntheticPasswordTests

Change-Id: I139462ab329fe46d8136eae0a39ac071a7e019db
2020-08-12 15:03:37 -07:00
Anna Malova
1d0dede72d Add new methods to PacProcessor to
- allow multiple PacProcessors
- allow network-aware DNS lookups in PAC scripts

Bug: 162785263
Test: n/a

Change-Id: I39432d8f6358e386527b00b58d92e74ef32763d1
2020-08-06 14:44:32 +01:00
Torne (Richard Coles)
cfa9b7033c Enable new S APIs for WebView.
Make WebViewFactory create the *ForS version of the WebView factory
provider, and require that WebView implementations target at least S to
be valid.

Test: atest CtsWebkitTestCases
Change-Id: I21a1dc9a9084c1086bba52921bd19ba968544a9c
2020-08-05 16:44:34 -04:00
Nate Fischer
17c077cac6 WebView: remove non-inclusive terminology from docs
No change to logic, only docs. This removes non-inclusive terminology
("whitelist") from our API javadoc, with the exception of references to
setSafeBrowsingWhitelist() (which we plan to deprecate soon, in favor of
an inclusively named API).

This rephrases one paragraph to be a bit clearer as well.

Bug: 160928306
Test: m offline-sdk-docs -j4
Change-Id: If249be8a70b01c01390ebfeb418fd7c5e119f1f2
2020-07-27 20:27:42 -07:00
Nate Fischer
36f0f45750 WebView: remove non-inclusive terminology from docs
No change to logic, only docs. This removes non-inclusive terminology
("whitelist") from our API javadoc, with the exception of references to
setSafeBrowsingWhitelist() (which we plan to deprecate soon, in favor of
an inclusively named API).

This rephrases one paragraph to be a bit clearer as well.

Bug: 160928306
Test: m offline-sdk-docs -j4
Change-Id: If249be8a70b01c01390ebfeb418fd7c5e119f1f2
2020-07-23 10:53:27 -07:00
John Reck
ee26d1ef65 Merge "Remove legacy callDrawGlFunction2 from HWUI" 2020-06-30 19:09:37 +00:00
John Reck
aa4c982294 Remove legacy callDrawGlFunction2 from HWUI
Bug: 151439970
Test: CtsUiRenderingTestCases passes

Change-Id: I1c29df17bb6e8b078467edf73cb3547db6948cdd
2020-06-26 13:49:05 -07:00
Changwan Ryu
47c0a48089 [WebView] Listen to window insets change
Overriding these methods in preparation for notch and safe area implementation
for WebView.

A corresponding implementation for Chrome app does this:
https://source.chromium.org/chromium/chromium/src/+/master:components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/InsetObserverView.java;l=179;drc=b17e62321db0f69a9131d3bb87ab9cef502a0eaf?originalUrl=https:%2F%2Fcs.chromium.org%2F

An alternative would be to call View#setOnApplyWindowInsetsListener(),
but that might not be as straightforward and might conflict with app's own
usage around windowinsets.

Returning null from a default implementation and use super method until
we can actually implement it in the chromium repo.

(Note: I would like to merge this to R if possible.)

Bug: 159610496
Test: CL does not break build/test.
Change-Id: Ic0421d7347e8091e02af6c9d5a24fdb334f37c47
2020-06-25 17:15:26 -07:00
TreeHugger Robot
b1837c419f Merge "webkit: add a note regarding FLAG_SECURE for default dialogs" into rvc-dev am: f7484457cd am: bedf7e5161 am: ed9855498f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11617993

Change-Id: Id04faa91cf3c8f614ad5197506ef3e658569ffd1
2020-06-03 18:09:22 +00:00
TreeHugger Robot
efe6c29f16 Merge "webkit: add a note regarding FLAG_SECURE for default dialogs" into rvc-dev am: f7484457cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11617993

Change-Id: Ic7ffe9ca7bb83f27c204162a5c1d8fcecd29108b
2020-06-03 17:32:02 +00:00
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
TreeHugger Robot
55deb7e9f8 Merge "webkit: Update documentation for onJsBeforeUnload callback" into rvc-dev am: a203c27aa9 am: 346676a352 am: 52451f3b71
Change-Id: I131ad095a2ad012a56d6b7acc6bbd759054e3655
2020-05-27 21:18:14 +00:00
TreeHugger Robot
b013cdffc0 Merge "webkit: Update documentation for onJsBeforeUnload callback" into rvc-dev am: a203c27aa9
Change-Id: I7889a36e409f57a050d11c6b9b5d0797a57bd454
2020-05-27 21:02:40 +00: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
bc5dbbaa83 Merge "webkit: Update documentation for onJsConfirm, onJsPrompt callbacks" into rvc-dev am: a0b41154fe am: c82858208b am: 08b24a4d1c
Change-Id: I0c6e831a6fc98b014d705e69ced0397ba21d2af7
2020-05-20 06:17:48 +00:00
TreeHugger Robot
1bd4b0a7ca Merge "webkit: Update documentation for onJsConfirm, onJsPrompt callbacks" into rvc-dev am: a0b41154fe
Change-Id: I382ecdbf93164a4988627c324e7c0766e2b63422
2020-05-20 05:46:52 +00: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
TreeHugger Robot
58eb2d8c64 Merge "Update deprecation note for Application Cache." into rvc-dev am: 6da69cadba
Change-Id: I298b276efe0bbe78aa7c4f6feb84f58c7cc7ff91
2020-05-18 19:18:17 +00: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
TreeHugger Robot
94a9640197 Merge "webkit: Update documentation for onJsAlert callback method" into rvc-dev am: e0a73b1bb6
Change-Id: I558dcc2c3f5f093d27fccd6b54ad12f746c9bed9
2020-05-13 18:20:09 +00: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
TreeHugger Robot
02027c3a3d Merge "Deprecate WebSettings.setAppCacheEnabled and related." into rvc-dev am: 291cf5d293
Change-Id: I14d91abc884fecfc0c92c7fd4ffac56324de79a6
2020-05-12 19:28:29 +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
Automerger Merge Worker
6cbf2ff3eb Merge "Move yesterday/today Strings from LocaleData into a new ICU class" am: 05f3bf50d6 am: c1130c259b
Change-Id: I896db229cc70105a79687becd1d79a3c1d77553c
2020-03-12 18:46:44 +00:00