Add getTransportTypesInternal as a hidden api for internal callers. This
will be used for any metrics that need to store the transport types of a
network.
Bug: 273451360
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:13189e957d91faed65c06b35bfc2e29c1456c751)
Merged-In: I527638e5408e7971a450135345e7e51b6125d665
Change-Id: I527638e5408e7971a450135345e7e51b6125d665
Test: new test for this behavior in the preliminary change
Test: FrameworksNetTests NetworkStackTests
Fixes: 138810051
Fixes: 140610528
(cherry picked from https://android-review.googlesource.com/q/commit:9fe47bee099125cf01fa153cdef28e100b9f3a0c)
Merged-In: I95a979d232fb60ece2e33e972bf5d66d20357a1f
Change-Id: I95a979d232fb60ece2e33e972bf5d66d20357a1f
Bug: 263074841
There are multiple independent reasons a keepalive can stop. Some
are software (e.g. the app stops the keepalive) and some are hardware
(e.g. the SIM card gets removed). Therefore, there is a very low
probability that both of these happen at the same time, which would
result in the first stop attempt returning SUCCESS and the second
stop attempt returning NO_SUCH_SLOT. Such a race condition can be
ignored with a log, not to crash the system. Change to wtf log so
that the issue could still be visible since this implies possible
bugs in the system.
Also update the javadoc for SocketKeepalive.ERROR_NO_SUCH_SLOT.
Bug: 281484381
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:75673ba5025faa191ae188100b117a4095fab8ab)
Merged-In: I316a2193fc7302b04e074ff0b03dc43946fe5ce6
Change-Id: I316a2193fc7302b04e074ff0b03dc43946fe5ce6
Network state is not changed to disconnected when a networkagent
is disconnected and network state is SUSPENDED.
So the function requiresClat return true. Clat is not stoped.
Bug: 277682237
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:fd5d3d90e1da7411104902ddfe859ebd0e4a02fb)
Merged-In: I5edfcf64aca5d2d34325d722dd29fab41bcf2600
Change-Id: I5edfcf64aca5d2d34325d722dd29fab41bcf2600
P-CSCF list is ordered list. Two lists with same servers but
in different order are not equal. Use proper comparison.
The P-CSCF address is a kind of entry point (proxy) of Server
for IMS transaction between device and IMS Server. It can have
multiple addresses as a list. Even if the same addresses have
different orders, it is assumed that the server order has changed.
Bug: 268479036
Test: TreeHugger
(cherry picked from https://android-review.googlesource.com/q/commit:b0fc6627a6f76c02f3e420bbdd0a86581c955234)
Merged-In: Ia1884f37739a20d871dd0024cc72cb18c083dc8e
Change-Id: Ia1884f37739a20d871dd0024cc72cb18c083dc8e
The ConnectivityResources class is only usable with QUERY_ALL_PACKAGES
permission, so it is not generally usable in framework-connectivity. It
is also backed by the ServiceConnectivityResources APK, which is
intended as resources for service-connectivity.
Move the class to service-connectivity and update callers. CTS needs a
way to determine the supported keepalive count as it used the
resources from KeepaliveUtils as @hide API, so provide a
ConnectivityManager @hide API for testing.
Bug: 279108992
Test: atest
(cherry picked from https://android-review.googlesource.com/q/commit:bee2ee14f34ff028236b393523d1174a375d2a08)
Merged-In: I3c9a77c580b5ab87c922c32778bce15dc33b4d1d
Change-Id: I3c9a77c580b5ab87c922c32778bce15dc33b4d1d
* changes:
EthernetManagerTest: update tests that bring up tap without carrier
TestNetworkService: use IFF_NO_CARRIER to bring up iface without carrier
aosp/2384137 added cronet to framework-tethering.
But framework-connectivity is a better place to put cronet since
cronet does not work on R devices (b/270049141) and
framework-tethering is R+, framework-connectivity is S+.
Followup CLs will move some modules (e.g. CronetJavaPrejarjarDefaults)
that use the branch dependent soong variables to framework/Android.bp
Test: TH
Bug: 278070640
Change-Id: I6bc10116759fb9e083c02147908e53022dab740a
Note: this switches
com_android_networkstack_tethering_util_setupIcmpFilter
over to relative cbpf which in turn is called from:
com_android_networkstack_tethering_util_setupNaSocket
com_android_networkstack_tethering_util_setupNsSocket
and tested by p/m/C's:
TetheringUtilsTest.java - testIcmpSocketFilters()
Test: TreeHugger, atest TetheringUtilsTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I22a5ea8f8e3b879a37fe4acd84f61020661eaa71
MdnsSocketProvider currently does not fill addresses of downstream
tethering interfaces in its callbacks. The interface addresses should be
properly updated by listening to the Netlink messages.
Test: atest FrameworksNetTests CtsNetTestCases
Bug: 267980538
Change-Id: I753e547a1b092703fe59c6c9e922ee8aca245f67
This is a clean up commit to correct the javadoc of
NetworkAgent.CMD_START_SOCKET_KEEPALIVE. This event was used
between ConnectivityService/NetworkAgent, and also
ConnectivityService/KeepaliveTracker with different semantics.
This may confuse the developers to update the doc incorrectly,
so also separate the usage to different events.
Also move the event definitions together so that a new event
definition will not mis-use the existing values.
Test: atest FrameworksNetTests
Change-Id: I73ebd8abcc610531da3057da2d643a41befb2099
Fix the bug where subscription IDs will be cleared
on a restricted test network
Bug: 263415068
Test: NetworkCapabilitiesTest
Change-Id: I977781cd81f9d86858bd264825d66a2a69f6ce53
This commit expands the allowed capabilities of non cellular test
networks to include another three values, so that CTS can verify
features that do network selection based on those capabilities.
It is relatively safe becuase for apps that request TRANSPORT_CELLULAR
and the affected capabilities, test networks will still not become their
default networks.
Bug: 263415068
Test: atest NetworkCapabilitiesTest(new tests)
Change-Id: I2e348e4722ecdaa6e277fe77968916ffa2f16af9
Apps targeting sdk < U are considered to use a legacy native
daemon as NsdManager backend, but other apps use a
platform-integration mDNS implementation as backend. So add a
CompatChange flag to enable platform backend for non-legacy
apps.
Bug: 270306772
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I7ba58f8a5186fb49ad5f8aeacc8b8234bef1eabe
There's now a shared defaults module for this kind of filegroup. Use
that and remove the previously duplicated prop.
Bug: 271816210
Test: m
Change-Id: Ia4547984a73179fdfc98c427482dd10246f9722c
As the review feedback, this commits address below concern.
1. The TCP keepalive code doesn't use the network parameter
at all. This parameter doesn't seem meaningful for TCP
keepalives. Starting a TCP keepalive with a non-null underpinned
network should throw IllegalArgumentException.
2. The feedback mention that the start version which takes a
@NonNull network should throw NPE if the network is null. But
Starting a NATT keepalive does not always require a underpinned
network. A new IkeSession started from Vpn will also not assign
the underpinned network at the initial stage which means
underpinned will be null until setNetwork() is called. Thus,
the underpinned network should be @Nullable instead.
Fix: 271797087
Test: atest FrameworksNetTests
Change-Id: Ieb57a7b15a06b2ccd94358b65cc00768c4f62e7d
NewApi was recently updated to support linting methods in
the system, module_lib, and system_server sdks, and was
demoted to a warning due to the new issues it finds.
Baseline all the new issues that NewApi can be made an error
again.
These cls were generated automatically by a script that
copied the NewApi issues from the reference baselines.
Bug: 268261262
Test: m lint-check
Change-Id: I5b97824b873987073bd17a9af16bdf822f649f4a
Test: TreeHugger
Bug: 271772099
Ignore-AOSP-First: stopgap fix for old builds like tm-mainline-prod
Change-Id: Ie4f7c7d6eca1f64b8ebd948d67d41ce13759871a
When the application wants to request network with
NET_CAPABILITY_PRIORITIZE_BANDWIDTH or
NET_CAPABILITY_PRIORITIZE_LATENCY, it has to declare
PackageManager.PROPERTY_NETWORK_SLICE_DECLARATIONS property and also
adds the declaration in a separate XML files. Otherwise, the request
will fail with a SecurityException being thrown.
Test: atest FrameworksNetTests CtsNetTestCases
Bug: 266524688
Change-Id: I6affc857b803211517368da288e1b2fdc06a955b