Commit Graph

3929 Commits

Author SHA1 Message Date
Torne (Richard Coles)
13c24022d9 Remove WebView AppCache APIs.
These are no-ops since WebView 95; remove them from the SDK to make it
clear to apps that they're nonfunctional.

Bug: 199287927
Test: atest CtsWebkitTestCases
Change-Id: I498aff6f8a0c2901504d777f597dbf77f982cd3a
2021-09-14 14:05:08 -04:00
Treehugger Robot
efdf2388fa Merge "Refactor: Remove unused branch." am: a9f7998ff4 am: 4d7203226a am: 19545b4cc5 am: 45b057561e am: 2a4a3c0282
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1820992

Change-Id: If78fb3baa7e8198ee8fb39c890df172e6c691408
2021-09-09 01:46:50 +00:00
Treehugger Robot
4d7203226a Merge "Refactor: Remove unused branch." am: a9f7998ff4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1820992

Change-Id: Ic4a2d7911ab6d30d24b27596c42069e534f99db9
2021-09-09 00:39:23 +00:00
Darwin Huang
8303c17229 Refactor: Remove unused branch.
`filename` must be `null` at this point, as it's recently been set to that value, and hasn't adopted any other value yet. 

Refactoring change only. No functional changes intended.

Change-Id: I29a28872efc8c12c0da3c9f7c0a92d6aff465410
2021-09-08 00:33:11 +00:00
Ryan Mitchell
33f7a4771c Merge changes from topic "revert-15058002-SNQUARIDWJ" into sc-dev am: b3659d36b0 am: 30d3f5c8cc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15156470

Change-Id: Iaccb9ef10405114fa3cc3456404759a8d49678ed
2021-07-01 13:53:36 +00:00
Ryan Mitchell
350c2669d6 Revert^3 "Deprecate Context#createApplicationContext"
This reverts commit cb5a80ea57.

Reason for revert: Was not the cause of the test failure

Fixes: 186622527
Test: atest FrameworksCoreTests:ContextTest
Change-Id: I705854f080200f0465d94a7754e710f05a3ec92c
2021-06-30 15:53:45 +00:00
Paul Hobbs
bea71c4df6 Merge changes from topic "revert-15058002-SNQUARIDWJ" into sc-dev am: 8d440c0566 am: 30c6c3da16
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15144638

Change-Id: I480ec5d23f070c8383ea121432a9dd6c563a9188
2021-06-29 21:06:36 +00:00
Paul Hobbs
cb5a80ea57 Revert^2 "Deprecate Context#createApplicationContext"
Bug: 192242649

5a41b45a85

Change-Id: Idcebd68e0079e7e87de04ae25069b3a9ff72093c
2021-06-29 20:06:45 +00:00
Ryan Mitchell
702a3e0710 Merge changes Icf81845d,Iea54abf3,I98656314 into sc-dev am: 5a532f6eed am: f55b43b332
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15058002

Change-Id: Ifd34e72963e196376f408eac4f195142575a4402
2021-06-27 06:52:58 +00:00
Ryan Mitchell
5a41b45a85 Revert "Deprecate Context#createApplicationContext"
This reverts commit c54ebba25b.

Bug: 188059515
Test: atest FrameworksCoreTests:ContextTest
Change-Id: I986563142dac135281889e811e6e5219d728d5d1
2021-06-22 22:30:38 -07:00
Egor Pasko
fac857dd31 Bump x86 WebView zygote reservation size to 190MiB
The current 130MiB is not sufficient for the latest Chrome x86 dev build
of stripped native library. Official ARM library is around 59 MiB (on
disk). This flavor is slower to build and is less convenient to test
with.

Keep the 32bit arm reservation size unchanged, it is sufficient and
allows growth.

Bug: 184808875
Test: Manual: start a "release" build of Chrome/x86 (but not
      "official"), observe that with the change Chrome can
      mmap(MAP_FIXED) all the segments of the native library into the
      region successfully

Change-Id: I00507169eafbdcfc4d413bb9c76188e179ca0c0e
2021-06-15 00:36:49 +02:00
TreeHugger Robot
e7e7374c5c Merge "Deprecate Context#createApplicationContext" into sc-dev am: ee438f960a am: d95a9ebbfb am: 891659ba75
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14528644

Change-Id: I396eb97e5b36556757caf269b0e565459c62828b
2021-05-20 04:17:25 +00:00
TreeHugger Robot
92f9bfae56 Merge "Rework WebView startup timestamp system API." into sc-dev am: 99e37aca02 am: 3a1b86f460
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14602033

Change-Id: Icdedd6a67ebde91e39b810e4157cf90676e61b54
2021-05-20 00:15:21 +00:00
TreeHugger Robot
ee438f960a Merge "Deprecate Context#createApplicationContext" into sc-dev 2021-05-19 15:35:09 +00:00
Ryan Mitchell
c54ebba25b Deprecate Context#createApplicationContext
If an application caches an ApplicationInfo and uses it to call
Context#createApplicationContext, the app will not get the most recent
version of the overlays for that application. To make things worse, the
LoadedApk stored in ActivityThread#mResourcePackages is updated using
the old ApplicationInfo causing further uses of the cached LoadedApk to
return outdated information.

