History log of /frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0df2c5566a9d7d71ca84cb072114f051bbe7a344 14-Jun-2016 Gustav Sennton <gsennton@google.com> Support using uninstalled WebView packages as WebView implementation.

A package can be uninstalled for the system user but still be installed
on the device. Currently, we do not use such a package as WebView
implementation which means we fall back to using the fallback WebView
package.
However, if the fallback package is not valid (because it needs to be
updated first) loading WebView will fail.

With this change we fetch allow the fetching of information from
packages that are uninstalled for the system user so that we can still
load WebView when the only valid WebView provider is uninstalled for the
system user.

Also listen to package additions/changes/removals for all users -
otherwise we won't notice when a package becomes replaced if it was
already uninstalled for the system user.

Bug: 29321185
Change-Id: Ia23c4493844877aea1b4eab7e666fd37540c4f97
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
9455bd0105f974de3d1164890353c2a0d0605840 08-Apr-2016 Hui Shu <hush@google.com> Cache the parsed result of WebView provider config xml

BUG: 27736084
Change-Id: I3665a5fd4777d22c6f217b358195edbeaad3bb1d
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
6824c7c1ec303a430200f29d5b300e9b1a43a152 04-Apr-2016 Gustav Sennton <gsennton@google.com> Clear calling identity when enabling WebView fallback logic.

Using the shell to enable/disable the WebView fallback logic would,
before this CL, fail because the package from where we update the actual
setting wouldn't match that of the calling UID.

Bug: 27957671
Change-Id: Iedf3be71aeef572ebf92c1db163eb8f461b8287a
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
79fea48aeca5c7d4c16c70c996c42a18d6cd8731 07-Apr-2016 Gustav Sennton <gsennton@google.com> 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
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
3a6e6b24fbdb7b181c34583af97306eec7d81ac8 05-Apr-2016 Gustav Sennton <gsennton@google.com> Split WebViewUpdateService logic into fallback logic and update-logic.

Add an inner class for the updating-logic to differentiate that logic
from the rest of the service (logic such as keeping track of
relro-creation and the current WebView implementation).
The fallback logic doesn't hold any state but instead just checks the
state of the system to determine whether to enable/disable the fallback
package and therefore that logic doesn't really need its own class.

Since the minimumVersionCode check stores state we here move that into
the inner class containing the updating-logic.

Bug: 27635535

Change-Id: I0afdb74c12139439ca66bfbd1c173ad98662ed31
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
9e8c0584faae06ad903b8b859c5a5e5b11d63257 25-Mar-2016 Hui Shu <hush@google.com> Disallow WebView provider packages lower version than Chrome Stable

Doing so has security benefits, making sure the device is at least as secure as
the MonoChrome Stable on the system image.

This is implemented as checking WebView provider package versionCode against the
default available, non-fallback WebView provider package. On GMS devices, this
is MonoChrome Stable. On AOSP devices, this is standalone WebView.

BUG: 27469181
Change-Id: Id5b68ee28401a24843421cfcc3755e63196ac0f9
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
ab3b6b12585c209b8c5287a6dcedfe648f857a9f 16-Mar-2016 Gustav Sennton <gsennton@google.com> Provide command to change WebView implementation.

Add a shell command for switching webview implementation so that this
can be done automatically - without interacting with a Dev Setting.

Bug: 27540566
Change-Id: I3c4acaa1b8f4ba24c637ef8a1d48cc7b2616bd91
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
065b7e6ef588a11c82cee22012706e6c0e66d0a3 01-Apr-2016 Gustav Sennton <gsennton@google.com> 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
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
dbf5eb04e6793651193cec59ff6b8cb0c6ca2f78 30-Mar-2016 Gustav Sennton <gsennton@google.com> 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
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
79a23a093e70e52164b882d045dfa47468ec5d45 18-Mar-2016 Gustav Sennton <gsennton@google.com> Merge "Add utility interface for WebView preparation logic." into nyc-dev
8b17926a78cc686504739730516c9b057d0672da 14-Mar-2016 Gustav Sennton <gsennton@google.com> 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
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
26c82fff095ad551301111fb0cfca3719f8c3d67 11-Mar-2016 Gustav Sennton <gsennton@google.com> 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
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
fc19b0a9ddbd10995cef0dde098e5cb2ed46ebd2 01-Feb-2016 Torne (Richard Coles) <torne@google.com> Make WebViewUpdateService accessible by isolated apps.

It's okay for isolated apps to connect to the webview update service to
find out which APK is WebView. This enables isolated renderer processes
to load their code from the WebView APK.

Change-Id: I7441ba1bc462895a47126cd065aa6f8ca254467f
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
1e5d80319593539790613d9abff2b6c7bf161c6d 25-Feb-2016 Gustav Sennton <gsennton@google.com> Trigger the webview update logic when receiving PACKAGE_CHANGED intents.

Since which WebView implementation we use depends on whether the
different webview packages are enabled or disabled we should listen to
changes to the enabled-state of our webview packages (to keep the
webview implementation up to date).

