Commit Graph

3661 Commits

Author SHA1 Message Date
Tim Volodine
13b129a225 Merge "[WebView Tracing API] documentation fixes." into pi-dev am: 4800d9a9e7
am: 234d296360

Change-Id: I69f1e212c2727bf81e40ab239013c977c2f1e3ff
2018-04-11 08:14:03 -07:00
TreeHugger Robot
4800d9a9e7 Merge "[WebView Tracing API] documentation fixes." into pi-dev 2018-04-11 14:38:02 +00:00
Tim Volodine
90980b4208 [WebView Tracing API] documentation fixes.
Some fixes to the WebView Tracing API related documentation.
In particular this patch makes sure that:
- the defaults are correct,
- the examples are correct,
- the formatting is ok,
- the text for parameters etc.. is formatted consistently,
- the documentation is spellchecked and typos corrected.

BUG: 63750258
Test: manual inspection of the generated html documentation
Change-Id: I53ac1a1d003e519739464b8d8554f3d8262c46e4
2018-04-11 02:48:56 +01:00
Torne (Richard Coles)
905fad520c Merge "Only match addresses without zip codes if at the end." into pi-dev am: 2946fba398
am: 935210c8d5

Change-Id: I4ebf09353235d989b90260df56827ddcde862c43
2018-04-09 06:21:00 -07:00
Torne (Richard Coles)
cfaf8a1e5b Only match addresses without zip codes if at the end.
The old native implementation of findAddress only accepted addresses
without zip codes if they appeared at the end of the string. This was
probably a bug as the documentation implies this should work in all
cases, but fixing this bug has caused a lot of false positives while not
fixing very many false negatives and this functionality is being
deprecated anyway, so change it back.

Fixes: 75409267
Test: tested upstream in chromium; direct copy of that code
Change-Id: I3f3c300035cf02a23284737431bc6f94f542cbe7
2018-04-06 15:26:36 -04:00
Jan Althaus
92556299ff Merge "Add deprecation notice to Linkify MAP_ADDRESSES" into pi-dev am: 28709538fe
am: 44249c227f

Change-Id: I778ae94b99cf88ec0f6d943195f0074bdbdca5b2
2018-04-06 08:11:06 -07:00
TreeHugger Robot
28709538fe Merge "Add deprecation notice to Linkify MAP_ADDRESSES" into pi-dev 2018-04-06 14:55:00 +00:00
Gustav Sennton
afc4b118a4 Merge "Remove WebView.getLooper()." into pi-dev am: fffec6ea9d
am: 46256efbec

Change-Id: I8c612d4ed2990a886c7703e530d9c8de5e8a098a
2018-04-06 06:02:24 -07:00
Jan Althaus
003889a275 Add deprecation notice to Linkify MAP_ADDRESSES
Bug: 22362008
Test: N/A
Change-Id: Ib70e0cbdd8c454a96e5e75b906ace7b6f1e21cba
2018-04-05 19:04:26 +02:00
Gustav Sennton
7b02d98470 Remove WebView.getLooper().
We want to rename the method WebView.getLooper() to
WebView.getWebViewLooper().
We have already added the method WebView.getWebViewLooper() so with this
CL we remove the method WebView.getLooper().

Bug: 74831609
Test: make
Change-Id: I2d3c8ddeae032aa27ae3eed30d952a06b0abe854
2018-04-03 17:48:18 +00:00
Nate Fischer
92b2444252 Merge "WebView: clarify shouldInterceptRequest docs" into pi-dev am: 0cf0d1368a
am: a4d61f0342

Change-Id: I59893ba68a249b43f62001b8a7f2d72693dc2a23
2018-03-27 19:57:07 +00:00
Nate Fischer
db010230c1 WebView: clarify shouldInterceptRequest docs
No change to logic, this only changes documentation.

This clarifies how shouldInterceptRequest behaves for various URL
schemes as well as other edge cases (e.g., redirects).

Bug: 74841041
Test: make docs (manually verify)
Change-Id: Id59033590ea6025a00ae39c7b05486be082973e7
2018-03-26 19:11:30 -07:00
Tim Volodine
0b851859fa Merge "WebView Tracing API: remove LARGE_BUFFER, make RECORD_CONTINUOUSLY the default mode" into pi-dev am: 158a18108b
am: 03d64cdd9e

Change-Id: I98ab1007f8a597d337bfabfea14b0bf26be231e3
2018-03-21 18:46:47 +00:00
TreeHugger Robot
158a18108b Merge "WebView Tracing API: remove LARGE_BUFFER, make RECORD_CONTINUOUSLY the default mode" into pi-dev 2018-03-21 17:14:47 +00:00
Tim Volodine
1a07ccc07e WebView Tracing API: remove LARGE_BUFFER, make RECORD_CONTINUOUSLY the default mode
This patch:
- remove the RECORD_UNTIL_FULL_LARGE_BUFFER tracing option, because
  this does not appear really useful in the production setting as
  the buffer size limit exceeds the device memory and can grow
  uncontrollably large.
