Commit Graph

3185 Commits

Author SHA1 Message Date
Torne (Richard Coles)
84392d74fe Store the WebView's package info.
When loading the WebView, save the PackageInfo for the package so that
it can be retrieved later to access the package name, version data, etc.
This will be used to detect WebView downgrades that may affect an app's
saved WebView-related data.

Bug: 16724751
Change-Id: I05ce469308cc87f79c73206327f43b76b1bab222
2014-08-14 16:43:18 +01:00
Torne (Richard Coles)
4f82d40e9f Merge "Add trace events to WebView startup." into lmp-dev 2014-08-12 23:14:49 +00:00
Robert Ly
b369ff7b38 am 84f00277: am 9ada140f: am efbbb182: Merge "cherrypick from klp-docs docs: security consideration for Android <4.2 Change-Id: I5fe51641539f7ffe7abcdb0618371dd3f4b62ab5" into klp-modular-docs
* commit '84f00277b11a0324f0dd08054b119f2a61f1e646':
  cherrypick from klp-docs docs: security consideration for Android <4.2 Change-Id: I5fe51641539f7ffe7abcdb0618371dd3f4b62ab5
2014-08-13 16:17:49 +00:00
Robert Ly
84f00277b1 am 9ada140f: am efbbb182: Merge "cherrypick from klp-docs docs: security consideration for Android <4.2 Change-Id: I5fe51641539f7ffe7abcdb0618371dd3f4b62ab5" into klp-modular-docs
* commit '9ada140fc1a8cb6dabc0b0951249cb7a46578c37':
  cherrypick from klp-docs docs: security consideration for Android <4.2 Change-Id: I5fe51641539f7ffe7abcdb0618371dd3f4b62ab5
2014-08-13 16:12:37 +00:00
Torne (Richard Coles)
3822882b32 Add trace events to WebView startup.
Add system trace events for several interesting points during the
loading of the WebView APK so we can measure how much each part
contributes to startup time.

Bug: 16870075
Change-Id: Iadfd1881faea0377fa01313dddabb1d030962c5f
2014-08-13 17:11:45 +01:00
Scott Rowe
607c17f99c cherrypick from klp-docs docs: security consideration for Android <4.2 Change-Id: I5fe51641539f7ffe7abcdb0618371dd3f4b62ab5
Change-Id: I9838519ad3e0c2fb3957829fc448b1ae6bd1d62b
2014-08-07 15:54:42 -07:00
Torne (Richard Coles)
27cb0d22a8 Make WebViewFactory more robust.
Catch and discard any exception thrown in getWebViewNativeLibraryPaths
to avoid the system server crashing if there is something wrong with the
update APK. prepareWebViewInSystemServer(nativePaths) is safe to call
even if nativePaths is null or invalid, and must be called to ensure
that any process waiting for relro processing is unblocked.

Bug: 16894062
Change-Id: I76c759bebcb7c4643fb50979376afea764c859c4
2014-08-08 18:40:51 +01:00
Torne (Richard Coles)
c19f854965 Merge "Log the version of the WebView package used." into lmp-dev 2014-08-05 00:15:52 +00:00
Torne (Richard Coles)
0606cd572a Log the version of the WebView package used.
To aid in debugging app behaviour when WebView updates may be present,
log the package name, version name, and version code of the WebView
package when we are about to load it into an application. Do this before
we actually load any part of the package in case of an issue loading it
in the first place.

Change-Id: Id653bad431760b7ead8e3f8eb29f9d6a8bb68d07
2014-08-05 16:12:09 +01:00
Hector Dearman
ae9251262a Merge "Fix CookieSyncManager package summary" into lmp-dev 2014-08-05 00:35:13 +00:00
Hector Dearman
24f7e61a38 Fix CookieSyncManager package summary
Putting the deprecated at the beginning of a class comment seems
to cause problems with JavaDoc so I've moved it to the end.

Bug: 16799480
Change-Id: Ia23dab2ad8ceb8e107e047480b5cb324d11a1457
2014-08-05 10:55:30 +01:00
Torne (Richard Coles)
5f3278ba1e Don't let failures to load the null WebView propagate.
We load the null WebView if the real WebView package is not available to
support devices that aren't intended to have a WebView, but this results
in confusing log messages if the real WebView is supposed to be present
but is broken/unloadable for some reason. Since the null WebView is in
the system classpath on devices that should use it, swallow any failures
to load it on the assumption that this is actually just a failure of the
real WebView to be loaded.

