Commit Graph

3738 Commits

Author SHA1 Message Date
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
Tobias Sargeant
740b53f0f2 [wv] Add WebView unresponsive renderer APIs.
WebViewRendererClient is a callback class responsible for informing
applications about renderer state changes.

Specifically, these callbacks added as part of this feature are:

onRendererUnresponsive(renderer) - called when the renderer associated
    with a webview does not ack an input event, or a navigation does
    not commit within 5 seconds. The callback will continue to be
    called at 5 second intervals until the renderer is killed or the
    unresponsiveness resolves. |renderer| may be null if webview is
    operating in single process mode.

onRendererResponsive(renderer) - called once when an unresponsive
    renderer becomes responsive again.

This CL also adds the ability to get a webview renderer handle from a
WebView instance, and then terminate that renderer. This allows recovery
from unresponsive renderer situations when webview is in multiprocess
mode and termination is correctly handled via
WebViewClient.onRendererUnresponsive().

Bug: 111332462
Test: CTS test TBD
Change-Id: I0ec026f539a70f412c5567dd87a86a0d851b39ae
2019-01-16 00:25:30 +00:00
Martijn Coenen
7e6fa6727c Initial support for application Zygote.
When an application has requested isolated services to be spawned
from an app zygote, we need to spawn the app zygote itself, and then
ask it to fork an isolated service.

The application zygote currently only creates the class loader, and
doesn't do much else. We keep track of the isolated services that
use the app zygote, and when the last isolated service goes away,
we stop the app zygote itself (after a timeout).

The app zygote itself runs with the app's UID and under the app
seccomp filter. That last one is too restricted, so this currently
only works with SELinux disabled.

Future CLs will add an application callback for preloading.

Test: start multiple isolated services with useAppZygote="true",
      verify app_zygote starts, services start as a child of
      app_zygote. Stopping all services stops app_zygote as well.

Bug: 111434506

Change-Id: I10ee1d4bd148c9298974d434fbc5e5eccbec16cb
2019-01-07 09:10:31 +00:00
TreeHugger Robot
8319a7ee7f Merge "Plumb new functor in native/webview" 2019-01-03 19:15:24 +00:00
Bo Liu
d6668e7c0c Plumb new functor in native/webview
Add plumbing to native/webview for the new functor.
Add a void* data parameter to avoid having to use a thread safe
map for in both the plumbing and in webview.

Test: Compiles and webview runs
Bug: 120997728
Change-Id: I0f9f3acb05688a5afcf95974bc0b3b117f33a8e3
2019-01-03 19:15:18 +00:00
Nate Fischer
d6ca59a508 Merge "WebView: no bars in javadoc" into pi-dev am: 002c637337
am: 23a006b6e2

Change-Id: I8882626eeefce0b2a5e483b8612b45b05ce4faa6
2019-01-02 18:12:03 -08:00
Nate Fischer
23a006b6e2 Merge "WebView: no bars in javadoc" into pi-dev
am: 002c637337

Change-Id: I093585bdc5beaff3f6479b660d9d6d7b5577a5d2
2019-01-02 18:00:02 -08:00
Mathew Inwood
8501ae1763 Merge "Limit access to suspected false positives." am: aeda49d185
am: 152d5a5dcd

Change-Id: I8e10322e69d2d479079df5cf8fec0287c7c117f1
2019-01-02 05:00:54 -08:00
Mathew Inwood
55418eada5 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 14:26:35 +00:00
Mathew Inwood
31755f94e1 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 11:50:04 +00:00
Nate Fischer
e0938b86ae WebView: no bars in javadoc
No change to logic, only docs change.

The bar/pipe symbols have no meaning in javadoc. We should mark this
with {@code} instead.

Bug: 122046530
Test: None
Change-Id: I594480ea3bf4fec9c87a48275364c7c616a0e3ea
2018-12-26 15:36:35 -08:00
Tobias Sargeant
b58d556772 [wv] Update WebView factory provider class name.
Test: existing CTS tests.
Change-Id: Ib64c0655a605cb38aea1e2db2a45c9a09079c9ae
2018-12-21 15:39:33 +00:00
David Brazdil
9ad1461eb9 Merge "Annotate two non-SDK methods known to be used by apps" am: de441278e7 am: 32d2f8fe46
am: a5083783f7

Change-Id: I59f5f3ea5a0424036e1e715e56d8fa16572358b1
2018-12-20 06:09:41 -08:00
David Brazdil
a5083783f7 Merge "Annotate two non-SDK methods known to be used by apps" am: de441278e7
am: 32d2f8fe46

Change-Id: I0d1a0e85eebb555ca43c2d43e6c28ce96af94122
2018-12-20 05:59:08 -08:00
David Brazdil
ad857d637a Annotate two non-SDK methods known to be used by apps
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 121237128
Bug: 120783643
Test: m appcompat
Change-Id: Ib7a8bdf3151290aa8a5ca85dc8650612432f0d59
2018-12-20 13:36:21 +00:00
Torne (Richard Coles)
a50a86bbfb Merge "Clarify WebResourceResponse parameter documentation." into pi-dev am: dfcbdef8ab
am: 448eb5fd1b

Change-Id: I215cc7cf98523822adbe2c13e8a2f5891a6f34ec
2018-12-17 09:45:31 -08:00
Torne (Richard Coles)
448eb5fd1b Merge "Clarify WebResourceResponse parameter documentation." into pi-dev
am: dfcbdef8ab

