Linger timer mechanism will be used for both "linger" and
"nascent" states. To prevent confusion, rename the linger
timer and related functions to more generic name.
Test: TH
Bug: 175180558
Change-Id: I652f7c65c2f8bc58fb9d3316480f23a9709eccce
This is a partial cherry-pick of change:
I5eedb571c9d78862115dfdc5dae1cf2a35343580
for connectivity classes.
Bug: 170883422
Test: m
Merged-In: I5eedb571c9d78862115dfdc5dae1cf2a35343580
Change-Id: I7dc661863b73f4198ddb4f3a1566583d0f07db3c
These tests do not actually work, or at least not as designed.
What happens when they are run is that creating/connecting the
VPN throws an exception. The call to legacyRunnerReady.block()
times out after 10 seconds because the condition variable is
never opened, but the doesn't notice the timeout becasue it
doesn't check the return value of block().
There are two reasons for the VPN not coming up.
1. VpnConfig.getIntentForStatusPanel calls into PendingIntent and
ActivityManager statics, which bypass all the mocks and fail
with an appops denial. Fix this by making it a dependency.
2. The tests are broken due to the UserManager API changes
tracked in b/175883995. Fixing by adding a bit of ad-hoc code
into startLegacyVpn, with a TODO to delete it once the rest of
the UserManager setup code is fixed.
Fix these and check the return value of block(). This ensures
that if any other breakage is added the test will actually fail.
Also check that the throw route survives all the way to the
LinkProperties sent to the agent.
Bug: 173331190
Test: atest com.android.server.connectivity.VpnTest
Change-Id: Ieb7f33bce283ac5ee562a912df8edb9c930ed2b0
When the phone process crashes and the IMS service is in
a separate process, there is a condition where the ImsService may
still stay unbound, but alive and not torn down. In this case,
when the phone process comes back up and tries to register new
binder callbacks, detect that the old binder callbacks are dead
and discard instead of throwing an exception.
Bug: 179217608
Test: kill phone process
Change-Id: I4fc3b6d15fe19ebaf1fc52dab92a615a761222f8
cc_test_host now all run in presubmit without any need for
explicit TEST_MAPPING
Test: presubmit
Bug: 177450457
Change-Id: I3dbc4aaa99237dfebf9604ef1e7b31fd88741b1e
* changes:
Fix test method naming in VcnManagementServiceTest.
Fix field order for UnderlyingNetworkTracker.
Notify PolicyListeners to refresh their policy on VCN changes.
Unit test TelephonySubscriptionSnapshot changes for VCNs.
Notify UnderlyingNetworkTracker for Subscription changes.
The connection service will become the mainline module. The mutating
NetworkCapabilities is deprecated, and the NetworkCapabilities should
be built through their Builder instead.
Bug: 170598012
Test: atest FrameworksMockingServicesTests:ConnectivityControllerTest
Test: atest CtsJobSchedulerTestCases
Change-Id: I931f6f4cedd89a3ff7c811266c68c00f26e8ce43
ConnectivityService is going to become a mainline module which
will not able to access hidden APIs. NetworkPolicyManagerInternal
is a internal serivce that CS can't be access after be a mainline
module. Thus, create NPM#checkUidNetworkingBlocked to replace it.
Bug: 170598012
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases
Test: atest CtsHostsideNetworkTests
Test: atest FrameworksCoreTests:NetworkPolicyManagerTest
Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest
Change-Id: I7bee37522dc5c55c255b159fda9481eff663655a
Nothing on the system is using registerNetworkFactory,
unregisterNetworkFactory at the moment.
registerNetworkFactory, unregisterNetworkFactory are protected by
signature permissions, so could not be used by anything outside of the
system.
Remove the two methods and the underlying support for this legacy,
deprecated mechanism.
Bug: 179229316
Test: atest FrameworksNetTests
Change-Id: I7cdc9eed67f846c8774474af038133040aeccab3
This CL updates VcnManagementService to notify all registered
VcnUnderlyingNetworkPolicyListeners to refresh their
UnderlyingNetworkPolicy when any VCN is added or removed.
Bug: 175914059
Test: atest FrameworksVcnTests
Change-Id: Ie87f4aa3401c6c4ba9f932130a1d475e35f59d4e
This CL adds unit testing for TelephonySubscriptionSnapshot updates in
UnderlyingNetworkTracker, Vcn, and VcnManagementService.
Bug: 177364490
Test: atest FrameworksVcnTests
Change-Id: I244744194a1360c7c7dee062a302e04f9b5efc32
Currently, the tests only check whether the method throws a
SecurityException or not. Also check the return value of the
call, by mocking out InetDiagMessage.getConnectionOwnerUid.
This is required to test an upcoming change that will never
throw SecurityException but always return INVALID_UID if the
caller lacks permissions.
Bug: 173331190
Test: test-only change
Change-Id: I63f42a2f098fcf8796c9b4525a3a7b8320c0a139
There is strong opposition in the team to this rename.
Reverting to the old language.
Test: FrameworksNetTests
Change-Id: Icefa3090966c07fd66692ddd5b44dfc94485a914
This CL updates VcnManagementService to notify active VCNs when it is
notified of subscription changes by TelephonySubscriptionTracker. These
subscription changes are passed down to each VCN's
UnderlyingNetworkTracker, which determines whether it needs to register
or unregister bringup NetworkRequests based on subIds within that VCN's
Subscription Group.
Bug: 177364490
Test: atest FrameworksVcnTests
Change-Id: I15bc9aaf3d5f97046d0ce9fcf1e12c9b1e0e1446
Persist hibernation states to disk. This CL persists the user-level
and global hibernation states to disk.
Bug: 175829330
Test: atest AppHibernationServiceTest
Test: atest HibernationStateDiskStoreTest
Change-Id: If58d648d720bed1693b9346c4d0e85074daec931
Similar to other system services, we move AppHibernationService's
dependencies to an injector class that can be mocked for testing so that
we minimize side-effects in unit tests
Also, add @GuardedBy annotations instead of having an L at the end of
method names since this is exactly what the annotation is for.
Bug: 175829330
Test: atest AppHibernationServiceTest
Change-Id: Iec51a349ff898923bacf6040c3ebccefa8831a68