- make RECORD_CONTINUOUSLY the default mode for tracing, to make
  sure the least memory is used by default (typically 4x less than the
  previous default RECORD_UNTIL_FULL).
- add some missing IntDef values (to make them match with the constants)

BUG: 63750258
Test: CTS

Change-Id: Ib3698273dee776ebc7a8388fc1bd8c80255e3b63
2018-03-21 17:12:20 +00:00
Gustav Sennton
36f43708d9 Merge "Add API WebView.getWebViewLooper()" into pi-dev am: 6951716952
am: 283747b58c

Change-Id: I7a8b8c9e59436698098ac42ab93e4c99d70ac3e3
2018-03-21 12:29:07 +00:00
Gustav Sennton
6abde8b128 Add API WebView.getWebViewLooper()
We want to rename WebView.getLooper() to contrast it better with the
unrelated method WebView.getHandler(). For now we just create a method
to replace WebView.getLooper(), so that we can remove references to
WebView.getLooper() before removing it.

Bug: 74831609
Test: make
Change-Id: I8e493a67aa078f9c8ceea6706dc940abacfdd6e6
2018-03-20 20:39:52 +00:00
Andrew Solovay
3731e47d23 Merge "docs: Javadoc typo fix" into pi-dev 2018-03-14 22:59:22 +00:00
Torne (Richard Coles)
65cfac5455 Merge "Start the webview_zygote at boot, but in the background." into pi-dev am: ea50ff85e8
am: 4068992503

Change-Id: Ieea5b6df3848b09c235e1b0eee0db4403c06a754
2018-03-14 21:28:00 +00:00
Andrew Solovay
4ea753fab3 docs: Javadoc typo fix
Doc is staged to:

http://go/dac-stage/reference/android/webkit/WebView.html

Exempt-From-Owner-Approval: Doc-only change
Bug: 20926682
Test: make ds-docs
Change-Id: Ib966923b75c8a70da5415f38e4217caeecc44cbe
Merged-In: Ib966923b75c8a70da5415f38e4217caeecc44cbe
2018-03-14 19:23:11 +00:00
Andrew Solovay
b90acdfffe docs: Javadoc typo fix
Doc is staged to:

http://go/dac-stage/reference/android/webkit/WebView.html

Bug: 20926682
Test: make ds-docs
Change-Id: Ib966923b75c8a70da5415f38e4217caeecc44cbe
Exempt-From-Owner-Approval: Doc-only change
2018-03-14 17:46:38 +00:00
Torne (Richard Coles)
e062404371 Start the webview_zygote at boot, but in the background.
This reverts "Delay starting the webview_zygote until first use." but
instead wraps the start in a background task, to avoid blocking the
system server startup waiting for the zygote to be ready.

Bug: 73743583
Bug: 63749735
Bug: 74079433
Test: Verify webview_zygote already running after boot
Change-Id: Iacf968cc2d2857a92c6bacf4012dc88f098c6013
2018-03-14 12:57:16 -04:00
Felipe Leme
0890a69494 Merge "Implemented WebView.isVisibleToUserForAutofill()" into pi-dev am: ec174b28c4
am: 6b9a99b594

Change-Id: Ic4488d9750403041cf5b7857edfd517f75aebcc7
2018-03-12 23:32:55 +00:00
TreeHugger Robot
ec174b28c4 Merge "Implemented WebView.isVisibleToUserForAutofill()" into pi-dev 2018-03-12 20:35:53 +00:00
TreeHugger Robot
134b5c7490 Merge "hide serialization methods on Picture" 2018-03-10 00:02:50 +00:00
Mike Reed
99a83d26b1 hide serialization methods on Picture
Test: make

Bug: 14646703
Change-Id: I50bde70c16f7eaf3f31a373e5507a2c34a6eb1e7
2018-03-09 20:42:17 +00:00
Changwan Ryu
15e9afcb3b Expose WebView#onCheckIsTextEditor
WebView was never returning correct return value in
onCheckIsTextEditor(). However, startinput optimization work at
ag/3455281, requires a correct return value when switching between
windows. Chrome-side change (crrev.com/c/952217) has dropped into
66.0.3359.14.

BUG: 74199870
Test: manually verified
Change-Id: I954365a70f1ff2680ed9a6d76e695c1193a4cfa3
2018-03-08 11:13:28 -08:00
Felipe Leme
ef335260b2 Implemented WebView.isVisibleToUserForAutofill()
Bug: 73500079
Test: mmm -j35 frameworks/base/