Change-Id: I57fc0e17846ace25c2c90665f32de7a2af121ed8
2018-12-17 09:35:35 -08:00
Torne (Richard Coles)
c848639f08 Clarify WebResourceResponse parameter documentation.
Developers commonly misuse the mimeType and encoding parameters in the
WebResourceResponse constructor as the meaning is different to the
similarly named HTTP headers. Explain more carefully what valid/invalid
inputs look like and mention that this is different to HTTP.

Change-Id: I14d159bc50c89c2215f7de5f4732569e5e246930
Fixes: 64765685
Test: m offline-sdk-docs
2018-12-14 13:00:54 -05:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00
Toby Sargeant
7dee65518e Merge "[webview] Add a force dark WebSetting" 2018-12-06 23:04:51 +00:00
Tobias Sargeant
fec405a35a [webview] Add a force dark WebSetting
Force dark mode is a tristate:

- never invert colours for webview content
- always invert colours
- follow the parent view behaviour

Test: CTS test, after WebView implementation.
Bug: 120599879
Change-Id: Ib11358bc3a3cbc5e55c0ec184084c7d205acf60c
2018-12-06 18:57:32 +00:00
Nate Fischer
7198156c27 Merge "WebView: remove unused Token Binding system APIs" 2018-12-06 03:57:54 +00:00
Nate Fischer
eb667e66eb WebView: remove unused Token Binding system APIs
These APIs never really launched, and the Token Binding protocol is no
longer supported by the chromium team (which means these APIs have been
broken for some time).

This removes most of the TokenBinding API surface, keeping (and
deprecating) just enough to allow us to still compile and run WebView
APKs.

Bug: 119576150
Test: make update-api
Change-Id: Ia5a4258aac5ed21691ea36a428b4aa7195ff21ca
2018-12-04 17:32:12 -08:00
Felipe Leme
bf01eeafa0 Set WebView as important for Content Capture.
Test: echo 'In TreeHugger we trust!'
Bug: 111276913

Change-Id: I28c4691c9b4adb8163eaff15f7e498f637a162ad
2018-11-26 15:54:08 -08:00
Felipe Leme
92ab3857b0 Simplified View.onProvideContentCaptureStructure()
That method was returning a boolean to indicate whether the IntelligenceManager
should be notify, so views with virtual hierarchy could return false.

But now it returns void and always notify, which makes the API easier to
understand and use.

Bug: 117944706

Test: m -j update-api doc-comment-check-docs
Test: atest CtsAutoFillServiceTestCases

Change-Id: I216cacb6edb144239b6eabe56ab177fc2582e1aa
2018-11-16 09:19:37 -08:00
Felipe Leme
1b0e7e816c Implemented WebView.onProvideContentCaptureStructure()
Bug: 117944706
Test: m -j update-api

Change-Id: I2ad56873bae314b7bf66aa123a8ae47eecb7af2e
2018-11-13 16:22:25 -08:00
John Reck
8884cfc13e Merge "Rename & package shuffle" 2018-10-23 20:02:00 +00:00
Nate Fischer
69d7e2e9e1 WebView: fix mistaken wording in API doc
In http://ag/5298658, I said this constant is only used when apps have a
targetSdkVersion (strictly) greater than Q. I actually meant "greater
than or equal to."

This CL changes the wording to "is at least," which is both correct and
concise.

Bug: 117470538
Test: N/A
Change-Id: I8c2e016a7b26ce2ff406c433cc6071eb9d887753
2018-10-18 19:20:26 -07:00
TreeHugger Robot
dc315fd243 Merge "WebView: add new integer for billing threats" 2018-10-18 19:50:08 +00:00
Nate Fischer
f9a235316c WebView: add new integer for billing threats
No change to logic, this adds a new integer constant for Safe Browsing
billing threats.

This also adds ending periods in the docs for existing threat types.

Bug: 117470538
Test: N/A
Change-Id: I5368601efc7d587af1f530b7bf2825f277424082
2018-10-17 20:30:54 -07:00
John Reck
32f140aa67 Rename & package shuffle
Rename DisplayListCanvas -> RecordingCanvas
Move RecordingCanvas to android.graphics
Move RenderNode to android.graphics

Bug: 112709971
Test: make & boot
Change-Id: Iddeb6a89f8923ea81a1f37bbee4e9b1db8ede238
2018-10-04 16:18:12 -07:00
Nate Fischer
1e13fae31c WebView: deprecate accidentally-exposed constructors
This deprecates public-exposed constructors. These constructors were
exposed by accident. These classes shouldn't be instantiated by
applications, but should only be instantiated by WebView.

In some cases, the app should get a singleton instance using
a #getInstance method. In these cases, we document this explicitly in
the deprecation note.

Bug: 110807530
Test: make docs, manually verify docs look good.
Change-Id: Ibe73b3399c9ced0cf4fbb01e1df13564476df252
2018-09-25 19:13:57 -07:00
Nate Fischer
c1de7208ba Merge "WebView: fix TracingController example usage" into pi-dev am: 679e58a8d3
am: fc5c86fda8

Change-Id: Ib44310caef4c52c697307f345dbbf95d30647b0f
2018-09-20 14:02:58 -07:00
Nate Fischer
fc5c86fda8 Merge "WebView: fix TracingController example usage" into pi-dev
am: 679e58a8d3

Change-Id: I72c29fdc11925668a781bbff355fc1c429c2a888
2018-09-20 13:30:49 -07:00