Commit Graph

3405 Commits

Author SHA1 Message Date
Tim Volodine
b0e9798e52 [WebView] Add documentation regarding geolocation api on secure origins.
Update to javadoc comments saying that for apps targeting N and up
the geolocation api is only supported on secure origins.
On non-secure origins requests to geolocation api are automatically
denied without calling the corresponding
WebChromeClient#onGeolocationPermissionsShowPrompt method.

BUG: 28080869
Change-Id: I57726f7f3b3d38db0535f742b1f74c40c1f1ce8b
2016-04-29 12:59:27 +00:00
Bo Liu
08ca2e3a75 Merge "Revert "Expose setDrawGLFunctionDetachedCallback to webview"" into nyc-dev 2016-04-27 17:58:34 +00:00
Selim Gurun
9a5f9c2087 Merge "API Review: Add @IntDef and other annotations to Menu Item flags." into nyc-dev 2016-04-27 17:48:32 +00:00
TreeHugger Robot
e12d62bd79 Merge "WebView downgrade prevention logic" into nyc-dev 2016-04-26 09:31:57 +00:00
TreeHugger Robot
b698fc9d84 Merge "WebView doc: explain persist js across navigations" into nyc-dev 2016-04-25 18:39:47 +00:00
Bo Liu
e29d313e95 WebView doc: explain persist js across navigations
BUG: 28207652
Change-Id: Ib33f029c2cae6c1482c0c951075275e9f96ae73c
2016-04-25 09:38:06 -07:00
Bo Liu
d443f36957 Revert "Expose setDrawGLFunctionDetachedCallback to webview"
This reverts commit ee34ef1633.

This API is no longer needed by webview since 51.0.2704.22.
So remove this API. Note that this system API has never shipped
so it's ok to simply remove it.

Original description:
> Expose setDrawGLFunctionDetachedCallback to webview
>
> Add WebViewDelegate.setDrawGLFunctionDetachedCallback system API that's
> used for webview to receive the functor detach callback.
>
> BUG: 27709981
> Change-Id: Ie6b5e445c0090a181f94fcd2ec1ea77095c9cb03

BUG: 27709981
Change-Id: I9920dbedc6a280b4a19a8715832c4d2f64a7a7be
2016-04-22 13:32:23 -07:00
Adam Powell
31479e33e6 Remove dependencies on Activity from common Fragment superclasses
Allow common Fragments to be used in non-Activity hosts.

Bug 28337394

Change-Id: Id3baa3ef19ea41ff43ca76be89ced7530fbadfab
2016-04-22 12:11:28 -07:00
Hui Shu
b5f554a25d WebView downgrade prevention logic
Prevent *any* WebView provider packages to be downgraded lower than MonoChrome
Stable on the system image.

Assuming that all (and future) WebView provider packages follow the same
versionCode scheme, we can compare the subsection of Chromium versionCode that
contains branch number, which is done by ignoring the least significant 5
digits.

Note this CL is a follow-up to go/ag/895502.

BUG: 27469181
Change-Id: Iffe3c4b7f912d48c034f107079e065e54130713f
2016-04-22 10:56:55 -07:00
Hui Shu
539b077d42 API Review: Add @IntDef and other annotations to Menu Item flags.
BUG: 28296254
Change-Id: I11f77ae36b24f97948f55887d2ba111220afcf80
2016-04-21 11:35:28 -07:00
Bo Liu
439266bbb5 webview: canInvokeDrawGlFunctor should always return true
Now that invokeDrawGlFunctor doesn't use the View anymore, and just
calls a static method on ViewRootImpl. In particular this is required
since invokeDrwaGlFunctor need to still function for views that already
detached.

BUG: 27709981
Change-Id: I2c8c8f4a6943f7eec773265ca709349c5ce0be54
2016-04-20 09:03:53 -07:00
Bo Liu
e66471103a Expose DisplayListCanvas.drawGLFunctor to webview
BUG: 27709981
Change-Id: If3d2f57bfa50450e5f6834ef3ec2f48e26c294a6
2016-04-15 16:28:18 -07:00
Gustav Sennton
cd8f2737cc Verify WebView package info before loading WebView
To ensure that the package we are using to load WebView is a valid
provider we need to verify this before loading WebView - not only when
choosing what package to use.