Bug: 27340150
Change-Id: Ie384a48424c9138150ddcc9f7bfaf7b82a911f16
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
074d630f9e7a4dfd8acf3fa4fa1dfcb500184156 24-Feb-2016 Gustav Sennton <gsennton@google.com> Merge "Add fallback packages to be enabled iff no webview packages are valid" into nyc-dev
275d13c2c6c2f055b41b14b1c7ba78b838f03b4d 24-Feb-2016 Gustav Sennton <gsennton@google.com> Call webview updating logic with the system UID when setup done.

After performing the webview setup we check whether we changed webview
implementation during the setup and, if so, we rerun the updating-logic.
This logic needs special permissions such as changing settings
(Settings.Global) which the shared relro process doesn't have,
therefore, when the shared relro process notifies us that the setup is
done we need to switch to using the system uid when running the
update-logic.

Bug: 27262336
Change-Id: I68646884e31ba55c860ff98c3f30a520beb0ef95
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
c83e3fa35a5736a1778d241abd18dffa5953f416 18-Feb-2016 Gustav Sennton <gsennton@google.com> 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
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
7a002a215db498d232100c0b227d145244a03412 12-Feb-2016 Gustav Sennton <gsennton@google.com> Merge "Move current WebView provider from Settings.Secure to Settings.Global" into nyc-dev
14c033c76b00fa1f59c4198e0e50f07387a0f3e9 11-Feb-2016 Gustav Sennton <gsennton@google.com> 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
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
23875b2657b24864cf5e5e8e22dfb409cde4f2a0 09-Feb-2016 Gustav Sennton <gsennton@google.com> Allow using USER_ALL as user id when killing package dependents.

Don't check package uid when trying to kill app dependents for all users
since that check will always fail.

Bug: 26973351
Change-Id: I52b28fe82791887e2af5f937afdfff6e5d565d6e
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
27f13de12bc73aed4328866ffa9fb9c394b72f7e 05-Jan-2016 Gustav Sennton <gsennton@google.com> Fix WebView loading logic to allow changing provider if current disabled

Add an XML tag declaring whether a package can be used without
explicitly being chosen by the user (it is available-by-default).

Change the WebView loading logic to either
1. load a user-chosen and enabled package or
2. load an enabled and available-by-default package or
3. any package that is valid

Bug: 26400585
Change-Id: I8de253c1687e3cc7961184c2d770d4e385d6187a
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
6258dcd7ea5450726bc7bcb1fbd50e99f62f38fb 30-Oct-2015 Gustav Sennton <gsennton@google.com> Add functionality for changing WebView provider.

Make it possible to change WebView provider (through a Developer
setting) and kill all apps using the old provider.
This includes checking the signatures of the WebView providers to make
sure they are valid.

Now that we can change WebView provider through a setting it is possible
to change provider while some provider is being updated. Because of this
we now keep track of which provider should be in use in
WebViewUpdateService to make sure we use the correct provider at all
times.

We now also read WebView package meta data (name, package name, and
signature) from a separate xml file.

Main bug: crbug.com/546185

Bug: 25338573

Change-Id: I660fd1a40a5388f6569a06a7f0d029e8ff65945a
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
3098cf2ea2d119a5630aa66e617f1f31de38cf17 10-Nov-2015 Gustav Sennton <gsennton@google.com> Trigger WebView relro creation when new provider package installed.

Previously, the switching of WebView providers was only triggered when a
WebView provider package was replaced. The new channels (e.g. Dev/Beta)
do not exist in the system image which means that we might install a
new WebView provider package without having to replace an existing one
(which before this change meant we didn't trigger the WebView updating
service).

Change-Id: I0933cb5cfc05c64dd950e0b405ede918c2791798
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
6ce92c9362143d2f5b4a52c14520528ef2c1bbd5 23-Oct-2015 Gustav Sennton <gsennton@google.com> Load WebView from one out of a list of packages, reland.

Use a priority list of WebView packages instead of a single package to
determine which package to load WebView from.
This to allow Chrome to provide the WebView implementation.

Change-Id: I71813825cd977a72ff4535a39a97a12565ec8a09
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
d9730182212b157083321ea4e2209182f1fbb72f 18-Jun-2015 Gustav Sennton <gsennton@google.com> Revert "Load WebView from one out of a list of packages."

This was not a clean revert!

This reverts commit 2ed6fee15c85ff991f64ecfa8c1c4738e0fdf9b6.
We essentially only revert the functionality for going through a list of
WebView package names and picking the first compatible one.
Except for that functionality we also fetched the name of the shared
library from a flag in WebView and made some minor refactoring in the
initial commit, these changes have been left alone in this revert.

Bug: 21893371
Change-Id: Idb2539dc33cc5f9e2894ecd665c23573c6cba9f3
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
2ed6fee15c85ff991f64ecfa8c1c4738e0fdf9b6 03-Mar-2015 Gustav Sennton <gsennton@google.com> Load WebView from one out of a list of packages.

Use a priority list of WebView packages instead of a single package to
determine which package to load WebView from.
This to allow a future version of Chrome to provide the WebView
implementation.

