Move test classes that were not in the same com.android.module.util
package as their associated class into the right package, and make
net-utils-service-common visible to tests.
Bug: 207020032
Test: atest ConnectivityCoverageTests
Change-Id: Iabe86a7d4c2437b3d01d68d53fb01d4e3c05a02b
Enable the strict_updatability_linting here first as a prior
commit to enable strict_updatability_linting in connectivity
modules.
Bug: 188851968
Test: m lint-check ; atest NetworkStaticLibTests
Change-Id: Idac98a1c85bf5bb86269b1daad2b444cfb58db8a
1. Separate bpf and struct libraries from netlink library.
2. Rename bpfmap jni library to respect its java side library.
3. Add README to explain the rules of adding shared jni library.
4. Also allow packages/modules/Connectivity to use bpf library.
Bug: 205088391
Test: atest TetheringTests
atest CtsTetheringTest
atest TetheringPrivilegedTests
atest ConnectivityCoverageTests
Change-Id: I6e668818bede63b241cd901c0967f401613ddaf6
- Move PolicyDirection into frameworks/libs/net
- Add net-utils-annotations lib for those methods that are using
PolicyDirection annotation.
- Add net-utils-annotations-srcs for including PolicyDirection to
their filegroup.
Bug: 203634639
Test: m
Change-Id: I7b8b3bdcc3be5fca9baa5a9ce656756843e03527
Multiple packages need access to bpf maps. Moving to common
location to allow access from all necessary packages.
Test: atest BpfMapTest
Bug: 179733303
Change-Id: Idae7b620c15c781b2e7980c3a3157f396cfaf66e
We should be using the lib instead.
Unfortunately net-utils-framework-common can't do the
same move just yet because many targets depend on it
that only build against system_current.
Test: builds
Change-Id: I9f70f4cc31e0270cc05ef71ba1803c2d088937d6
These classes used to live as a static utility in the
NetworkStack module, but that's not the right place for
them.
The point of this patch is to *not* require topics, as
any change in this space will very quickly spin out of
control and become unmanageable. As such, this starts
with creating equivalent classes in a single, easier to
manage change. Followup changes will migrate users of
the old classes to use these ones instead. Finally, the
old classes can be removed. This way, work can be
broken down into separate changes and be checked in
little by little, rather than one huge topic with many
changes doing everything in one go, which is unlikely
to be manageable.
There are no code changes from the originals, but a
number of reorganizations, most of them unavoidable.
• Vertical spacing (these classes fix it)
• Package names/imports are adjusted
• Added @hide on NetlinkMonitor
• Move all contents of RouteUtils to NetdUtils, because
all methods depend on INetd, and some of the targets
do not/cannot depend on netd-client
• Restrict the files used by the filegroup
net-utils-framework-wifi-common-srcs, since that
target does not necessarily provide all dependencies
to all its users.
• Don't move NetworkMonitorUtils, since it depends on
SdkLevel, and net-utils-framework-common-srcs is
using **/*.java. It would have been possible to list
explicitly all files actually necessary in this
filegroup, but NetworkMonitorUtils is actually only
used by the networking modules and not the framework.
Eventually it should move but it doesn't have to
be in this patch, which is complicated enough as
it is.
• RouteUtils is now empty, because some new methods
will be added to it soon and it is less expensive
to keep it empty than to remove it now and add it
again later.
• Merge NetdUtils, and unify the constants.
Some changes to satisfy checkstyle :
• Remove unused imports
• Reorder modifiers in InterfaceController
• Remove {} in IpNetworkMonitor
• Remove redundant public modifier in IpNetworkMonitor
• Add javadoc to a few methods
• Add whitespace around | in InterfaceParams
However, don't rename members in IpNeighborMonitor
like checkstyle would prefer because this would make
migration to this more involved.
Test: NetworkStaticLibsTests NetdStaticLibTests
Change-Id: I439121cba5d7ea95aa4d6c80ea25207c316880a0
As framework-wifi already include NetUtils by
net-utils-framework-wifi-common-srcs, remove this from
net-utils-wifi-service-common-srcs to avoid Duplicated class in Wifi
Apex
Bug: 195965491
Test: build module
Change-Id: Id8b1c76f6120c02c93225f0b25970b217d88c295
Move netlink stuff to frameworks/libs/net/common/device, and build the
source files as an individual libraray. NetworkStack module just depends
on the net-utils-device-common-netlink.
Besides, also fix the incorrect format detected by checkstyle_hook script
such as missing java doc and make some public function as private, rename
the variable and etc.
Bug: 192535368
Test: atest NetworkStaticlibTests
Change-Id: I00e7f30be1bc9ebc2e24d7cd53efc403d6ba3daa
NetworkFactory needs to be backwards compatible as
it is statically linked by the Wifi module, which
needs to run on both R and S.
To achieve this, maintain 2 separate implementations
called NetworkFactoryImpl (S+) and
NetworkFactoryLegacyImpl (R). NetworkFactory itself
becomes a shim that delegates to one of these
implementations depending on the device's SDK version.
CP of ag/14265947
Ignore-AOSP-First: Merge in internal first to fix
S-on-R test breakages.
Bug: 183902758
Test: ClientModeImplTest
OemWifiNetworkFactoryTest
TelephonyNetworkFactoryTest
UntrustedWifiNetworkFactoryTest
WifiNetworkFactoryTest
Change-Id: I6a08f39ad1633dd7c1582c362c97821e24ce6683
Merged-In: I6a08f39ad1633dd7c1582c362c97821e24ce6683
Allow framework-connectivity to depend on net-utils-framework-srcs, and
add @hide annotations to classes that were missing it.
This allows depending on less classes than net-utils-device-common, and
avoids transitive dependency on androidx.annotations used by
net-utils-device-common (which itself depends on the public SDK).
Bug: 183600168
Test: m
Merged-In: I89a18bb46311800fd6807dad5785f12648f165d9
Change-Id: I4c37d78198682366f56cde1b2707b0323f2f9e40
Having the test targets in a different directory allows setting
visibility rules for tests only, which is necessary for access to
targets that should not be used for device builds.
Bug: 182859030
Test: m
Change-Id: Iaf426cf339a97833acf80c941db692329c6e2dcb
This reverts commit 405c1bfca93fa25ae1616a93ee6e2a1f76d87d1e.
Bug: 168868607
Test: atest NetworkStackIntegrationTest
Reason for revert: Roll forward the previous change and try to merge it one by one instead of using the topic, which should avoid the build broken on the sc-dev branch due to the deferred auto-merge process.
Change-Id: I751fbd9d978ed60206bab009212f621fe902f321
The utilities replace the ones from IpClientIntegrationTests. Original
Kotlin implementation is aosp/1440812.
Bug: 168868607
Test: atest NetworkStackIntegrationTest
Change-Id: I1c050ae42d99f541eeaa3dcd80a53574ab9bc1c3
Some files which will be inside mainline module depend on
NetworkManagementService to talk to netd, but after they become
a part of mainline module, they cannot access @hide API of
NetworkManagementService.
So create a NetdUtils to help them to talk to netd.
Bug: 170598012
Test: atest CtsNetTestCasesLatestSdk NetdStaticLibTests
Change-Id: I8bee1204b9533b70844da0b3768427438fd0c890
Also move CollectionUtils which is a dependency.
NetworkCapabilitiesUtils is needed in BatteryStatsImpl, which is in
frameworks/base/core, so it uses the framework-common library.
The current framework-common target cannot use androidx annotations due
to users of this filegroup. This is being addressed in another change;
use android.annotation annotations in the meantime.
Bug: 174436414
Test: m
Change-Id: Ie188572a6db7c1bea37550a3410d7d828409a902
Adjusting visibility to accomodate migration of
frameworks/opt/net/wifi to packages/modules/Wifi.
BUG: 137323948
Test: TH
Change-Id: Iee3f2dc6fc5f3262fa9e81626a3e15a3226e4ab7
Split DeviceConfig and collections-related utilities to CollectionUtils
and DeviceConfigUtils in frameworks/libs/net.
Also add implementations for contains(array, value), to avoid usage of
internal non-API utils.
The original tests are based on mockito-extended, so also add to
NetworkStackTests as a dependency. This also requires setting the test
app as debuggable in its manifest.
Bug: 17454103
Test: atest NetworkStaticLibTests
Change-Id: Ie9bed66a08b7370ebe50d0a7240b788f8b31aa77
Add paths to visibility needed for tests.
Soong allows specifying paths w/o validation. Once the
migration is complete, we can remove the old path in
visibility rules.
BUG: 137323948
Test: TH
Merged-In: Id19c650246a8f3d55d7b6a874840a6eebcd9eb17
Change-Id: I68de6a67b978ed5a2e721adf41329af349076696
Exempt-From-Owner-Approval: Cleanup CL
This fixes failures in CtsNetTestCases, where
TestableNetworkCallback.TAG cannot be used because
it uses kotlin-reflect.
Change-Id: I7e76fe224b1098c967665275eac24fcac08fca23
Fixes: 176047509
Test: atest CtsNetTestCasesLatestSdk
The packages/modules/Connectivity project contains module code that can
depend on net-utils-device-common or net-utils-framework-common.
Bug: 171540887
Test: m
Change-Id: Ie754e3f55d78aabff4cef2da3a2a94a1204bd5e5
per b/167962976#comment10, following project directories are being
moved under platform/packages/modules/Connectivity/...
cts/test/net --> packages/modules/Connectivity/tests/cts/net
cts/tests/tests/tethering -> packages/modules/Connectivity/tests/cts/tethering
cts/hostsidetests/net -> packages/modules/Connectivity/tests/cts/hostside
BUG: 167962976
Test: TH & Local Build
Exempt-From-Owner-Approval: PS.1 +2d by Lorenzo. fixing tab (+2 not sticky)
Change-Id: I4e13620ea16b74712a917737607bc3ed38c11cd9
Revert "Use new test utilities from frameworks/libs/net"
Revert submission 1440811-iputils_constants_move
Reason for revert: Likely broke build in b/170438226
Reverted Changes:
Ic382d24e7:Move NetworkStackConstants to frameworks/libs/net
I0d938e296:Use new test utilities from frameworks/libs/net
Change-Id: I5e41daa85af39cfab4261ddf790c2008b2630c15
The class only contains constants that should be shareable between
different modules and tests.
Bug: 168868607
Test: m
Change-Id: Ic382d24e73697d85d29fa226692bd0d64ffa0f1f
Add an ArpResponder based on a generic PacketResponder class, and a
TestHttpServer based on NanoHttpd.
Test: tests based on these utilities
Bug: 160617623
Bug: 160656765
Change-Id: I50b872a8b23e8df997e8f62f0adc7c0256c4d74d
These files used to be in the network stack directory, but the libs
directory is a much more suitable place for them.
Also fix a typo : ConcurrentIntepreter → ConcurrentInterpreter
Also move {FdEvents,Packet}Reader to internal annotations. That's
what they should have been using in the first place anyway.
Note that this does not fix preupload issues reported by
checkstyle to make review easier. The fixes are in a followup
patch to this one.
Test: checkbuild
Change-Id: I675077fd42cbb092c0e6bd56571f2fc022e582fd
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.
Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
(clean cherry-pick from internal branch)
Merged-In: I2b3dcf2e238be047147232769602df56894dc6b1
Change-Id: I2b3dcf2e238be047147232769602df56894dc6b1