Change-Id: I1a98d685f05cd6f2a8f7f62ffacd6c802557e5b6
2018-03-07 14:03:43 -08:00
TreeHugger Robot
9845f75a33 Merge "WebView: add @NonNull annotation to API" 2018-03-01 20:42:35 +00:00
Nate Fischer
65e3be0255 WebView: add @NonNull annotation to API
No change to logic, only an annotation change.

startSafeBrowsing() should never receive a null Context. This adds
@NonNull to hint to developers not to pass null Contexts.

Test: N/A
Change-Id: I46d863047bf7563ea2a1adf592f3f381be95ca49
2018-03-01 00:55:35 -08:00
TreeHugger Robot
3cddd037f4 Merge "WebView: relax URLUtil#isFileUrl()" 2018-02-28 23:11:37 +00:00
Robert Sesek
ffc4dd720d Merge "Delay starting the webview_zygote until first use." am: 6d9d717ab7 am: 99440a0ab8
am: 92697692b3

Change-Id: I4f810427f083d9b7874df7d90fc00a33967d9323
2018-02-28 18:32:39 +00:00
Nate Fischer
d674b09af2 WebView: relax URLUtil#isFileUrl()
This relaxes URLUtil#isFileUrl() to accept a prefix of "file:" instead
of requiring "file://". Chromium treats "file:path" as if the user had
typed "file:///path". An app may incorrectly believe it's safe to load
anything that URLUtil#isFileUrl() rejects, intending to refuse all URLs
which point to the file system.

Bug: 72848579
Test: cts-tradefed run cts -m CtsWebkitTestCases -t android.webkit.cts.URLUtilTest#testIsFileUrl
Change-Id: I7b3bba961523d4bdda6169a0f50fe7f1d1579e38
2018-02-27 20:59:29 -08:00
TreeHugger Robot
837d2076ad Merge changes I7ce670f5,I0bd2de38
* changes:
  Preload with RELRO sharing in the WebView zygote.
  Make WebViewLibraryLoader interface more flexible.
2018-02-27 16:11:02 +00:00
Robert Sesek
b21dbc220f Delay starting the webview_zygote until first use.
During boot, WebViewZygote.setMultiprocessEnabled() is called by the
WebView initialization logic. Starting the WebViewZygote here causes a
slowdown in the system_server boot process, so delay launching the
zygote until it is needed.

Previously the webview_zygote was launched by init, and merely
connecting to it in the boot process didn't have significant overhead.

Bug: 73743583
Bug: 63749735
Test: Boot a device, verify that webview_zygote process is not running.
Test: Launch "Third-party licenses" activity from Settings, and it
      renders correctly via the WebView.

Change-Id: I1352a5df95e4a793ac64862c439ba2573ddd2d18
2018-02-26 16:59:48 -05:00
Torne (Richard Coles)
f4f647e2e0 Preload with RELRO sharing in the WebView zygote.
Now that the WebView zygote is a child of the system zygote it has the
smae address space layout and can use the existing WebView native
library RELRO file.

Preload the native library using the RELRO file in the zygote, to share
this data with applications which are using WebView. This can save up to
1-2MB of dirty memory, replacing it with clean pages that are shared
with more processes and thus have a smaller impact on PSS.

Bug: 63749735
Test: CtsWebkitTests
Change-Id: I7ce670f5fcddae9e98631e21329840ef3ad52f9a
2018-02-26 16:23:09 -05:00
TreeHugger Robot
6169417fd5 Merge "WebView: fix docs for setSafeBrowsingWhitelist" 2018-02-22 04:08:02 +00:00
Nate Fischer
5a6ae8c739 WebView: fix docs for setSafeBrowsingWhitelist
No change to logic, documentation change only.

This changes "URL" to "host" everywhere in this API documentation.
This API never accepted a list of URLs, it only ever accepted a list of
hosts (e.g. "www.google.com" is ok, "http://www.google.com/" is not).
The original documentation was misleading.

Test: make docs (manually verify)
Change-Id: I3b57a2a160ff00ba8f92b30f6e3b4399e55f2ea0
2018-02-21 15:27:01 -08:00
Torne (Richard Coles)
ec572f6a81 Make WebViewLibraryLoader interface more flexible.
Pass the library file name to WebViewLibraryLoader.loadNativeLibrary
instead of passing the ApplicationInfo, which was only used to look the
native library file name up. This will allow loadNativeLibrary to be
called from the webview zygote, which doesn't have the ApplicationInfo
available.

