* changes:
ethernet: remove callback from factory updateInterfaceLinkState
ethernet: updateConfiguration result should not rely on ip provisioning
ethernet: remove callback boilerplate from EthernetNetworkFactory
ethernet: add EthernetCallback class to wrap OutcomeReceiver
updateInterfaceLinkState already returns true / false depending on the
success, so the EthernetCallback can be removed and sent from
EthernetTracker instead.
Test: atest EthernetManagerTest
Bug: 225317892
Change-Id: Id6ae7929097840ac5c9a4d244fdf669a06b94ed5
In addition, the result should always be success if the new
configuration is stored. This allows updating interfaces that are not
currently registered with ethernet service.
Bug: 236312641
Test: atest EthernetManagerTest
Change-Id: I70474ef5f046c65a6f74161137e25debd8dfe612
The OutcomeReceiver that gets passed into the EthernetServiceImpl is
hard to use (it is nullable and both onError and onResult can throw
RemoteExceptions).
Note: This is an intermediary state.
The next step will be to completely tear EthernetCallback out of
EthernetNetworkFactory, which will remove a lot of boilerplate code.
Bug: 225317892
Test: atest EthernetManagerTest
Change-Id: Ifc0e1ba29ded933c418e4b335cb731c3496d7e44
This is a preparation for testing SkDestroyListener that removes
cookieTagMap entry when socket is destroyed.
Bug: 217624062
Test: atest NetworkStatsServiceTest
Change-Id: Ia1091130101360e37557e6f00efe0f736134de05
The test scope of ConnectivityService should verify how and
what ConnectivityService works in the unit test, so remove
the VpnManagerService related mocking from ConnectivityServiceTest.
This commit replaces the way to handle package added/remove and
user unlock intent in VpnManagerService. The flows interacting
with those intents in VpnManagerService are verified in
VpnManagerServiceTest, so unit test still maintains the same
coverage.
Bug: 230548427
Test: atest ConnectivityServiceTest
Change-Id: Ia2279bd1023296e3c949fa05bd74e921bf17da79
This is a no-op refactoring which uses common PerUidCounter
from the static library and delete the private implementation
inside ConnectivityService. This refactoring includes:
1. Make a private implementation that inherite PerUidCounter
to convert and rethrow exception to maintain backward
compatibility.
2. Adjust per-uid max limit argument in the counter constructor
since the private implementation is already buggy.
3. Use the getter in PerUidCounter for the existing tests.
Test: testNetworkCallbackMaximum
testProfileNetworkPrefCountsRequestsCorrectlyOnSet
testRequestCountLimits
Bug: 235771502
Change-Id: I5c49edab18774acf819828201041c9931fabccc4
This also imports FunctionalUtils (ex-ExceptionUtils) with
its new name, as the companion change changes the name of
that class.
Test: ConnectivityServiceTest
Change-Id: I3fbc28835419864e536dd6727670328658a9b7cf
Revert "Grant the ACTIVATE_PLATFORM_VPN appop if VPN app has CON..."
Revert submission 2141595-GRANT_PLATFORM_VPN
Reason for revert: Refer to the comment in ag/19491935.
Reverted Changes:
I0e0566bb8:Grant the ACTIVATE_PLATFORM_VPN appop if VPN app h...
I0580baca6:Test if VPN app can grant ACTIVATE_PLATFORM_VPN wi...
Change-Id: I9208fc124a5d37014b28e531da271e43e47c165a
this is the case for example when a tethering dun is in use
Bug: 235523181
Bug: 241055859
Change-Id: Ie261db0329179ff7f92c61202af30ab55130ae03
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
If the binder death notification for a INsdManagerCallback was
received before any calls are received by NsdService, the
clientInfo would be cleared and cause NPE. Thus, add a null check
to prevent crash.
Bug: 241741274
Test: atest FrameworksNetTests
Change-Id: Iebe761cd579bf3ee46ead389620bed60a21e3154
The netd based InterfaceObserver uses two different netlink sockets for
updates on interface added / removed and link up / down events. This
means that these events are not ordered, which causes lots of
interesting issues in the ethernet service. Netd does not use
RTM_DELLINK at all, so this code has to use NetlinkMonitor to do
implement its own link tracking.
The EthernetManagerTests are currently disabled. There are still a
couple of flakes: one due to some link state issue which stops occurring
when bringing up the interface in TestNetworkService (weird -- I don't
yet know why this happens). Another due to the maybeTrackInterface
looking at the running flag (which races with the bringup code).
Test: atest EthernetManagerTest
Bug: 218785176
Bug: 234314411
Change-Id: I92b737f693402c1a8fd0a864736673de94904f2d
* changes:
Make the temporary NC sanitized instead of inlining
Remove the legacy int from FullScore.
Remove accessors for legacy int score from NAI
Log the creation time of network agents
Show time taken by the rematch
Address some IDE warnings in ConnectivityService
Copy arguments from NetworkAgent registration early
To decouple VpnManagerService from ConnectivityServiceTest, stop
calling setAlwaysOnPackage from VpnManagerService as a
preparation for the follow up changes. Update it to equivalent
calls from Vpn directly.
The VpnManagerService variable is still needed because tests
have indirect calls via sending intent to update the lock
down behavior.
Bug: 230548427
Test: atest ConnectivityServiceTest
Change-Id: Ib78ac8173b2a4d2a8e9845e943eb63d79c36218c
This commit verifies the lock down related flows:
- When a user present
- When lock down is reset
- Create LockdownVpnTracker
- isVpnLockdownEnabled(int)
- getVpnLockdownAllowlist(int)
Bug: 230548427
Test: atest VpnManagerServiceTest
Change-Id: Ic42d884b64d2c7ec0caf9dff95d94fc5e52456b2
To make sure anyone using the capabilities originally from
the agent have to know what they're dealing with, make the
member private and make accessors that spell out explicitly
the important parts.
This is the last step towards addressing the leftover
comment from aosp/1958906.
Bug: 238139913
Test: FrameworksNetTests CtsNetTestCases
Change-Id: I9fc1986c59726212acfc2ad921745c8bbc424035
This is a nice cleanup and will clear misunderstandings where
people mistakenly look at it in the logs.
Unfortunately it can't be removed from NetworkScore because there
are public APIs, and it's even used to transmit invincibility in
a legacy spur.
Bug: 238139913
Test: ConnectivityServiceTest
Change-Id: Ibdaf2b235b994383d5f8f42f1780b04bda80c93a
These are no longer useful. Also, NAI no longer needs to
be comparable, and it should no longer be – comparing 2
NAIs only make sense in the context of a specific request.
Bug: 238139913
Test: ConnectivityServiceTest IpConnectivityMetricsTest
Change-Id: I6967ad6f08380213c29f3d47d6422f8bbea1946c