Change-Id: I42e900f0e63152188ebfcff9e39e0d9a99bc6c90
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
9915eb56fedc32c9a22d0e46b4cc9b3846da0642 14-Apr-2015 Gustav Sennton <gsennton@google.com> Revert "Load WebView from one out of a list of packages."

This reverts commit fe320b2fe95fc3a7aa95ca4171f8703369a54867.
We need to check in a new Webview APK first.

Change-Id: Ica6adef7a1e68c06b4c6a6a3c851f40f56b006ef
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
fe320b2fe95fc3a7aa95ca4171f8703369a54867 03-Mar-2015 Gustav Sennton <gsennton@google.com> Load WebView from one out of a list of packages.

Use a priority list of WebView packages instead of a single package to
determine which package to load WebView from.
This to allow a future version of Chrome to provide the WebView
implementation.

Change-Id: Id63a31396c8c0afbfd250f43a256ccd5981f7a56
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
6a0d43f09d8329bfe4709c05d2ce060cfbfba8b8 01-Aug-2014 Torne (Richard Coles) <torne@google.com> Fix WebViewUpdateService timeout code.

The loop was initialising the boolean incorrectly causing the first
iteration to wait even when the condition was already true and have to
hit the timeout before loading continues.

Change-Id: I6a347cff2e4560b38c8aec3297e456b6f784a97e
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
e76e81a227a29db5223d231ec88ecb02fa4d6835 29-Jul-2014 Primiano Tucci <primiano@google.com> Cherry pick Cleanup debug messages in WebViewFactory and WebViewUpdateService DO NOT MERGE

This is just a cleanup CL which fixes:
- Some erroneous debug messages about the relro creator process.
- The condition checked in WebViewUpdateService, to prevent the
WebView to be used from the SystemServer (it now looks at the
process id, previously it was erroneously looking at the uid).
- Adds a 5s. timeout to the waitForRelroCreationCompleted.

Original BUG:16403706

Original Change-Id: I43a953949050d7df5fe334cfa7257315ee6db071

Bug: 16723226
Change-Id: I2f40be3622b8e6c68b2b52cae7f4d3a95e148cbf
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
5ced502fba5a69dc1d2e55b3d7e5fd429280d6ae 28-Jul-2014 Ben Murdoch <benm@google.com> Cherry pick Remove dependency on WebView native library path. DO NOT MERGE

This CL removes the final use of the hardcoded WebView
library path from WebViewFactory. We now use a system
property to set the amount of address space to reserve
in the zygote rather than stat'ing the file.

See also I07ad5a774623c1899eb50474d999a2b1447783f0

Original Change-Id: Id3c1e3cc2e2a06c1021ad0260a37abcd07d78fd6

Bug: 16723226
Change-Id: I55acad96b6d9ee69f14b84d772abf7740ea96b94
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
4dbeb359b2cfeb63d6ec3ecb702f2bd836db058a 29-Jul-2014 Torne (Richard Coles) <torne@google.com> Cherry pick Make WebViewUpdateService a SystemService. DO NOT MERGE

Migrate WebViewUpdateService to the newer SystemService approach instead
of ServiceManager.addService.

Original Bug: 16403706
Original Change-Id: I21aa67a41c22c3c20ba9e82eb87e5d610fe130e8

Bug: 16723226
Change-Id: Id276b71ee547e683f0756bcee0f4978ce342c2af
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
810c052d9b117217152c2a609ccec056a2a61d1e 25-Jul-2014 Primiano Tucci <primiano@google.com> Cherry pick Introduce startIsolatedProcess private API in ActivityManager DO NOT MERGE

The new API spawns a isolated process, using a custom uid, entrypoint and
abi. Such API is used by the WebViewFactory to spawn its unpriviledged
but trusted process (hence the fixed uid) which rewrites the rerlo file
on boot / when an update occurs.
Since both the ActivityManager service and the WebViewUpdate service
live in the SystemServer their calls be dispatched locally and no
binder interface needs to be exposed for the new startIsolatedProcess API.

Original BUG:16403706
Original Change-Id: I327b59735c12698595e0dbcc4da5d759c9103b0a

Bug: 16723226
Change-Id: Iecb49888e11eec9d302d9712953fd498db5821af
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
dc00a84af15ff3594a6dfa512be21095bf9fee82 17-Jul-2014 Ben Murdoch <benm@google.com> Update WebViewUpdateService to receive PACKAGE_REPLACED broadcast.

This allows the WebViewUpdateService to receive notifications that
an update has been installed and we need to trigger recreation of
the relro file.

bug: 16329377
Change-Id: I088e61487416add997995db304beca0cde71390c
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java
08cfaf672604422dd355d6703aec78f3aa5ee74e 08-May-2014 Torne (Richard Coles) <torne@google.com> Use the WebView's loader library to load the real library.

Load libwebviewchromiumloader and use it to load the real WebView
library, to enable sharing of the relro segment between different
application processes without requiring that the library be preloaded in
the zygote. A system service is added to track whether the relro segment
file has been prepared, and block loading of the library until it has
been.

Bug: 13005501
Change-Id: I846b37c7b8e2a4eb8a39e4fd455bccbb2048c173
/frameworks/base/services/core/java/com/android/server/webkit/WebViewUpdateService.java