Bug: 63749735
Test: CtsWebkitTests
Change-Id: I0bd2de38cd1a0112bbeee6225563d4d0add048e7
2018-02-21 16:20:24 -05:00
Robert Sesek
f9bd606fba Merge "Reparent the webview_zygote to be a child of the main app_process zygote." am: 1c81aa6375 am: 486190f87b
am: 0dd7cf0bb3

Change-Id: I9468ec63053f35814ec45b18572966d8adc93f3e
2018-02-21 02:47:07 +00:00
Robert Sesek
602d1323ed Reparent the webview_zygote to be a child of the main app_process zygote.
This uses the new ZygoteProcess.startChildZygote() method to launch the
webview_zygote, rather than having init start it. This will share more
memory between the app_process and the webview_zygote, reducing the
overall system footprint.

Bug: 63749735
Test: m
Test: Launch "Third-party licenses" activity from Settings, and it
      renders correctly via the WebView.
Change-Id: I3e39cd8adb9c099c92ee34640428916d90cb2b8f
2018-02-20 17:00:41 -05:00
Torne (Richard Coles)
5bc14af5fa Consider shared libs when precreating WebView classloader.
The change to handling of the deprecated Apache HTTP library means that
the WebView implementation package might have a non-empty shared library
list. Make sure to fetch shared libraries when querying WebView
implementations, and take them into account when constructing both the
actual classpath to be used to precreate the classloader, and when
deciding what the cache key for the precreated classloader should be.

Change-Id: I5e1409358d935e1c9f325db434bc6d4ef8ead759
Merged-In: I5e1409358d935e1c9f325db434bc6d4ef8ead759
Fixes: 65574359
Test: launch anything that uses WebView
(cherry picked from commit 4fd8aa51e4)
2018-02-20 15:41:12 -05:00
Torne (Richard Coles)
9b73804cae Add OWNERS for webview directories in framework.
Bug: 73450992
Test: N/A
Change-Id: I20e186eca8b02fa4e2d0eb729b94df8a36983906
2018-02-20 10:48:51 -05:00
Tim Volodine
bfd30802f7 Merge "WebView Tracing API: address comments from the API council." 2018-02-16 15:00:27 +00:00
Tim Volodine
88604f2f8a WebView Tracing API: address comments from the API council.
Address comments from the API council regarding the WebView Tracing API.

android.webkit.TracingController:
 * start() throws IllegalStateException if the system is already tracing
   (this is instead of returning false)
 * stop uses Executor instead of Handler
 * removed stop() (the method w/o arguments)
 * renamed stopAndFlush to stop
 * use OutputStream instead of a custom callback interface TracingOutputStream
 * dropped requirement for UI threading
 * updated documentation

android.webkit.TracingFileOutputStream:
 * removed the TracingFileOutputStream file completely (functionality
   replaced by the existing FileOutputStream)

android.webkit.TracingConfig:
 * removed example with CATEGORIES_NONE and “-input,-gpu”.
 * customCategories are List<String> instead of String
 * updated documentation
 * added two more predefined categories: CATEGORIES_ALL,
   CATEGORIES_ANDROID_WEBVIEW
 * some refactoring, added a Builder class
 * ensure that only include category patterns can be specified
 * uniform addCategories interface for construction
 * predefined category sets are a bitmask now

BUG: 71584598,71584599,63750258
Test: CTS
Change-Id: I615ef5f43d26968329182b09e7c26178f1f85ecc
2018-02-15 13:26:39 +00:00
Torne (Richard Coles)
de956b7f9b Improve docs for WebView data dir methods.
Update the javadoc for the WebView data directory methods to make it
more clear in what cases these APIs should be used, and what limitations
apply to applications with multiple data directories.

Bug: 63748219
Test: n/a
Change-Id: I98f49c7a75df00aedf2472731b915c3e30e6ba13
2018-01-30 11:41:35 -05:00
TreeHugger Robot
854211d15b Merge "Store WebView package signatures as Signatures instead of Strings" 2018-01-25 22:58:49 +00:00
TreeHugger Robot
04d0d0031a Merge "WebView: document Safe Browsing as 'on' by default" 2018-01-25 16:00:00 +00:00
TreeHugger Robot
88ffa32cad Merge "WebView: fix docs for setAllow*AccessFromFileUrls" 2018-01-25 15:23:27 +00:00
Gustav Sennton
0167369990 Add an API to fetch the WebView thread.
Some WebView APIs contain checks ensuring apps only use WebView APIs
from one single thread. The WebView Support Library should perform
similar thread checks. To do so we publish an API to get the WebView
thread, so that the support library knows which thread to check against.

Test: Ran the corresponding CTS tests.
Bug: 38220806
Change-Id: Ibab878e211d9594df6d39f99ce130e28fac7f019
2018-01-24 14:39:45 +00:00