Commit Graph

11 Commits

Author SHA1 Message Date
Pavel Grafov
3f0400e221 Delay instantiation of PacProcessor until unlocked
Webkit PAC processor cannot be created before the user is unlocked,
this is currently causing crashes during boot.
With this CL PacProcessor instantiation is delayed and will happen
only when the user is unlocked either when handling a request or
when PAC script is set.

Instantiation of PacProcessor can take substantial time, on order
of a second.

Bug: 200241231
Test: manual, set PAC proxy and reboot
Change-Id: Id42d857289a0b0f7df5b1c48f94d1b363d94235e
2021-10-13 15:10:55 +01:00
Anna Malova
8b82c22d00 Remove libpac usage from Android.
Android's libpac is replaced with WebView implementation.
This will allow to remove V8 which is used only by libpac.

Bug: 165006496
Test: Manual. Remove libpac and v8 from manifest, check there are no
compilation errors.
Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testProxyPacProxyTest
Change-Id: Id6b9a223c176ce1b2dd7f7c4dd9ee54001dae1a4

Change-Id: If3ee10fcd0306b4b7a3c8b498e877d59398f642a
2020-09-23 14:01:54 +01:00
Treehugger Robot
b803e8bf8d Merge "Fully remove startPacSystem() and stopPacSystem()" am: c7b4009f3e am: a93a01f9eb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1229603

Change-Id: Ib737ebd197e06ea673522bcc31cc37e9dcf05a31
2020-07-16 13:58:59 +00:00
Anna Malova
23782a50ab Use synchronize methods instead of synchronized blocks in PacWebView.
No change in logic.

Bug: 148516710
Test: atest DeviceOwnerTest#testProxyPacProxyTest
Change-Id: Id8089ff4e93b6b6df6547c226610be99ae5dabb1
2020-02-12 13:03:41 +00:00
Anna Malova
29ed0cc421 Implement PacService using WebView's version of libpac.
Add config flag to choose between PacService implementations.
Added flag (config_useWebViewPacProcessor) is disabled
by default for now.

Bug: 148516710
Test: atest DeviceOwnerTest#testProxyPacProxyTest
Change-Id: I5d376a2a37f1bfb7ba5268c0088bf4417434b8f5
2020-02-11 12:54:26 +00:00
Rubin Xu
9a704772dd Fully remove startPacSystem() and stopPacSystem()
Test: atest --iterations 200 com.android.cts.devicepolicy.DeviceOwnerTest#testProxyPacProxyTest
Bug: 147359729
Change-Id: I61dd371d457cf2282c9e7a963f8afd75ca214eaf
2020-02-10 11:05:20 +00:00
Rubin Xu
b770235a86 Mitigate race conditions in PacService
There are some design limitations in PacService (one-way aidl calls
from ConnectivityService) that causes it to be racy when PAC proxy are
set and cleared in quick succession. Attempt to mitigate them with the
following changes:

1. Make PacNative a singleton instead of one instance per binder. The
underlying v8 engine is singleton so it makes little sense to have
multiple instances of the PacNative wrapper.
2. Remove the startPacSystem and stopPacSystem API and bind the
PacNative lifecycle to the PacService. Otherwise the one-way
stopPacSystem() binder call could have raced with a next
startPacSystem() call when PAC proxy is cleared and then set.

For this change, startPacSystem() and stopPacSystem() and made no-op
only. They will be fully removed in the next change.

Test: atest --iterations 200 com.android.cts.devicepolicy.DeviceOwnerTest#testProxyPacProxyTest
Bug: 147359729
Change-Id: Ie3ce098167694421f8bd2a6dec85d7c437cfb0be
EDIT
2020-02-10 11:05:12 +00:00
Jiyong Park
d6be579720 Use filegroup to simplify Android.bp for frameworks and its friends
Java and AIDL source files under frameworks/base are now modularized
using filegroup. Each filegroup has 'path' property set to the base
directory of the ssource files. This allows us to not rely on
aidl.[local_]include_dirs and srcs_lib_whitelist_dirs to get the base
directories.

Bug: 70046217
Test: m
Exempt-From-Owner-Approval: Approved internally
Merged-In: I0705ddf76b3c628127f65d75e0a8b06c6c250fe2
(cherry picked from commit b360931bf0)
Change-Id: I0705ddf76b3c628127f65d75e0a8b06c6c250fe2
2019-08-26 08:09:49 +00:00
Andrei Kapishnikov
44c0259037 Do not throw NullPointerException from PacService
Do not throw NullPointerException from PacService
since the calling client may not expect it and crash.

Fix of Bug 18818567

Change-Id: Ic36e8a1ca13cdaa7f605b6ade9cc6783517cbf40
2015-01-16 15:57:55 -05:00
Jason Monk
7a6af1c093 Verify inputs to PAC resolving.
This verifies both the URL and host are valid before they are passed to the
javascript for PAC.  This is to protect against injection attacks.

Bug: 10230771
Change-Id: Ib1996181971a49ccd390f181ec3848124801e4d5
2013-08-22 15:46:11 -04:00
Jason Monk
9ced3cd9d6 Change PacProcessor to Android Service
This switches the PacProcessor over to an Android Service.  The service
is bound and unbound by the PacManager, which also adds it to the
ServiceManager, allowing for Context-Free access by the PacProxySelector
in all DVMs.

bug:10182711
Change-Id: Id1ff7660be56e8976cdcccd76e041feb47a17a61
2013-08-20 17:36:39 -04:00