Change-Id: I15820da3517daffde6169343c648a4486c0309d7
2014-08-04 14:26:16 +01:00
Primiano Tucci
e76e81a227 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
2014-08-01 14:25:26 +01:00
Torne (Richard Coles)
5651fc2fee CHerry pick Find WebView package name from a config resource. DO NOT MERGE
Use a config resource to determine the package name for the WebView
implementation to allow it to be changed by a resource overlay.

Original Bug: 16329371
Original Change-Id: I5977691c0223347e0382d584c3d3ee4428660180

Bug: 16723226
Change-Id: Ib0b4245f26cbf93f364aa0f30b231786931f9f16
2014-08-01 14:25:08 +01:00
Ben Murdoch
5ced502fba 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
2014-08-01 14:24:58 +01:00
Primiano Tucci
161536b597 Cherry pick Refactor ActivityManagerService and make WebViewFactory more pedantic. DO NOT MERGE
This CL adds more robustness to the logic in WebViewFactory, checking
whether the isolated process did start at all and catching exceptions
in its java side.
Also, this addresses the refactor comments received in CL 509840.

Original BUG:16403706
Original Change-Id: Iaaea6d36142ece6d974c2438259edf421fce9f2e

Bug: 16723226
Change-Id: Id308f2ffde9b67a3eb4719c7b81b4f46421f0c2e
2014-08-01 14:24:38 +01:00
Primiano Tucci
1b7977b608 Cherry pick Refactor native library path logic in WebViewFactory DO NOT MERGE
This CL changes the relro creation and loading logic.
Instead of using a hardcoded path, now WebViewFactory queries the
package manager to get the lib path, which will be either
/system/priv-app/webview/lib/ or /data/app/... depending on the
presence of an update apk.

Original BUG:16403706
Original Change-Id: Icceb95da98e69032a19ac2ae8fe72ba1439e50ad

Bug: 16723226
Change-Id: Ia3155f72a735d75a566a8cc4c8c892d43b6cd371
2014-08-01 14:24:28 +01:00
Marcin Kosiba
63d3d8a458 Cherry pick Append WebView assets to AssetManager when loading the WebView. DO NOT MERGE
This makes the code loading the WebView Java code from the .apk
also load the WebView assets into the current AssetManager.

Original BUG: 11505352
Original Change-Id: Ib6203f79b98805012ffa20b233037b7da221624c

Bug: 16723226
Change-Id: Ie7b0b22df9727c72debfb9ccfcd84c95bf41e039
2014-08-01 14:24:18 +01:00
Primiano Tucci
810c052d9b 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
2014-08-01 14:24:09 +01:00
Torne (Richard Coles)
6c778cebc7 Cherry pick Load the WebView Java code from an APK. DO NOT MERGE
Use the WebView APK to load the Java code via createPackageContext.

Original Bug: 16329371
Original Change-Id: I1292edab639d85c2027dc8ebb52def8c36d41cde

Bug: 16723226
Change-Id: I8e692a5e12706f91a8af0a8b385bac336ce60913
2014-08-01 14:23:55 +01:00
Selim Gurun
d92e726cbe Merge "Revert "Load the WebView Java code from an APK." DO NOT MERGE" into lmp-dev 2014-07-28 18:28:56 +00:00
Ben Murdoch
64fb02956b Revert "Load the WebView Java code from an APK." DO NOT MERGE
This reverts commit 72618c3363c83f2668dab4495b100a61d6d8700a.

Bug: 16448724
2014-07-28 21:07:24 +01:00
Bo Liu
c15fbba494 Merge "Add WebView.enableSlowWholeDocumentDraw" into lmp-dev 2014-07-28 18:28:56 +00:00
Hector Dearman
cf6a926ce9 am a7a75633: am 31b9e23a: am 21b90a9d: Merge "Add documentation for CookieManager defualts" into lmp-dev
* commit 'a7a756333d346890eae72a4f596fcedfe69308b5':
  Add documentation for CookieManager defualts
