Commit Graph

3887 Commits

Author SHA1 Message Date
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Anna Malova
913e00c8c2 Rename PacProcessor#releasePacProcessor to PacProcessor#release.
Bug: 170226229
CTS-Coverage-Bug: 169844605
Test: n/a
Change-Id: Iba954d0a2784e69156dd1be14714a1c53b7bec07
2020-10-14 18:56:27 +00:00
TreeHugger Robot
0936ab496c Merge "Reland "Enable new S APIs for WebView.""" 2020-10-13 21:22:15 +00:00
Richard Coles
2fce8b0e83 Reland "Enable new S APIs for WebView.""
This reverts commit 039e10f76a.

New WebView binary has now been dropped, fixing the strict mode issue that necessitated a revert.

Change-Id: I86644e8a216c7087d7a00294d2b7f9ddb1705968
2020-10-13 19:24:00 +00:00
TreeHugger Robot
838cb845f1 Merge "Revert "Enable new S APIs for WebView."" 2020-10-02 21:02:10 +00:00
Nate Fischer
039e10f76a Revert "Enable new S APIs for WebView."
This reverts commit cfa9b7033c.

Reason for revert: WebView M85+ has a strictmode violation

Bug: 169877920
Change-Id: I46a26c16d83debc548217538200c6736ab8abeae
2020-10-02 18:35:41 +00:00
TreeHugger Robot
87ce51b8ed Merge "Enable new S APIs for WebView." 2020-10-01 23:26:46 +00:00
TreeHugger Robot
b9d481bdaf Merge "WebView: update loadUrl documentation" 2020-10-01 15:28:00 +00:00
Laís Minchillo
883b165d48 WebView: update loadUrl documentation
No change to logic, only docs. Updates loadUrl documentation to make it
clear that some WebView versions require the Map parameter to be
mutable.

Bug: 145881245
Test: m offline-sdk-docs -j4
Change-Id: I15f3c48f02090b8855880ff5d39c02aa28d4dfa8
2020-10-01 09:39:29 +00:00
Anna Malova
351256d16a Update methods of PacProcessor.
See discussion in b/149000014 for more information.

Bug: 168455630
Test: n/a

Change-Id: I3b63a0120b151a41ed219dcec818c6a400d03daa
2020-09-30 12:50:04 +01:00
Anna Malova
242def4269 Use Network object instead of network handle and expand documentation.
Bug: 165192953
Bug: 165307632
Test: N/A
Change-Id: I5e2d22d3c332debe33d0cc617f86071b5926c50a
2020-08-19 13:46:02 +01:00
Felipe Leme
b07b092f9e Refactored some UserManager.getUsers(excludeDying) calls.
Replaced by getUsers() when exlcudeDying was hardcoded to false, or
getUsers(true,  excludeDying, true) when it was a variable.

This refactoring will help replacing getUsers(true) to getAliveUsers().

Bug: 157921703

Test: m
Test: atest atest LockscreenFrpTest LockSettingsServiceTests SyntheticPasswordTests

Change-Id: I139462ab329fe46d8136eae0a39ac071a7e019db
2020-08-12 15:03:37 -07:00
Anna Malova
1d0dede72d Add new methods to PacProcessor to
- allow multiple PacProcessors
- allow network-aware DNS lookups in PAC scripts

Bug: 162785263
Test: n/a

Change-Id: I39432d8f6358e386527b00b58d92e74ef32763d1
2020-08-06 14:44:32 +01:00
Torne (Richard Coles)
cfa9b7033c Enable new S APIs for WebView.
Make WebViewFactory create the *ForS version of the WebView factory
provider, and require that WebView implementations target at least S to
be valid.

Test: atest CtsWebkitTestCases
Change-Id: I21a1dc9a9084c1086bba52921bd19ba968544a9c
2020-08-05 16:44:34 -04:00
Nate Fischer
36f0f45750 WebView: remove non-inclusive terminology from docs
No change to logic, only docs. This removes non-inclusive terminology
("whitelist") from our API javadoc, with the exception of references to
setSafeBrowsingWhitelist() (which we plan to deprecate soon, in favor of
an inclusively named API).

This rephrases one paragraph to be a bit clearer as well.

Bug: 160928306
Test: m offline-sdk-docs -j4
Change-Id: If249be8a70b01c01390ebfeb418fd7c5e119f1f2
2020-07-23 10:53:27 -07:00
John Reck
ee26d1ef65 Merge "Remove legacy callDrawGlFunction2 from HWUI" 2020-06-30 19:09:37 +00:00
John Reck
aa4c982294 Remove legacy callDrawGlFunction2 from HWUI
Bug: 151439970
Test: CtsUiRenderingTestCases passes

Change-Id: I1c29df17bb6e8b078467edf73cb3547db6948cdd
2020-06-26 13:49:05 -07:00
Changwan Ryu
47c0a48089 [WebView] Listen to window insets change
Overriding these methods in preparation for notch and safe area implementation
for WebView.

A corresponding implementation for Chrome app does this:
https://source.chromium.org/chromium/chromium/src/+/master:components/browser_ui/widget/android/java/src/org/chromium/components/browser_ui/widget/InsetObserverView.java;l=179;drc=b17e62321db0f69a9131d3bb87ab9cef502a0eaf?originalUrl=https:%2F%2Fcs.chromium.org%2F

An alternative would be to call View#setOnApplyWindowInsetsListener(),
but that might not be as straightforward and might conflict with app's own
usage around windowinsets.

Returning null from a default implementation and use super method until
we can actually implement it in the chromium repo.

(Note: I would like to merge this to R if possible.)

Bug: 159610496
Test: CL does not break build/test.
Change-Id: Ic0421d7347e8091e02af6c9d5a24fdb334f37c47
2020-06-25 17:15:26 -07:00
TreeHugger Robot
b1837c419f Merge "webkit: add a note regarding FLAG_SECURE for default dialogs" into rvc-dev am: f7484457cd am: bedf7e5161 am: ed9855498f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11617993

Change-Id: Id04faa91cf3c8f614ad5197506ef3e658569ffd1
2020-06-03 18:09:22 +00:00
Changwan Ryu
a9e2ed7bbd webkit: add a note regarding FLAG_SECURE for default dialogs
Child windows do not inherit FLAG_SECURE from parent windows, and
therefore, the default dialogs for JS callbacks do not have this flag
even when the app window has it.

This CL adds a note warning about this behavior to mitigate the
potential vulnerability.

Bug: 120086187
Test: m -j offline-sdk-docs seems not broken
Change-Id: I12f12befd1f303d26ebc866f4817f5184279caeb
2020-06-01 13:56:47 -07:00
TreeHugger Robot
55deb7e9f8 Merge "webkit: Update documentation for onJsBeforeUnload callback" into rvc-dev am: a203c27aa9 am: 346676a352 am: 52451f3b71
Change-Id: I131ad095a2ad012a56d6b7acc6bbd759054e3655
2020-05-27 21:18:14 +00:00
Changwan Ryu
a56c69eae0 webkit: Update documentation for onJsBeforeUnload callback
Fix documentation to clearly indicate that the default behavior is to
show WebView's own default dialog, and also describe the default
behavior more clearly and how to customize it.

Bug: 154014645
Test: m -j offline-sdk-docs seems not broken
Change-Id: I7d1e10c5d406ed739fb3963b9099791cfce95063
2020-05-27 12:09:32 -07:00
TreeHugger Robot
bc5dbbaa83 Merge "webkit: Update documentation for onJsConfirm, onJsPrompt callbacks" into rvc-dev am: a0b41154fe am: c82858208b am: 08b24a4d1c
Change-Id: I0c6e831a6fc98b014d705e69ced0397ba21d2af7
2020-05-20 06:17:48 +00:00
TreeHugger Robot
a0b41154fe Merge "webkit: Update documentation for onJsConfirm, onJsPrompt callbacks" into rvc-dev 2020-05-20 05:44:33 +00:00
Changwan Ryu
dd4f03d419 webkit: Update documentation for onJsConfirm, onJsPrompt callbacks
Fix documentation to clearly indicate that the default behavior is to
show WebView's own default dialog, and also describing clearly default
dialog behavior and how to customize it.

Note that onJsBeforeUnload is not updated at the moment as I could not
find a way to reproduce it.

Bug: 154014645
Test: m -j offline-sdk-docs seems not broken

Change-Id: I5ee09ea35340eb8d17353eda1786dcebcff4a29e
2020-05-19 14:30:44 -07:00
TreeHugger Robot
58eb2d8c64 Merge "Update deprecation note for Application Cache." into rvc-dev am: 6da69cadba
Change-Id: I298b276efe0bbe78aa7c4f6feb84f58c7cc7ff91
2020-05-18 19:18:17 +00:00
Torne (Richard Coles)
fc23be81bd Update deprecation note for Application Cache.
Update the deprecation note for WebSettings.setAppCacheEnabled and
related to mention the public blog post about the feature being removed.

Fixes: 156409857
Test: m offline-sdk-docs
Change-Id: I0481937d665f3f16b61b921aa19e306ba8bb16e0
2020-05-18 13:40:40 -04:00
TreeHugger Robot
94a9640197 Merge "webkit: Update documentation for onJsAlert callback method" into rvc-dev am: e0a73b1bb6
Change-Id: I558dcc2c3f5f093d27fccd6b54ad12f746c9bed9
2020-05-13 18:20:09 +00:00
Changwan Ryu
31e2db92ce webkit: Update documentation for onJsAlert callback method
Fix documentation to clearly indicate that the default behavior is to
show WebView's own default dialog.

Also, change some wording to avoid confusion.

Bug: 154014645
Test: m -j offline-sdk-docs seems unbroken
Change-Id: I3f6676094e5472aa99bb014cf2b489f59133d094
2020-05-13 16:52:24 +00:00
TreeHugger Robot
02027c3a3d Merge "Deprecate WebSettings.setAppCacheEnabled and related." into rvc-dev am: 291cf5d293
Change-Id: I14d91abc884fecfc0c92c7fd4ffac56324de79a6
2020-05-12 19:28:29 +00:00
Torne (Richard Coles)
76752c8f02 Deprecate WebSettings.setAppCacheEnabled and related.
Chrome will be removing the Application Cache API in future; deprecate
the APIs in WebView which allow Android apps to enable it.

Test: make offline-sdk-docs
Fixes: 156266477
Change-Id: I0feff5289706b5f7985013a18d9cf0e3e6b3ba78
2020-05-12 11:57:30 -04:00
Automerger Merge Worker
6cbf2ff3eb Merge "Move yesterday/today Strings from LocaleData into a new ICU class" am: 05f3bf50d6 am: c1130c259b
Change-Id: I896db229cc70105a79687becd1d79a3c1d77553c
2020-03-12 18:46:44 +00:00
vichang
05f3bf50d6 Merge "Move yesterday/today Strings from LocaleData into a new ICU class" 2020-03-12 18:17:06 +00:00
Victor Chang
b8fd6681b5 Move yesterday/today Strings from LocaleData into a new ICU class
Note that the strings are no longer cached here to avoid permanent
app Java heap growth due to strong cache. Consider that no user of DateSorter
exists in the platform, and the API is legacy. The impact on app performance
is expected to be very low.

Bug: 144560585
Bug: 138994281
Test: atest CtsWebkitTestCases:android.webkit.cts.DateSorterTest
Change-Id: I659d430901cf1838befc0a35f5188d069169e824
2020-03-10 18:51:21 +00:00
Hazem Ashmawy
7536c2bda0 Android WebView: Deprecate unsafe file urls APIs
Deprecate unsafe:
- WebSettings#setAllowUniversalAccessFromFileURLs
- WebSettings#setAllowFileAccessFromFileURLs
- CookieManager#setAcceptFileSchemeCookies

And direct the users to use WebViewAssetLoader instead.

Bug: 148841999
Test: m offline-sdk-docs -j20
Change-Id: I607d1343cb2aa5baead49ceff6dbac4a4474009c
2020-03-05 19:56:07 +00:00
Hazem Ashmawy
ee824f006b WebView: Update setAllowFileAccess doc to reflect new default value
Update setAllowFileAccess java docs to reflect that it's now disabled by
default after merging crrev.com/c/2056824. Also add a note to use
androidx WebViewAssetLoader instead.

Bug: 148840827
Test: m offline-sdk-docs -j20
Change-Id: I15866ab63818771fd91f40828846d6b4c39d278e
(cherry picked from commit 47a4c2da51)
2020-02-26 12:26:36 +00:00
TreeHugger Robot
d73f4e387c Merge "WebView: deprecate 'Secure' cookies for insecure schemes" 2020-02-17 10:56:03 +00:00
Nate Fischer
bc22d8638b WebView: deprecate 'Secure' cookies for insecure schemes
No change to logic, only docs. This announces 'Secure' cookies are
deprecated for insecure URL schemes (only "https://" is considered
secure). This doesn't mention target SDK, because apps should follow
this guidance for all WebView versions, target SDKs, and OS levels.

Bug: 149589092
Test: m offline-sdk-docs -j4
Change-Id: I07c2b5341588d354f7f8219ce71a3d2ca04bc982
2020-02-14 15:04:56 -08:00
Anna Malova
4454e20081 Switch to WebViewFactoryProviderForR.
Test: n/a
Change-Id: I855463395044045b0ad1c7904a9aeb6fd32eaf54
2020-02-13 17:45:09 +00:00
Torne (Richard Coles)
51c221ab4e Mark nullability in WebViewProviderResponse.
The packageInfo can be null when the system is in a bad state and has no
WebView implementation; mark it @Nullable to make this clear.

Test: m
Change-Id: I9f87adf46809b9f1d4d6e68f35ec0fa18617834d
2020-02-12 13:39:14 +00:00
Torne (Richard Coles)
a528189652 Clarify WebResourceRequest.isForMainFrame docs.
Make it more explicit that isForMainFrame() returns true only for the
actual main frame document, and not for any subresources, even if they
are subresources of the main frame.

Test: make ds-docs
Change-Id: I942cbe6a8f50d2f3af00b99b14a8503c8c4556de
2020-02-07 13:36:44 +00:00
Anna Malova
113d302b49 Rename PacProcessor#makeProxyRequest to PacProcessor#findProxyForUrl.
This name corresponds to the name of PAC script function.

Bug: 148068051
Test: N/A
Change-Id: I722318988367d86d149ddd7d5020022f7734adff
2020-01-21 16:24:53 +00:00
Anna Malova
09f00a48c3 Add PacProcessor system API.
PacProcessor is intended to be used as an internal implementation detail of
com.android.pacprocessor.PacService, which in turn implements the java.net.ProxySelector interface.

Processing the PAC file requires starting up an instance of V8
so is expected to be handled by the central system service and queried over IPC (PacService),
not for apps to try to run it themselves.

Bug: 147578322
Test: N/A.

Change-Id: I857bb3616d7029fa0d42bf25def50f46094ec1d9
2020-01-13 13:57:59 +00:00
Automerger Merge Worker
bd4e71148a Merge "Use new UnsupportedAppUsage annotation." am: 39f329c52a am: 62169a75cc
Change-Id: Ib94ae7e9f19c543d0180e3a547fc02f55c055ca7
2020-01-10 15:16:49 +00:00
Artur Satayev
a900cb533f Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I5be7335b23a92b8ac80d2fd890198273b66ad644
Merged-In: I5be7335b23a92b8ac80d2fd890198273b66ad644
2020-01-09 14:59:34 +00:00
Artur Satayev
ad9254cb1d Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I5be7335b23a92b8ac80d2fd890198273b66ad644
2019-12-18 16:27:02 +00:00
Laís Minchillo
c1360b215e [webview] Annotate API parameters as @Nullable or @NonNull
Annotate WebView API parameters as either @Nullable or @NonNull. When a
method returns a nullable type, add this to the javadoc as well.

Deprecated methods were ignored.

Bug: 119254822
Test: none (only changes annotations, no change in logic)
Change-Id: I701108240fd5905e1085a9e8bcce44567e517892
2019-12-03 11:14:45 +00:00
Artur Satayev
751e55114c Add @UnsupportedAppUsage annotations for greylist.
go/cleanup-greylist-txt

These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.

This is partial merge of aosp/Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09. Telephony greylist cleanup has been done separately. Note that annotations outside of frameworks/base/ have been merged from AOSP.

Bug: 137350495
Test: m
Exempt-From-Owner-Approval: merge
Change-Id: I015c466e8b69cc0fed5e9d394ba865aad11d8ba6
2019-11-19 15:05:35 +00:00