Bug: 27900925
Change-Id: If57ca32a7a3fa08735a3b8ea9ed268c1bb1b8ede
2016-04-14 14:19:07 +01:00
Gustav Sennton
79fea48aec Create WebViewUpdateServiceImpl to move implementation there.
To make the WebViewUpdateService testable we create a new implementation
class that contains the implementation for the actual service. This
implementation can then be tested.

Bug: 27635535
Change-Id: I45c25c71375cc86a04c649a845016d2e7b105a7a
2016-04-07 16:03:44 +01:00
Bo Liu
2f1eb93354 Merge "Expose setDrawGLFunctionDetachedCallback to webview" into nyc-dev 2016-04-04 20:20:10 +00:00
Gustav Sennton
065b7e6ef5 Move more code from WebViewUpdateService to separate overridable class
Move more code from WebViewUpdateService to utility classes (methods
handling settings and uninstalling/enabling/disabling packages) to be
overridden during tests.

Also rename system utility class.

Bug: 27635535

Change-Id: If49999fba4fd0962f103f389898fa5ddf19365bd
2016-04-04 14:47:46 +01:00
Bo Liu
ee34ef1633 Expose setDrawGLFunctionDetachedCallback to webview
Add WebViewDelegate.setDrawGLFunctionDetachedCallback system API that's
used for webview to receive the functor detach callback.

BUG: 27709981
Change-Id: Ie6b5e445c0090a181f94fcd2ec1ea77095c9cb03
2016-04-01 11:10:00 -07:00
Gustav Sennton
1c177d8dae Add system api to reach WebViewUpdateService Binder interface.
Instead of using reflection in XTS tests we add some system-apis to
enable fetching information about webview packages.

Bug: 26381867
Change-Id: If983a01b6855e4a4c08ef0b5873304918d499b76
2016-04-01 12:39:54 +01:00
John Reck
bbb4c2eb2e Merge "Add a callback for rendernode parentcount=0" into nyc-dev 2016-03-31 18:24:49 +00:00
John Reck
44b49f070a Add a callback for rendernode parentcount=0
Bug: 27709981
Fixes: 22565656

Change-Id: I1cb4461baf9069dc4e7ca6de10d5862578c107f4
2016-03-31 08:36:50 -07:00
Gustav Sennton
ef40c9acd5 Merge "Simplify WebViewProviderInfo - move its logic into WebViewUpdateService." into nyc-dev 2016-03-31 15:28:53 +00:00
Gustav Sennton
dbf5eb04e6 Simplify WebViewProviderInfo - move its logic into WebViewUpdateService.
The WebViewProviderInfo should now be ready to be added as an API to be
fetched from XTS tests (to avoid using reflection).

Move the logic for validation, signature checking and package info
fetching out of WebViewProviderInfo so that we can mock the coupling
between that logic and the system (e.g. the package manager).

Note: with this patch we stop caching valid webview packages in the
update service (we would still refetch them anyway when anything
important happened).

Bug: 27635535
Bug: 27736084

Change-Id: Ia455202d2fd5bc4e03dce0fd917d262bf942d1a3
2016-03-31 14:21:47 +01:00
Gustav Sennton
79f1216eb1 Remove the system api method WebViewFactory.getWebViewPackageName
We no longer user this method and it doesn't return any useful
information.

Bug: 27719581

Change-Id: Id282f1501cde9a7d7cc1fe66016cfb54956686c5
2016-03-29 13:36:02 +01:00
Gustav Sennton
79a23a093e Merge "Add utility interface for WebView preparation logic." into nyc-dev 2016-03-18 17:30:12 +00:00
Gustav Sennton
8b17926a78 Add utility interface for WebView preparation logic.
To make the WebView preparation mechanism testable we add a utility
interface that can be overridden during a test to avoid calling the
Android framework and to provide custom WebView packages.

With this change we also split some of the code from the WebViewFactory
(code unrelated to WebView loading) into a separate utility class.