2014-07-25 12:38:27 +00:00
Selim Gurun
d4ed875df7 am 2bb2cf49: am bc19d47a: am 773433af: Merge "Address API review" into lmp-dev
* commit '2bb2cf49ea199816a51bbfb92880b8d16d01ff19':
  Address API review
2014-07-24 23:51:17 +00:00
Hector Dearman
28f4c20363 am 017d651c: am fb8f0643: am aa2a5911: Merge "Update CookieManager API for Council review." into lmp-dev
* commit '017d651cdd6509676ee88d960adc3415d69bba3c':
  Update CookieManager API for Council review.
2014-07-24 23:49:21 +00:00
Robert Ly
f5aba5ca1a am ae40df3e: am c955cdb3: am 1be71de6: am 39572996: am 1903bbb8: am 22bdcd2f: Merge "cherrypick from klp-docs docs: formatting for html Change-Id: I1451615c09cc003a03d7585176036c4d695408f1" into klp-modular-docs
* commit 'ae40df3eff3037a9b9e4e88899a6c7a713121a23':
  cherrypick from klp-docs docs: formatting for html Change-Id: I1451615c09cc003a03d7585176036c4d695408f1
2014-07-24 23:48:37 +00:00
Selim Gurun
c5a1e2c872 Merge "Address API review" into lmp-dev 2014-07-24 22:06:48 +00:00
Selim Gurun
48f6c45069 Address API review
Bug: 16403458

Address API review. This change updates the FileChooser api. The
largest change is, as requested by API council, providing a helper
to reduce the code app developers need to implement. This
change does not include the CookieManager changes that was requested.

Change-Id: I30d75f36df6bc96d9842b63fdd25c4ff62aee5bb
2014-07-24 15:18:57 -07:00
Robert Ly
eb355efc1b am 39572996: am 1903bbb8: am 22bdcd2f: Merge "cherrypick from klp-docs docs: formatting for html Change-Id: I1451615c09cc003a03d7585176036c4d695408f1" into klp-modular-docs
* commit '39572996f25d4b4ce744d9d04080e33b687ab03b':
  cherrypick from klp-docs docs: formatting for html Change-Id: I1451615c09cc003a03d7585176036c4d695408f1
2014-07-24 16:22:29 +00:00
Hector Dearman
9f59526f03 Add documentation for CookieManager defualts
Documents the defualt settings of acceptCookies and acceptFileSchemeCookies.

The current defaults:
                            <L       >=L
acceptCookies           |    y   |    y   |
acceptThirdPartyCookies |    y   |    n   |
acceptFileCookies       |    n   |    n   |

Bug: 11575158
Change-Id: Ia6cb71bf80608cb2ea8049192f33616e57c15801
2014-07-25 09:37:58 +00:00
Hector Dearman
ffae672881 Update CookieManager API for Council review.
Remove synchronized from setAcceptThirdPartyCookies

Bug: 16403458
Change-Id: I6073da2c03fd0952bc447f7cfe0d959148af6877
2014-07-24 18:10:25 +01:00
Bo Liu
9f3ed850b6 Add WebView.enableSlowWholeDocumentDraw
BUG: 16300353
Change-Id: Id4475f04f32bb176a6a59ee9d5a09e3f65b94ef0
2014-07-23 19:39:46 -07:00
Robert Ly
39572996f2 am 1903bbb8: am 22bdcd2f: Merge "cherrypick from klp-docs docs: formatting for html Change-Id: I1451615c09cc003a03d7585176036c4d695408f1" into klp-modular-docs
* commit '1903bbb88d8e2e1921b0441911cb73966d3bca4a':
  cherrypick from klp-docs docs: formatting for html Change-Id: I1451615c09cc003a03d7585176036c4d695408f1
2014-07-23 21:06:47 +00:00
Tao Bai
d673c47491 am f56d307b: am d5874836: am 9ba09c25: Merge "WebView permission change" into lmp-dev
* commit 'f56d307b4b082c15a17898bf00fc2ee60a100386':
  WebView permission change
