Skip to content
Commit b770235a authored by Rubin Xu's avatar Rubin Xu
Browse files

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
parent 05cf3e89
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment