Commit Graph

3670 Commits

Author SHA1 Message Date
Andrei Onea
890db3d672 Add @UnsupportedAppUsage annotations
For packages:
  android.speech
  android.telephony.mbms.vendor
  android.view
  android.webkit

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Merged-In: Iefe25091fa0fcc0adfe4ff85fe5e3ab3ac9c5f10
Change-Id: I04104cf3852a0a7440676ccc55dd96c1eec730c4
2019-03-06 15:43:49 +00:00
Xin Li
0e71b4f19b DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
2019-02-14 09:48:06 -08: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
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
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
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
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
TreeHugger Robot
679e58a8d3 Merge "WebView: fix TracingController example usage" into pi-dev 2018-09-20 18:57:55 +00:00
Nate Fischer
9e39bf1067 WebView: fix TracingController example usage
This fixes a minor mistake in the TracingController class usage. The
example previously used a bare `CATEGORIES_WEB_DEVELOPER` instead of
`TracingConfig.CATEGORIES_WEB_DEVELOPER`.

Bug: 116227333
Test: make docs
Change-Id: I648dd0d5e61666e61adb27303c185013bd80b0ea
2018-09-20 18:17:05 +00:00
Nate Fischer
211d6159b9 WebView: fix SafeBrowsingResponse javadoc bug
No change to logic, only minor javadoc change.

This fixes javadoc in SafeBrowsingResponse.java. Previously, the first
(and only) sentence did not end in a period (it ended with a quote
character). The Android javadoc parser doesn't handle this well--it
requires a period followed immediately by some whitespace character.

This wasn't a big issue because this was the only sentence. However, if
we ever add a second sentence, both sentences will appear as the
one-line "synopsis doc" for the methods.

See http://go/android-api-guidelines#heading=h.teqny5h9ohqc for details.

Bug: 115441402
Test: make docs
Change-Id: Ic363ed1ecf3d169d598ae85d55297d0a520a6604
2018-09-12 17:26:41 -07:00
Mathew Inwood
5e2a54ab19 Merge "Add @UnsupportedAppUsage annotations"
am: 9513a9e215

Change-Id: I347d6893209c55b6e6029034db1b42957f27306a
2018-08-20 11:32:10 -07:00
Mathew Inwood
42afea26b8 Add @UnsupportedAppUsage annotations
For packages:
  android.webkit

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ic22415d3e70a3b75a6418f96beb371d0445c7484
Merged-In: I41643e1e47391a12b0aed3058b3d9987a8e6ee2f
2018-08-16 19:18:28 +01:00
TreeHugger Robot
b76b6c5a43 Merge "Update WebView#clearClientCertPreferences docs." into pi-dev 2018-08-14 18:22:49 +00:00
TreeHugger Robot
0d75830053 Merge "Update WebBackForwardList javadoc." into pi-dev 2018-08-14 14:09:20 +00:00
Torne (Richard Coles)
7def66c676 Clarify WebView's lack of plugin support.
Update docs to clarify that plugins are in fact not supported from K
onward and that enabling them doesn't do anything.

Bug: 112579915
Test: m offline-sdk-docs
Change-Id: I8678ea716be0adc4cd3a6fae1b4776e312ec29e0
(cherry picked from commit 1676c95ddc)
2018-08-14 13:43:29 +00:00
Torne (Richard Coles)
5326772106 Update WebView#clearClientCertPreferences docs.
Remove the reference to the specific ACTION_STORAGE_CHANGED intent as
other intents are used instead on newer OS versions; just note that it's
cleared automatically when the keychain is updated and don't specify the
exact mechanism.

Change-Id: Ic677832a1384e0eb2498d06e7aa34507fd2e7278
Fixes: 30371615
Test: make offline-sdk-docs
(cherry picked from commit 01eb128213)
2018-08-13 21:30:34 +00:00
Torne (Richard Coles)
e4b86644bb Update WebBackForwardList javadoc.
Update javadoc for WebBackForwardList and WebHistoryItem. Remove
references to history items being updated as this no longer occurs, and
clarify in clone() that there's no need to acutally do this any more.

Also remove a bunch of implementation notes about
atomicity/synchronisation that are being rendered attached to the return
value and likely aren't even true any more, let alone relevant to
developers.

Bug: 74593032
Test: make offline-sdk-docs
Change-Id: I4ce33133d2ff18e7376d768c7a2e076ecd2a8b95
(cherry picked from commit 8949046528)
2018-08-13 21:30:23 +00:00
Paul Miller
f2043b4af5 Clarify WebViewClient.shouldOverrideUrlLoading docs
Call out more explicitly the antipattern of calling loadUrl with the
same URL and returning true, and repeat this on the deprecated version.
Simplify the wording about returning true v.s. false. Switch to the
"note" style used elsewhere on the page.

BUG:111843379
Change-Id: I36c31a8e0f4754c314b8a4d72cc497c9c3a3e242
Test: make docs
(cherry picked from commit 3819a6467b)
2018-08-08 21:56:31 +00:00
Laura Davis
b444e2d99e Docs: Removed narrative content.
Test: make ds-docs

Bug: 110268338
Change-Id: Ifaa4096d075500f1c7a53b1eec9e1944ed2ddda6
2018-07-16 16:02:47 -07:00
Laura Davis
3311624d54 docs: fixed broken link
Test: make ds-docs

Bug: 110243990
Change-Id: Ia6f487ce88d59def5d6974c0d63d67c29ec5cf34
2018-06-18 14:49:23 -07:00
Torne (Richard Coles)
97bf0beaf3 Update security-related WebView documentation.
Add a number of notes for application developers related to using the
WebView securely.

Change-Id: I7dba78d35bc36dd719ed0629224fe3a1d197f52c
Bug: 80095507, 79169416, 79169397, 79170052, 79170398
Fixes: 78941917
Test: m offline-sdk-docs
2018-05-22 15:32:47 -04: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)
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
TreeHugger Robot
28709538fe Merge "Add deprecation notice to Linkify MAP_ADDRESSES" into pi-dev 2018-04-06 14:55:00 +00: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
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
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
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
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
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
TreeHugger Robot
ec174b28c4 Merge "Implemented WebView.isVisibleToUserForAutofill()" into pi-dev 2018-03-12 20:35:53 +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