2014-07-23 19:32:00 +00:00
Tao Bai
2871febb19 WebView permission change
As requested by API council, the following were changed
- Changed the PermissionRequest to abstract.
- Used String for resources instead of long.
- Also remove the WebView.preauthorizePermission() which we didn't think

BUG: 15432556
Change-Id: I900a98b4e0288d2bcd8faf0bbcd84970600548a5
2014-07-23 12:16:55 -07:00
Scott Rowe
e2bdaea318 cherrypick from klp-docs docs: formatting for html Change-Id: I1451615c09cc003a03d7585176036c4d695408f1
Change-Id: I21424c1407b44554ac135248dabc2328bc70aef9
2014-07-23 20:54:50 +00:00
Torne (Richard Coles)
8b4cd92852 Load the WebView Java code from an APK.
Use the WebView APK to load the Java code via createPackageContext.

Bug: 16329371
Change-Id: I1292edab639d85c2027dc8ebb52def8c36d41cde
2014-07-18 20:11:52 +00:00
Marcin Kosiba
3ee06efef3 Add a WebView.zoomBy API.
The WebView has zoomIn/zoomOut APIs which zoom in/out by a fixed
amount. This adds a more flexible API.

BUG: 13399510
Change-Id: Ia505048d5b1c48f9a3ff1c4ce7129ed2f55804f8
2014-07-18 02:18:44 +01:00
Ben Murdoch
dc00a84af1 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
2014-07-17 21:18:40 +00:00
Torne (Richard Coles)
08cfaf6726 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
2014-07-17 09:18:43 -07:00
Torne (Richard Coles)
b5de924fad Remove WebView library preloading mechanism.
We don't want to preload the WebView library in the zygote process any
more, as loading an updatable WebView in the zygote is a stability risk.
The memory benefits of preloading will be obtained in other ways.

Bug: 13005501
Change-Id: Ic89f2a1d057dc92b01fb775bf326b47ac2d4caa2
2014-07-17 09:18:43 -07:00
Marcin Kosiba
bce81bd03d Merge "Add more params to WebViewClient.shouldInterceptRequest." into lmp-dev 2014-07-15 20:46:43 +00:00
Marcin Kosiba
d72e7ba1c0 Add more params to WebViewClient.shouldInterceptRequest.
This changes shouldInterceptRequest to take an object containing the
following new parameters: isMainFrame, hasUserGesture, method, headers.
This also lets the embedder specify the following additional properties
of the response: status code, response phrase, headers.

BUG: 7589347
Change-Id: Id922c5e7023eb067db871e6f782f599492a2428f
2014-07-15 21:31:44 -07:00
Ben Murdoch
7302f4f8f7 Plumb temporary view detach calls through WebView.
Intercept View#onStartTemporaryDetach/onFinishTemporaryDetach
to handle focus changes correctly.

Bug: 14313621
Change-Id: I92ba2f44359643fee63f30b9c35b1ae4183e4245
2014-07-16 03:28:43 +00:00
Yuncheol Heo
eeba0257a7 Tag hole-punching api with @SystemApi.
Change-Id: I50c27c32abd7e6d2404c451fb53cfb1379b88e00
2014-07-10 20:03:57 +09:00
Selim Gurun
7871554e1a Add an API to disable data reduction proxy.
Bug: 16011253

Under rare circumstances, the application may need to disable the
data reduction proxy. This is to provide a way to do that.

Change-Id: I031f689f9d72460c7241aec78459185e0b31f059
2014-07-09 16:50:00 -07:00
Tao Bai
f6e1112216 Enable new geolocation permission API.
BUG: 14668406
Change-Id: I9500154d14eceae0248eb3718de27fc33fef4f28
2014-07-02 20:38:14 +00:00
Hector Dearman
a70d1d99de Deprecate the Cookie Sync Manager
The CookieSyncManager is largely useless as the WebView
automatically syncs cookies every 30s (whether you like it
or not). The one method which needs to be saved is sync,
there is no other way to force a sync without this.
We move sync to the CookieManager and rename it to flush
for greater consistency.

Bug: 11060034
Change-Id: I8a14998020eea54f196fc6ed845b09ed69cfd447
2014-07-01 13:12:29 +01:00
Hector Dearman
5622e8b669 Merge "Add Third Party Cookie API" 2014-06-26 21:23:48 +00:00