Commit Graph

3772 Commits

Author SHA1 Message Date
Torne (Richard Coles)
4d72998fda Increase 32-bit WebView VA reservation.
Most pre-Q devices actually reserved around 130MiB in the 32-bit zygote
for the WebView native library; 100MiB was only the lower limit and the
file size based calculation that older OS versions use would come up
with a larger number. Increase the hardcoded value for Q to 130MiB so
that the behaviour is roughly the same across OS versions.

Fixes: 132081320
Test: manually verified via inspection of process maps
Change-Id: I0f03ac2f118bb0627ea6be229e5064d4590d8afb
2019-05-06 16:24:54 -04:00
Felipe Leme
ef1c0b36ab DO NOT MERGE - Removed ContentCapture support from standard SDK toolkit.
Test: atest CtsContentCaptureServiceTestCases
Test: m update-api
Test: make ds-docs

Fixes: 129982633

Change-Id: I5a0fa4231d0222638830c1abd8015d9f2635996a
2019-04-15 09:36:25 -07:00
Torne (Richard Coles)
05a766e876 Wait for RELRO before starting WebViewZygote at boot.
We start WebViewZygote at boot time to ensure the first app to use
WebView doesn't have to wait, but we were not waiting for RELRO creation
to finish before doing so. Move the background task which starts the
zygote to WebViewUpdateServiceImpl and have it wait for the RELRO first
to ensure that we get the memory saving of RELRO sharing whenever
possible, instead of only when the timing happens to work out by chance.

Fixes: 130305037
Test: manual, check logs and relro sharing status after boot
Change-Id: I55c3f80b0db1dc82727b90c70f777618ca77a942
2019-04-10 17:59:52 -04:00
Torne (Richard Coles)
5ca7aec419 Remove IWebViewUpdateService.isFallbackPackage.
All callers have been updated to no longer depend on this.

Bug: 129470358
Test: m checkbuild
Change-Id: Iff88e2825a9d1406b5d8f100ddcc5a11bdff2e68
2019-04-02 18:14:54 -04:00
Torne (Richard Coles)
ef47890d65 Migrate away from WebView fallback logic.
We no longer need to support fallback packages and need to migrate them
back to being enabled (but only once, to allow the user to disable them
manually later). This CL:

1) Removes the logic which enables/disables packages and the test cases
   which only cover the enabling/disabling logic.

2) Checks at boot time if the fallback logic is enabled; if so, it
   re-enables the fallback package if one exists and then disables the
   fallback logic permanently.

3) Amends remaining test cases to use "primary" and "secondary" instead
   of primary/fallback, to keep testing that higher priority packages
   are more preferred without involving the fallback behaviour.

4) Fixes a bug in the package selection logic that would not have
   triggered in the previous setup (as our production configs never had
   more than one available-by-default, non-fallback packages) that was
   revealed by one of the modified test cases: the boot time logic to
   reset the user's setting if their previously chosen provider was no
   longer available triggered even if the user had not actually chosen a
   provider, causing the automatically selected provider to be
   considered a manual user choice, and preventing a higher priority
   provider from being automatically chosen if it later becomes
   available.

Bug: 126588129
Test: atest WebViewUpdateServiceTest
Change-Id: I532c0faae2427de7132f716725bf62e256975410
2019-04-01 17:31:48 -04:00
Torne (Richard Coles)
689afe4149 Remove support for the WebView stub.
The WebView stub is only used in Monochrome configurations and is no
longer required with Trichrome. Remove the special case code used to
support it in the past.

Bug: 129470358
Test: atest CtsWebkitTestCases
Change-Id: Ieb11ae6698f370a1d601459e6253fc7dbe146014
2019-03-28 17:16:08 -04:00
Toby Sargeant
17501cab51 Merge "[wv-docs] Document force dark default, and behaviour of FORCE_DARK_AUTO" 2019-03-20 15:11:10 +00:00
Tobias Sargeant
e1fc791cff [wv-docs] Document force dark default, and behaviour of FORCE_DARK_AUTO
This adds a reference to the View method that controls framework force
dark, which impacts how FORCE_DARK_AUTO is interpreted. It also
documents that FORCE_DARK_AUTO is the default.

Test: documentation only change
Fixes: 128704481
Change-Id: I88e7996362da5b092b269c313e37ef9253b12872
2019-03-20 11:39:01 +00:00
Ashley Rose
d6b17862df Merge "Rename @EnumEntry and @FlagEntry" 2019-03-19 18:03:24 +00:00
Ashley Rose
73abdd3c59 Rename @EnumEntry and @FlagEntry
Test: atest CtsViewInspectorAnnotationProcessorTestCases
Bug: 127531820
Exempt-From-Owner-Approval: Annotation-only change
Change-Id: Id293e2b2ac9cf7bf2aaeb28645471ea227bb587b
2019-03-18 16:05:55 -04:00
Torne (Richard Coles)
85120a5474 WebView: add all APKs to asset path.
If there are multiple APKs as part of the WebView implementation (due to
splits, shared libraries, or overlays) add them all to the asset path,
instead of just the base APK.