Bug: 27635535
Change-Id: I265ecd42b24ad5383637e125b3654ff339c9df9c
2016-03-18 15:47:23 +00:00
Gustav Sennton
26c82fff09 Remove WebView-package-being-replaced logic from WebViewUpdateService.
The replacing-logic tries to handle packages being uninstalled while
being replaced. This can't be handled through listening to
package-replaced intents since those can be delivered long after the
actual problem occurs.

Bug: 27605997
Change-Id: Iba8e546a5bba1ceb6226d4edb71db088c81ae1a9
2016-03-17 20:29:43 +00:00
Selim Gurun
ed738393af Merge "Revert "Revert "Add some View methods overrides and WebViewDelegate interfaces.""" into nyc-dev 2016-03-17 18:27:54 +00:00
Selim Gurun
e319dadaa9 Revert "Revert "Add some View methods overrides and WebViewDelegate interfaces.""
This reverts commit 7ef5429637.

Change-Id: I03a27148a1df5baf12fb89bca77dcb55a47b6be2
2016-03-17 01:41:14 +00:00
Torne (Richard Coles)
1a904125a3 Load WebView library into the right classloader namespace.
Use the namespace corresponding to the WebView APK's classloader to load
the native library. This prevents the library from being loaded twice in
certain situations.

Bug: 27189432
Change-Id: Ia232bf13a2a04b18214af4fecde68fafc534983f
2016-03-14 14:04:30 +00:00
Gustav Sennton
5df5e2266c Allow disk reads during more parts of WebView loading.
Loading WebView should not cause any StrictMode violations since app
developers using WebView with StrictMode turned on would have to turn
off StrictMode violations at the point at which they create a new
WebView.

Bug: 27240115

Change-Id: Ia2f5565be6f36560bc9881624faf6645bc2c8575
2016-03-08 16:21:09 +00:00
Gustav Sennton
074d630f9e Merge "Add fallback packages to be enabled iff no webview packages are valid" into nyc-dev 2016-02-24 19:00:36 +00:00
Paul Miller
9aca9aecab Fix WebView Metrics opt out Javadoc formatting
BUG:27305383
Change-Id: I23afa271058479263abe714f1a3493562f0cfe9e
2016-02-23 13:39:19 -08:00
Tao Bai
eb1368ba02 Using addAssetPathAsSharedLibrary in WebViewDelegate
BUG: 27245306
Change-Id: I346bc526cd9d311c290f61d0de04e33d708b81c4
2016-02-23 09:01:28 -08:00
Gustav Sennton
c83e3fa35a Add fallback packages to be enabled iff no webview packages are valid
This patch makes it possible to declare a WebView package as a fallback
which means that the package will be enabled iff there exist no other
valid and enabled (and available-by-default) webview packages.

The enabled-state of a fallback package is updated at boot and if a
webview package is changed (it it's been up/downgraded or has had its
enabled-state changed).

This patch also adds 'webviewupdate' shell commands for enabling and
disabling this mechanism.

Bug: 26375524, 26375860
Change-Id: I151915e5d6d932697dab10aeb593687e6b9c817e
2016-02-23 14:17:14 +00:00
Hui Shu
ecdce961ea Support for webview drag and drop
WebView needs to override onDragEvent to accept drops from other apps.

BUG: 27039417
Change-Id: Ie81c5ac325091cf78440785e04afcc01ddcbaab3
2016-02-20 01:51:14 +00:00
Selim Gurun
e542c490e1 Merge "Better document the ignore behavior for client cert api" into nyc-dev 2016-02-16 22:17:42 +00:00
Selim Gurun
977d943494 Better document the ignore behavior for client cert api
Bug: 26361557

When the embedded app requests a ignore of a client cert request,
webview does not cache the response of the app. However, underlying
layers could. Clarify the document.

Change-Id: I43e6a4c91727f71c88ca69e1334f64de9f66905a
2016-02-16 12:30:08 -08:00
Gustav Sennton
14c033c76b Move current WebView provider from Settings.Secure to Settings.Global
The current WebView provider is not user-specific and should therefore
be stored as a Global rather than a Secure setting.

