- Add a new API to get the network ID range of IPSec tunnel
interface.
- Use the new API in IpSecServiceTest to make sure the result is
the same. Follow-up commit will change the logic in
IpSecService#reserveNetId(), the modified test can ensure the
correctness of the new change.
Bug: 172183305
Test: atest FrameworksNetTests:IpSecServiceTest
Change-Id: Ic605e48941fc9d6482cdcd01a8adcdc9b6d586a6
* changes:
[Telephony] Use TelephonyCallback instead of PhoneStateListener part1
[PhoneStateListener] Redesign PhoneStateListener: Use TelephonyCallback
NetworkAgentInfos cache the list of requests they satisfy,
and that list is used to send callbacks. Therefore, when
the TRACK_DEFAULTs are copied, this list needs to be
updated.
The best way to do this is to figure out what was the old
active request and find which requests corresponds to it
in the new list, and then upon registering adding the
active request to the relevant satisfier if present.
A few other ways can be considered like replacing the
request as it gets added, but this would temporarily
increase the number of callbacks allocated to the app
and risks crashing it for no good reason ; furthermore
the call to remove would have to be eschewed somehow
for those requests that are replaced. This is much
simpler.
Test: new test for this. This also passes the future
tests for per-profile default network preference.
Change-Id: I001351e5c478c2c77cbf2844abca77b205291778
Mainline connectivity service is only allowed to use formal
APIs. Use new system API in BatteryStatsManager instead of
calling BatteryStatsService directly.
Bug: 171686421
Test: FrameworksNetTests
Change-Id: I1d1f0d2d456003e842ad77519667c0532995610d
Merged-In: I1d1f0d2d456003e842ad77519667c0532995610d
Since the redesign of PhoneStateListener, use TelephonyCallback to get the callback of EVENT_*
Bug: 167684594
Test: make
Change-Id: Ia3b777b12142b104b5798804f50b34748f9bf28c
Merged-In: Ia3b777b12142b104b5798804f50b34748f9bf28c
Connectivity is becoming a mainline module in S but mainline
modules are not allowed to use non-formal APIs. Thus, replace
non-formal API Inet[4|6]Address#ANY to
NetworkStackConstants#IPV[4|6]_ADDR_ANY.
Bug: 181756157
Test: FrameworksNetTests
Change-Id: Id4d2fc551c1384f549a586e87ab68356ba05b995
The data class supports a ConnectivityManager API, so it should be
together with the ConnectivityManager API surface.
Bug: 181512874
Test: m
Change-Id: I5642486ea0febcb08cadcbd4cd3f0c6056deae0e
The connection service will become the main line module.
It is difficult to include BitUtils in the module. and so
Move the hidden API needed in BitUtils to NetworkCapabilitiesUtils.
Bug: 170598012
Test: atest ConnectivityServiceTest
atest NetworkCapabilitiesTest
atest DnsUtilsTest
Change-Id: Ibc81827e25a54fc3ff94f78d810fe4f5073e3a98
NetworkState is becoming an internal implementation class, with
NetworkStateSnapshot replacing it as a proper API. Considering this it
belongs inside Connectivity.
Bug: 174123988
Test: m
Change-Id: I201f1a07c50d9da31e33f5c207875da8863ef57c
Updating handleSetOemNetworkPreference so that the given policy is
applied to all users on the device. Additionally, remove uids for all
users/apps so that stale uids don't stay present after rematch. Finally,
small cleanup on how we deal with remote exceptions.
Bug: 181581017
Bug: 176494815
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk
Change-Id: I214717ee0c78cfe8322e551c2c2e9dc01c0242b2
These methods will be reused for 5G slicing and should
have a more generic name/signature.
This is a no-op refactoring.
Test: FrameworksNetTests
Change-Id: I13cf9fc405fef7dc650d5ea7df44d025f6713b46
IS_USER is a hidden symbol, whereas IS_DEBUGGABLE is part
of the module API.
The check is generally equivalent, as non-user builds are eng or
userdebug, which are debuggable.
Bug: 170598012
Change-Id: I7d09939652844eb2e3a6f0200b1ba50691a147da
Test: atest FrameworksNetTests
When a new OemPreference object is set, the requests
tracking that default will be re-created to track the
new default. This is true regardless of whether that
particular default has changed.
Because the new copied request doesn't know about the
old satisfier, the rematch code will mistakenly think
this callback didn't have a network and will send a
spurious onAvailable to it.
This patch fixes this by simply copying the satisfier
together with the rest of the NRI. The matching code
will then understand the correct previous status.
As a drive-by fix, this also fixes the annotations on
the reassignment contents that can be null. They have
more complex interactions (not everything can be null
at the same time), but the old annotations were just
putting @NonNull on nullable stuff.
In the same line, while there used to be a case with
a satisfier but no request when the satisfier is the
no-service network, there may now be a case where the
old satisfier is known but the old request isn't.
Test: FrameworksNetTests
Test: TODO : need a unit test for this
Change-Id: Ide2567b226722ea9d35ebd8205943363e27647a2
This ends up crashing the system when the request
is unregistered, because the ref counter finds the
count associated with the relevant UID is zero.
Test: FrameworksNetTests
Test: TODO : this needs a new unit test
Change-Id: I0ee0ce925a826d35d8fd58cefb8a870e98ce9add
When a new preferences object is sent that no longer contains
a particular app, a new set of requests will be generated. All
requests corresponding to that app will be unregistered, and
no new ones will be filed since the preferences no longer
contain that app.
The place where the UID ranges are removed however is in
makeDefaultForApps(), which takes a request. As there no
longer is a default request for this app, makeDefaultForApps()
will never be called with a request for it, and the UID ranges
will never be removed.
This change applies an emergency fix with some side effects
when setting a new preference. This is acceptable, but should
ideally be fixed ; see TODO in the code for details.
Test: FrameworksNetTests
Test: TODO : Need a unit test for this
Change-Id: Iac3f55af5d00d174460e1d4cdd31f581835dbaa6
Currently, battery stats service uses noteConnectivityChanged in
connectivity service(CS) to pass connection state and the type of
connection for BatteryStats. However, CS is going to be a mainline
module which can only access formal API. noteConnectivityChanged
is a hidden API and it pass LegacyNetworkType which has been
deprecated years ago, so it should avoid to expose this API with
a deprecated argument. Thus, register a NetworkCallback in
BattyeryStatsService to listen the network capabilities changed to
remove the noteConnectivityChanged from connectivity service.
Besides, let noteConnectivityChanged take display transport instead
of legacy network type.
Bug: 171686421
Test: atest FrameworksNetTests
atest FrameworksCoreTests:BatteryStatsTests
(cherry-picked from ag/13749983)
Change-Id: I3dac94ec06f673aa719e124f1ef3d8169f68f9fb
Merged-In: I3dac94ec06f673aa719e124f1ef3d8169f68f9fb
The last change broke the test on Q and R. Fix it to check
Q and R behavior properly, so the test can be run in presubmit
on such devices too.
Bug: 181844595
Change-Id: I99847ea30d49d690d9011d4763a7345126807119
Test: atest CtsNetTestCasesLatestSdk
Currently, ConnectivityService has getAllNetworkState but it is
not ideal to expose as system API since the plan is to get rid
of NetworkState. Thus, create a new one that returns
NetworkStateSnapshot to fulfill the needs.
Note the original getAllNetworkState cannot be deleted now since
it has @UnsupportedAppUsage annotation.
Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: Icddd434552b0e9ecbc8299e7242ec88cf3145aca
ConnectivityService is going to becoming a mainline module.
The DataConnectionStat is used to listen the telephony status
change and report to BSS. This does not really relate to
connectivity. DataConnectionStat was created in
ConnectivityService and use some hidden APIs which is not
allowed for a mainline module. Thus, move the creation and
monitor to BSS directly which is more appropriate place from
its functional perspective.
Also, move the DataConnectionStat out from module scope since
it does have too much relationship with connectivity module.
Bug: 171183530
Test: m ; verify the behavior with cellular state change
Change-Id: I0c2c1b90df7a107ee75e81fd49d39d65678204c0
Merged-In: I0c2c1b90df7a107ee75e81fd49d39d65678204c0
* Use public stable API to load certificates from keystore.
* Also use grants to allow racoon to use keystore keys without
special exceptions in keystore.
* Use LegacyProfileStore instead of Keystore for storing VPN profiles.
Bug: 175068876
Bug: 171305607
Test: atest android.net.cts.Ikev2VpnTest
atest android.net.cts.IpSecManagerTest
atest com.android.server.connectivity.VpnTest
atest com.android.server.ConnectivityServiceTest
Merged-In: I27975113896ea137260a9f94a34fb1c3ca173fe3
Change-Id: I27975113896ea137260a9f94a34fb1c3ca173fe3
ArraySet#append() is a hidden API which is not accessible for
mainline module, use public one - ArraySet#add() instead.
Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I0742e2ec7aff008141b1de6d10eeca2910df71b1
Legacy metrics are unused and deprecated, so they are being removed.
Therefore, delete the usage of the hidden MetricsLogger API.
Bug: 157966864
Test: atest CtsNetTestCases
atest CaptivePortalTest
atest ConnectivityServiceTest
Change-Id: I51241f5d50ec580015882c84dd917b015c700c7c