Bug: 124116212
Test: manually tested with modified Trichrome build
Change-Id: I912e741b6de3154f66e5e82c9cf7154c6d39b1a4
2019-03-18 15:44:26 -04:00
Torne (Richard Coles)
3b6554e278 Partially revert "Handle WebView assets correctly when multiple APKs are used."
This reverts the WebViewFactory changes from commit
527fa8f4de which appear to have changed
the way that the asset path is updated in an incompatible way.

Bug: 124116212
Fixes: 128489090
Test: launch affected applications
Change-Id: Id53dedef4fa55a6b8cea8a60326a4b8acd3422f8
2019-03-13 12:33:29 -04:00
Torne (Richard Coles)
527fa8f4de Handle WebView assets correctly when multiple APKs are used.
Add all splits and shared libraries used by the WebView implementation
to the application's asset path, instead of just the base APK. Fix the
asset manipulation code path in WebViewFactory to reuse the modern
implementation in WebViewDelegate (using appendLibAssetForMainAssetPath)
instead of relying on addAssetPathAsSharedLibrary.

Add a new variant of appendLibAssetForMainAssetPath which accepts
multiple paths at once, to make it more efficient.

Bug: 124116212
Test: atest CtsWebkitTestCases
Change-Id: Ie55525d78089a4595c5b0b126e4ff1530303afe8
2019-03-12 11:41:09 -04:00
TreeHugger Robot
54626bf41f Merge "[webview] Rename force dark WebView settings." 2019-03-12 03:52:33 +00:00
TreeHugger Robot
f66f3ae921 Merge "[webview] rename unresponsive renderer APIs" 2019-03-12 02:37:30 +00:00
Shimi Zhang
b8e9c1c580 Merge "onPageFinished javadoc cleanup" into pi-dev am: dfd3a1b852
am: d4eed7352d

Change-Id: I0d405bad9ead8e1cd814c5634b5e0f69ead8956b
2019-03-11 17:45:09 -07:00
Shimi Zhang
d4eed7352d Merge "onPageFinished javadoc cleanup" into pi-dev
am: dfd3a1b852

Change-Id: Ib79006f63037bbbdc6a22c46ab790fc01a40c010
2019-03-11 17:36:38 -07:00
Tobias Sargeant
bbb043ae86 [webview] Rename force dark WebView settings.
Per API council request, remove setForceDarkMode -> setForceDark to
align with other framework naming.

Bug: 120599879
Test: None
Change-Id: I3f4ed00303d7e4b7d0651a384324a8b265663290
2019-03-11 23:54:27 +00:00
Shimi Zhang
ce222afda7 onPageFinished javadoc cleanup
PictureListener was deprecated, we need to replace its mentioning in
onPageFinished() javadoc with postVisualStateCallback().

Bug: 125939241
Test: make ds-docs
Change-Id: I7c1641c86632bb6c8214fd701e052096952deeec
2019-03-11 19:30:58 +00:00
Tobias Sargeant
39b68efcc3 [webview] rename unresponsive renderer APIs
Followup from API council review:

* Rename Renderer to RenderProcess for consistency with existing APIs.
* Make WebViewRenderProcess constructor public.
* Document 5 second minimum interval between successive callbacks.

Bug: 124767616
Bug: 123629980
Test: atest 'CtsWebkitTestCases'
Change-Id: I4416a97e8bb449c4a14a3617ef72a49c92aa3a83
2019-03-11 15:03:03 +00:00
Andrei-Valentin Onea
0c09cf5011 Merge "Add @UnsupportedAppUsage annotations" am: f304f4d2ea
am: 734611e34e

Change-Id: I14c15626440b2f1455110b6e504c4d18d2e5c5dc
2019-03-06 11:01:30 -08:00
Andrei-Valentin Onea
734611e34e Merge "Add @UnsupportedAppUsage annotations"
am: f304f4d2ea

Change-Id: Ic5e5148c473e64bc5d8ff506e7f4ac78c409734c
2019-03-06 10:30:15 -08:00
Andrei Onea
890db3d672 Add @UnsupportedAppUsage annotations
For packages:
  android.speech
  android.telephony.mbms.vendor
  android.view
  android.webkit

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Merged-In: Iefe25091fa0fcc0adfe4ff85fe5e3ab3ac9c5f10
Change-Id: I04104cf3852a0a7440676ccc55dd96c1eec730c4
2019-03-06 15:43:49 +00:00
John Reck
e9aeadb1e7 Cleanup functor system-api surface
Fixes: 127282736
Test: none
Change-Id: I5982d3f4f0671a3c351c11d8baf04aff5640e0a6
2019-03-04 10:29:40 -08:00
Jeff Sharkey
9e8f83db6d All Parcelable CREATOR fields are @NonNull.
If they were null, then the Parcelable would fail to work.

