The test is currently flaky as broadcasts can take a long time
to be delivered, often more than 500ms.
Extend the timeout for broadcasts to 30s.
Historically the test would wait for broadcasts for at most 500ms,
but not verify that they were received before proceeding. This was
fixed recently by adding an assertion, but the assertion needs to
give enough time for the broadcast to be received.
Bug: 173331190
Change-Id: I0760f3418c635aa4d68de5aefdb7120a9d3e930b
Test: atest FrameworksNetTests
* changes:
Call setUnderlyingNetwork to complete VCN MOBIKE
Rename isRunning to isQuitting, and flip all booleans
Notify Vcn of VcnGatewayConnection quits
Allow NETWORK_LOST disconnections to retry
Create TrafficDescriptor class
Create new APN ENTERPRISE
Update setupDataCall and DataCallResponse to take TrafficDescriptor and
matchAllRuleAllowed
Move ApnTypes from Annotation to ApnSetting
Bug: 179312227
Test: atest FrameworksTelephonyTests
Change-Id: I7433976bfe25bcb2af85ffb9338959cbcc9f42f3
Merged-In: I7433976bfe25bcb2af85ffb9338959cbcc9f42f3
In order to increase stability, move *ImplBase listeners to warning for
now until we can find the source of the error.
Fixes: 179217608
Test: manual; kill phone process
Merged-In: If1813ed6c82b778018d61691018604b6891ff34e
Change-Id: If1813ed6c82b778018d61691018604b6891ff34e
Expose broadcasts for communicating certain changes in state between
Telephony and carrier apps.
Implement a backward-compatibility layer to support carrier apps
targeting <=R that are listening to the old hidden broadcasts.
Fixes: 173050428
Test: atest CarrierSignalTest CarrierSignalAgentTest
Change-Id: I15d032ee1e31d9be847c2f084161f8555c8172c1
Merged-In: I15d032ee1e31d9be847c2f084161f8555c8172c1
Expose these string representations of APN types as SystemApi, and add
utility methods to convert between these and their integer equivalents.
Fixes: 173133122
Test: atest ApnSettingTest TelephonyRegistryTest
Change-Id: I8095ebc4f766be52042eec1c8ee043bf2e2dabfb
Merged-In: I8095ebc4f766be52042eec1c8ee043bf2e2dabfb
NetworkState is used by many methods that take or return legacy
network types. It is used because it contains most of the state
related to a network.
This code is not easy to follow and is more expensive than it
needs to be: most of the methods that construct a NetworkState
only really need one of its members (e.g., LinkProperties, or
NetworkInfo), but constructing a NetworkState requires making
defensive copies of all its other members as well.
- Instead of using NetworkState, use NetworkAgentInfo, which
already contains all the same data.
- Replace calls to getUnfilteredActiveNetworkState with calls to
getNetworkAgentInfoForUid. When getUnfilteredActiveNetworkState
returned NetworkState.EMPTY, return a null nai, which causes
any caller to see return null LinkProperties/NetworkInfo/etc.
- Rename filterNetworkStateForUid to getFilteredNetworkInfo,
because that's the only thing it actually filters.
- Rename getFilteredNetworkInfo to getFilteredNetworkInfoForType
to avoid having two methods with the same name perform two
different operations. That method was only introduced recently
in aosp/1552503, so it's probably fine to rename it.
Bug: 174123988
Test: passes existing ConnectivityServiceTest
Change-Id: Idfb5e149967266a442b268de6f13a521884dbb8f
The legacy API getNetworkInfo(int type) is expected to return
NetworkInfo objects for all network types supported by the device
even when those network types are not connected.
This requires a lot of fabrication because all the data
structures in ConnectivityService store information about
connected networks, not networks that don't exist.
Worse, the current behaviour is to return BLOCKED instead of
DISCONNECTED if background data is restricted. This obviously
makes no sense, because a disconnected network cannot be
blocked, and because if that network type did connect and was
unmetered (e.g., Wi-Fi), it would no longer be BLOCKED.
This complicates the code, forcing several methods to deal with
a special case of null NetworkCapabilities, no NetworkAgentInfo,
etc.
Fix this by isolating this outlandish behaviour to its own
method. This allows the main codepaths not to have to support
this unusual and not very useful edge case.
Bug: 174123988
Test: pure refactoring, passes existing tests
Change-Id: Ia52b24c59024c8f6e63e584b864e0225cb572090
This is needed by NetworkStatsService and
NetworkPolicyManagerService to utilize the snapshots of
information of networks that grabbed from ConnectivityService.
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Bug: 174123988
Change-Id: I7e974ef7b23ba9ba6ee775eed9899b0c0e2eca55