Deprecate Context#createApplicationContext, convert all internal uses
to Context#createPackageContext(String packageName, ...) and log
whenever any one calls Context#createApplicationContext with an
outdated ApplicationInfo to detect debug issues in using old infos.

Bug: 188059515
Test: change wallpaper and observe widgets get reloaded with most
      recent overlays
Change-Id: I2aeefa8c0e66264859109975a54c4f73f76ad710
2021-05-18 09:07:58 -07:00
Torne (Richard Coles)
ef1e913955 Rework WebView startup timestamp system API.
Rework the new WebView startup timestamp system API to use a class with
named getters instead of an array with an @IntDef index.

Fixes: 184026615
CTS-Coverage-Bug: 183239482
Test: n/a
Change-Id: I22c95b1c2dc98f8ecd23ce22dc21e3d0158d9e1b
2021-05-18 11:12:40 -04:00
Joanne Chung
b70f6567ff Merge "Add dispatchRequestTranslation() in WebViewProvider." into sc-dev am: 137a248c1f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14327001

Change-Id: I13f7e08e0ab32920fd982fe4871862441dbd1947
2021-05-12 11:42:55 +00:00
Joanne Chung
b8e3112908 Add dispatchRequestTranslation() in WebViewProvider.
This change doesn't introduce a new API, the change is just pushing
down an existing API from View that we are missing to add for the
webview. We should also provide this method to allow webview provider
to provide their implementation if needed.

Bug: 186617107
Test: manual
CTS-Coverage-Bug: 177960696

Change-Id: If75285b3aafdb1f2a3d7c307a90bb783edf029b5
2021-05-12 15:50:46 +08:00
TreeHugger Robot
7cb1b49629 Merge "[WebView] Add document for ViewDelegate#onApplyWindowInsets" 2021-05-07 19:29:22 +00:00
Shimi Zhang
a933ab3bfb [WebView] Add document for ViewDelegate#onApplyWindowInsets
Explaining when the method will return null and how that is
handled.

Bug: 180991400
Test: No logic change, current tests should pass.
Change-Id: Iae0a383cf173b80f50ea2bba46a3d263bed8f512
2021-05-07 10:29:22 -07:00
Torne (Richard Coles)
d35469d86b webview: switch timestamps to uptimeMillis().
We should use uptimeMillis for the startup timestamps since it doesn't
count time in device sleep.

Fixes: 184786485
Test: n/a
Change-Id: I4073e73de9b76d50398b820879c4fcf7b8f614e8
2021-04-29 15:22:59 -04:00
Torne (Richard Coles)
83d73c2eb4 Document WebViewDelegate.getTimestamps() better.
Specify that the values are @ElapsedRealtimeLong and document the
entries in the array via the index constants.

Fixes: 184786485
Bug: 184026615
Test: n/a
Change-Id: I26e3df80e79b14d2301e28da93f7814bc67bdb6a
2021-04-27 13:58:49 -04:00
Joanne Chung
f6a52811a1 API feedback: Translation View API refinement.
Bug: 178046780
Test: manual
Test: atest android.translation.cts.UiTranslationManagerTest
CTS-Coverage-Bug: 177960696

Change-Id: I557ca4b3b4e7324af12e81dd8b5ac8a04a17b6b8
2021-04-20 11:14:22 +08:00
Joanne Chung
8c8a14d4df Bug fix: allow to create ViewTranslationRequest for virtual AutofillId.
1. We provide virtual child list to View#onCreateTranslationRequests
but we don't provide a method to allow developers to create
ViewTranslationRequest for virtual AutofillId. Add a builder
constructor to allow developer to use it for virtual AutofillId.
2. Fix some comments in ag/13982294(e1b23cd)

Bug: 177789967
Test: manual on sample app
Test: atest CtsTranslationTestCases

Change-Id: I63e914b888b23cdb7a5169fc6931be93625ca8e4
2021-03-31 01:02:01 +08:00
Joanne Chung
e1b23cd423 Add translation APIs for virtual views.
Bug: 178046780
Test: manual
Test: atest CtsTranslationTestCases
CTS-Coverage-Bug: 177960696

Change-Id: I99caed0d42b3a164a25c2707eba7057c42c19140
2021-03-29 20:36:40 +08:00
Anna Malova
f649ddfcea Use SystemClock.elapsedRealtime() to record WebView startup timestamps.
ag/13435848 introduces timestamp collections based on
System.currentTimeMillis but elapsedRealtime is a better
choice for a interval timing.

Bug: 180489435
Test: n/a
Change-Id: If7b29cbe90e8bba76bccb42a5bc570c08b75c9e7
2021-02-17 14:38:08 +00:00
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