Bug: 126726802
Test: manual
Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014
Exempt-From-Owner-Approval: Trivial API annotations
2019-02-28 23:29:04 -07:00
Felipe Leme
50a8c75b49 Merge "Autofill, Content Capture, and Augmented Autofill API fixes:" 2019-03-01 02:04:30 +00:00
Felipe Leme
ce6877b0e4 Autofill, Content Capture, and Augmented Autofill API fixes:
- Added @Nullable / @NonNull on some returned values.
- Removed APIs that won't be implemented for Q.
- Made Builders final.

Test: m update-api

Bug: 123100695
Fixes: 126702168
Fixes: 126701052
Fixes: 126702191
Fixes: 126700602
Fixes: 126700135
Fixes: 126700413
Fixes: 126698817
Fixes: 126698792

Change-Id: I20710537c02051361da18370bc5cc642cc3c26e1
2019-02-28 09:25:12 -08:00
Andrei Onea
f4fb6fb754 Add @UnsupportedAppUsage annotations
For packages:
  android.speech
  android.telephony.mbms.vendor
  android.view
  android.webkit

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Iefe25091fa0fcc0adfe4ff85fe5e3ab3ac9c5f10
2019-02-27 15:42:25 +00:00
Xin Li
b455c3a7f3 DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293
Change-Id: I2f9a524f2ba552de3f62e343075cf0abf400bbae
2019-02-21 16:02:06 -08:00
Torne (Richard Coles)
518ec0b6af Merge "Clarify WebResourceResponse's stream handling." into pi-dev am: bec9d394d3
am: 5ed24cb220

Change-Id: I7d100aba24bb980c5ad0872b52525da9db2cda61
2019-02-20 21:03:28 -08:00
Torne (Richard Coles)
5ed24cb220 Merge "Clarify WebResourceResponse's stream handling." into pi-dev
am: bec9d394d3

Change-Id: Ic15302edd0598107cf8fb7a91924ec544592b435
2019-02-20 20:50:22 -08:00
TreeHugger Robot
bec9d394d3 Merge "Clarify WebResourceResponse's stream handling." into pi-dev 2019-02-21 04:32:58 +00:00
Xin Li
0e71b4f19b DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
2019-02-14 09:48:06 -08:00
Torne (Richard Coles)
08dc4c66bd Update WebView.loadData docs for Q targetSdk quirk.
Apps targeting Q+ will not get the backward compatibility quirk for
loadData content using a # character applied and will instead get the
documented/spec-compliant behaviour; document this.

Bug: 124371734
Test: m offline-sdk-docs
Change-Id: I05a3b4e951f4b3b051e94a22ba3eeae486228fbb
2019-02-13 13:42:04 -05:00
Nate Fischer
0db208d078 Merge "WebView: propose myself as OWNER" am: 9fdd759e40 am: 0424bd04bf
am: 0c6ecd8406

Change-Id: I32ed52d50cc3a568621cc7d0d5cfeba6ae8afb68
2019-02-08 18:35:20 -08:00
Nate Fischer
0c6ecd8406 Merge "WebView: propose myself as OWNER" am: 9fdd759e40
am: 0424bd04bf

Change-Id: If9b14720c02587fd336ee8c052916b9df5958b8d
2019-02-08 18:24:55 -08:00
Ashley Rose
22f0d530b6 @InspectableProperty annotations for WebView
Test: m framework
Bug: 120492712
Change-Id: I087e5d40e362171cce71e56755b72cad789a87ae
2019-02-08 20:07:23 +00:00
Nate Fischer
a9ef37b7de WebView: propose myself as OWNER
No change to logic, only OWNERS file.

I'm proposing myself as a code owner for frameworks/base/.../webkit. I'm
already an owner for our AndroidX APIs, so I think it's reasonable and
convenient to also be an owner for our framework APIs too.

Bug: None
Test: None
Change-Id: I602ad9fb88017c68e7e58cb29093fa29d80c1fc4
2019-01-30 14:18:24 -08:00
Martijn Coenen
d7b3a36959 Widen allowed UID range for webview zygote.
The webview zygote is shared for all users on the system, and so unlike
the app zygote, it can't use a single whitelisted UID range. For now,
clamp to the upper bound of the UID range, until we have a better idea.