Also do some code cleaning including a fix in WebViewProviderInfo to
always fetch up-to-date information about whether a webview
implementation package is enabled.

Bug: 27142972
Change-Id: I4d4b8fca775e97980fb5c34313be6d82472e7d33
2016-02-11 18:19:39 +00:00
Selim Gurun
c20ba757cb Merge "Provide a way to supply different algorithms for token binding key" 2016-01-22 22:52:51 +00:00
Selim Gurun
57a8d2ae31 Provide a way to supply different algorithms for token binding key
Bug: 22665752

The user of the API can provide different algorithms for key generation.
The API should also provide information about which algorithm is
used for generating the key.

Change-Id: I1d671ba351ca495b031b159132f33291a4f33aac
2016-01-22 14:50:42 -08:00
Tim Volodine
6f2f360610 Merge "Add Service Worker settings and callback support in WebView." 2016-01-22 19:09:24 +00:00
Gustav Sennton
444280d228 Merge "Fetch WebView package even if it is uninstalled for the current user." 2016-01-22 19:00:37 +00:00
Tim Volodine
28c8356441 Add Service Worker settings and callback support in WebView.
Service Workers are not tied to WebView instances so currently
there is no mechanism to capture callbacks originating from
within Service Workers.

This patch adds the necessary classes to capture callbacks
and allows to set settings specifically for Service Workers.

The main idea is that to control service workers the embedding
app would obtain an instance of ServiceWorkerController using
ServiceWorkerController.getInstance() first. After that it would
be able to set a custom ServiceWorkerClient and change
ServiceWorkerWebSettings via the controller object.

BUG: 22709088
Change-Id: I0eb17be46b767851676b77a94757771611fa3a1b
2016-01-22 18:55:39 +00:00
Gustav Sennton
b1e45cd0b5 Fetch WebView package even if it is uninstalled for the current user.
Since the WebView loading mechanism is global - it doesn't differ
between different users, a user for which the current WebView provider
is uninstalled won't be able to fetch any information about the current
provider without passing a certain flag (MATCH_UNINSTALLED_PACKAGES) to
the package manager.

Bug: 26677081
Change-Id: Id1b86164bb22fc7285d292da1b1115fb25e4d226
2016-01-22 11:59:40 +00:00
Selim Gurun
a5171370f2 Add the system apis for token binding
Bug: 22665752

Token binding protocol is the next generation channel-ID protocol,
currently it is a draft in IETF
 https://tools.ietf.org/html/draft-ietf-tokbind-protocol-03

Add the api as a system api (will be public once the draft finalizes)

Change-Id: If971cc7e6d14f15c778b9b027df9fc48dac0160c
2016-01-20 14:26:46 -08:00
Selim Gurun
504b81b02c Revert "Revert "Add the TokenBindingManager""
This reverts commit d1ec6356b3.

Change-Id: I75e4d9226808a30532f5c593123e59b78cd1e761
2016-01-15 21:10:52 +00:00
Selim Gurun
d1ec6356b3 Revert "Add the TokenBindingManager"
This reverts commit 57eb3264c9.

Change-Id: Ie74b64a181eb08dbfa1aeca99322be377e9f1d9c
2016-01-15 20:34:02 +00:00
Selim Gurun
57eb3264c9 Add the TokenBindingManager
Bug: 22665752

Add the webview APIs to manage token binding protocol keys.

Change-Id: Ie2eae543869b1ae91cdb4e70217c28b9a8a465cf
2016-01-15 10:19:38 -08:00
Gustav Sennton
1075d812f6 Merge "Fix WebView loading logic to allow changing provider if current disabled" 2016-01-11 18:43:05 +00:00
Jeff Sharkey
c5967e9862 More progress on triaging PackageManager callers.
Catch a bunch of simple cases where the PackageManager flags are
obvious.  Add the ability to use the MATCH_SYSTEM_ONLY flag on
PackageInfo and ApplicationInfo queries.

Re-examine recent tasks after a user is unlocked, since some of the
activities may now be available and runnable.

Bug: 26471205, 26253870
Change-Id: I989d9f8409070e5cae13202b47e2c7de85bf4a5b
2016-01-08 16:10:33 -07:00