This is still an improvement from the previous status quo, because it
will prevent setuid/setgid into system users.

Bug: 123597434
Test: builds, webview_zygote running
Change-Id: Ia975826ed5b1f20cabb46f60f5951723b1ba80c9
2019-01-30 12:24:17 +01:00
Christian Wailes
a1f14e0912 Merge "Code cleanup to conform to style guide / linter." am: f5ff8f0661
am: 420eec4f52

Change-Id: If4634a4d8026c1df1c581b120527926fbee68a0e
2019-01-23 18:23:25 -08:00
Chris Wailes
6e3c7ced5e Code cleanup to conform to style guide / linter.
This commit made the following changes to make the code conform to the
Frameworks style guide:
* Re-named variables
* Re-flowed code
* Organized includes

Topic: zygote-prefork
Test: make & flash & launch apps
Bug: 68253328
Change-Id: I9274b32f1f606f29f6eb3a1e5068ca18f607afe7
Merged-In: I9274b32f1f606f29f6eb3a1e5068ca18f607afe7
2019-01-23 13:34:52 -08:00
Torne (Richard Coles)
e032061ddb Use new app preload path for WebView zygote.
In the "common" case where the WebView stub is not being used, have the
WebView zygote use the new APK preload path added for the app zygote,
which avoids duplicating logic from the framework to construct the
classpath. This allows the WebView implementation to use a static shared
library, which was not previously possible.

The old codepath is retained for now to keep the WebView stub working
when it's in use, as it requires the special mechanism to override the
classloader cache key, but this can be removed when we no longer require
the stub.

Bug: 110790153
Test: Manual verification of classloader cache state
Change-Id: Ie49e5810d570bae7bec0341753e6c50d081189b5
2019-01-23 14:25:44 -05:00
Chris Wailes
efce929711 Code cleanup to conform to style guide / linter.
This commit made the following changes to make the code conform to the
Frameworks style guide:
* Re-named variables
* Re-flowed code
* Organized includes

Topic: zygote-prefork
Test: make & flash & launch apps
Bug: 68253328
Change-Id: I9274b32f1f606f29f6eb3a1e5068ca18f607afe7
2019-01-22 16:07:31 -08:00
Toby Sargeant
7980f06690 Merge "[wv] Make WebViewRenderer ctor @SystemApi" 2019-01-22 11:52:02 +00:00
Nate Fischer
b3c20e6ba5 WebView: clean up onReceivedSslError docs am: 9f726cd280
am: f85e6546e6

Change-Id: I05296f1e7c4b400b1111eed312d55741cffd4617
2019-01-18 17:43:02 -08:00
Tobias Sargeant
29a453075a [wv] Make WebViewRenderer ctor @SystemApi
So that it can be subclassed in the WebView glue.

Bug: 111332462
Test: CTS test TBD
Change-Id: Id231420d97e69e1a10b0fdf393950e1b609b4481
2019-01-19 01:23:09 +00:00
Nate Fischer
f85e6546e6 WebView: clean up onReceivedSslError docs
am: 9f726cd280

Change-Id: Id927f42978e86296710995c9d445ac7ce168e265
2019-01-18 17:22:01 -08:00
TreeHugger Robot
b128866274 Merge "Prepare setresuid()/setresgid() seccomp filter in AppZygote." 2019-01-18 22:10:09 +00:00
Nate Fischer
9f726cd280 WebView: clean up onReceivedSslError docs
No change to logic, only docs.

This adds {@link}'s for references to SslErrorHandler methods, improving
readability. This also clarifies this API is only called for recoverable
errors.

Fixes: 123042566
Test: m offline-sdk-docs
Change-Id: I0e94c9903e638e2fce59f35ec76eb5566e7ad875
2019-01-18 13:00:33 -08:00
Martijn Coenen
86f08a5190 Prepare setresuid()/setresgid() seccomp filter in AppZygote.
The application zygote can run untrusted user code; since it also
has the capability to change the uid/gid of the process, we need
to ensure that any changes to the uid and/or gid stay within the
range that we have allocated for this application zygote.

For application zygotes, we install the app_zygote seccomp
filter instead of the regular app filter; the only difference
between this filter and the app one is that it allows
setuid/setgid calls.

To further limit this, pass down the allocated UID range to the
Zygote itself, which in turn installs an additional seccomp
filter that restricts setuid/setgid calls to this range.

The actual calls into seccomp are commented out until the seccomp
changes are merged; to avoid catastrophe, this will leave the
regular app filter for the app_zygote, which is more restrictive
and doesn't allow setuid at all.

Bug: 111434506
Test: atest CtsSeccompHostTestCases passes
Change-Id: I112419629f5ee4774ccbf77e2b1cfa5ddcf77e73
2019-01-18 16:37:09 +01:00