Commit graph android_packages_modules_Co.../staticlibs/Android.bp
Message SHA1
Move net-test-utils to its own directory
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

Remi NGUYEN VAN   commited 2021-03-30 16:52:09 +09:00
be2a07fce3
Revert "Revert "Add utilities to create IPv6 ICMP messages.""
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

Xiao Ma   commited 2021-02-28 13:09:23 +00:00
5c1745477f
Revert "Add utilities to create IPv6 ICMP messages."
Revert "Rename net-utils-framework-common in FrameworksTelephony..."

Revert submission 1579863-ipv6_utils

Reason for revert: Build breakage
Bug: 181339273

Reverted Changes:
I0d3b133e5:Rename net-utils-framework-common in FrameworksTel...
I1c050ae42:Add utilities to create IPv6 ICMP messages.

Change-Id: I2b3a26d6fe22c24618e3cab61f717a8b991f2b4d

Rahul Sabnis   commited 2021-02-26 20:02:44 +00:00
9d4d4b28fb
Add utilities to create IPv6 ICMP messages.
The utilities replace the ones from IpClientIntegrationTests. Original
Kotlin implementation is aosp/1440812.

Bug: 168868607
Test: atest NetworkStackIntegrationTest
Change-Id: I1c050ae42d99f541eeaa3dcd80a53574ab9bc1c3

Xiao Ma   commited 2021-02-25 07:18:08 +00:00
6344a8cdae
[LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
Added SPDX-license-identifier-Apache-2.0 to:
  client-libs/Android.bp
  client-libs/tests/unit/Android.bp
  common/Android.bp
  common/native/bpf_syscall_wrappers/Android.bp
  common/native/netjniutils/Android.bp
  common/tests/unit/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: I2d4abaee12c1f20c39a7e2c9e02e2fccb96fa3ee
Merged-in: I6942c6844c89048f785f2b6eaa4bb33a24fa6f93

Bob Badour   commited 2021-02-17 17:22:02 -08:00
1b8c744bcd
Merge "Have a collection of utilities for netd - NetdUtils"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-02-02 03:38:37 +00:00
935948f1de
Have a collection of utilities for netd - NetdUtils
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

lucaslin   authored and   Lucas Lin   commited 2021-02-01 07:24:37 +00:00
e2d02e7c98
net-utils-services-common - set min_sdk_level to 30
Bug: 178711289
Test: compiles
Change-Id: I8105265b726cb095375191693caa0ccfd7d66276

David Su   commited 2021-01-29 04:42:27 +00:00
dc0a5687d6
Move NetworkCapabilitiesUtils to framework-common
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

Remi NGUYEN VAN   commited 2021-01-07 12:05:30 +09:00
df3191ada8
Merge "Adjust visibility rules for migration"
Baligh Uddin   authored and   Gerrit Code Review   commited 2020-12-28 14:03:37 +00:00
ffe8f93ce4
Merge changes from topic "netutils_split"
* changes:
  Add DeviceConfigUtils version caching and tests
  Add getDisplayTransport
  Split NetworkStackUtils to frameworks/libs/net

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-12-28 01:17:41 +00:00
d5a89c61fd
Adjust visibility rules for migration
Adjusting visibility to accomodate migration of
frameworks/opt/net/wifi to packages/modules/Wifi.

BUG: 137323948
Test: TH
Change-Id: Iee3f2dc6fc5f3262fa9e81626a3e15a3226e4ab7

Baligh Uddin   commited 2020-12-27 15:10:36 +00:00
fcbda3ac66
Split NetworkStackUtils to frameworks/libs/net
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

Remi NGUYEN VAN   commited 2020-12-25 16:23:25 +09:00
b86b34da48
Add visibility rule for migration.
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

Baligh Uddin   commited 2020-12-24 03:28:41 +00:00
fe99df5a25
Merge "Add visibility rules for Connectivity project"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-12-24 01:46:30 +00:00
6c67e2723d
Add kotlin-reflect to net-tests-utils
This fixes failures in CtsNetTestCases, where
TestableNetworkCallback.TAG cannot be used because
it uses kotlin-reflect.

Change-Id: I7e76fe224b1098c967665275eac24fcac08fca23
Fixes: 176047509
Test: atest CtsNetTestCasesLatestSdk

Remi NGUYEN VAN   commited 2020-12-21 07:16:52 +00:00
128c31f0b8
Move util classes to their destination package
Test: FrameworksWifiTests FrameworksNetTests
Change-Id: I93e9cfd968e08f983e3fd9f7196c455c79a0f32d
Merged-In: Id19c650246a8f3d55d7b6a874840a6eebcd9eb17

Chalard Jean   commited 2020-12-16 08:50:20 +09:00
ceaf7d0edc
Add visibility rules for Connectivity project
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

Remi NGUYEN VAN   commited 2020-11-27 13:59:48 +09:00
38afb0cd07
Merge "Create net-utils-services-common-srcs"
David Su   authored and   Gerrit Code Review   commited 2020-11-12 02:53:27 +00:00
6ca84ae4c5
Create net-utils-services-common-srcs
...in order to allow "services.net-module-wifi" to
use it.

Bug: 171330443
Test: compiles
Change-Id: I67300429e1a95344c2287ec0358c94c651d2f9f9

David Su   commited 2020-11-04 16:59:08 +00:00
2dbab6439b
Adjust visibility to avoid build breaks.
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

Baligh Uddin   commited 2020-10-31 12:54:44 +00:00
e685c813d5
Add visibility rules for packages/modules/Connectivity/Tethering
BUG: 167962976
Test: TH
Change-Id: I4f9c63d27fe7f10534e89f3d132f26b2f45e7b07

Baligh Uddin   commited 2020-10-29 03:57:51 +00:00
ae4770df38
Merge "Let frameworks/base/tests access the static lib"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-10-15 12:27:15 +00:00
e27ae93f77
Let frameworks/base/tests access the static lib
Test: CtsNetTestCases FrameworksNetTests
Change-Id: I51520b179fe2946f03311eccac97bf4bd4019aea

Chalard Jean   commited 2020-10-15 18:06:30 +09:00
a9f49910fe
Merge "Define a generic class to parse structured message."
Xiao Ma   authored and   Gerrit Code Review   commited 2020-10-09 13:20:31 +00:00
1f2650f6d6
Define a generic class to parse structured message.
Bug: 163492391
Test: atest android.net.util.StructTest --rerun-until-failure
Change-Id: I1848984d80998d87acccc52287a351d27708dedc

Xiao Ma   commited 2020-10-09 18:25:34 +09:00
6f95cefd38
Revert "Move NetworkStackConstants to frameworks/libs/net"
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

Remi NGUYEN VAN   commited 2020-10-09 01:38:44 +00:00
b2cce59454
Move NetworkStackConstants to frameworks/libs/net
The class only contains constants that should be shareable between
different modules and tests.

Bug: 168868607
Test: m
Change-Id: Ic382d24e73697d85d29fa226692bd0d64ffa0f1f

Remi NGUYEN VAN   commited 2020-10-05 11:25:18 +09:00
8f415d0066
Add visibility of this lib to wifi tests
Test: this builds, and subsequent patches using this work
Change-Id: I8d59b39e6554eccd22695dda47c41b1f2f661495

Chalard Jean   commited 2020-10-01 12:46:37 +09:00
1978919885
Remove backward compatibility flag
Kotlin updates to 1.4 and fixes an issue where @JvmOverload methods
were not final.
See https://kotlinlang.org/docs/reference/compatibility-guide-14.html#generated-overloads-for-jvmoverloads-on-open-methods-should-be-final

Remove the backward compatibility flag by special-casing the method
that needs to be overridden at this time, which gets rid of the
local concern.

Bug: 166499531
Test: Builds, atest ConnectivityServiceTest
Change-Id: Ia13c67876f99dafd77d890e82d62453713b7b5fe

Chalard Jean   commited 2020-08-28 16:56:55 +09:00
d59af18458
Add workaround for Kotlin 1.4 upgrade
This library is not yet compatible with Kotlin 1.4 new @JvmOverloads
behavior. This change forces this library to the legacy behavior.

See https://kotlinlang.org/docs/reference/compatibility-guide-14.html#generated-overloads-for-jvmoverloads-on-open-methods-should-be-final

Bug: 166499531
Test: make
Change-Id: I9d675c7bd7a8ff223332dfbdf519c476f4c59c8a

Aurimas Liutikas   commited 2020-08-27 17:02:11 +00:00
33ed824e80
Add utilities to test tap interface networks
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

Remi NGUYEN VAN   commited 2020-08-14 12:54:41 +09:00
7995b438eb
Move utilities to libs/net
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

Chalard Jean   commited 2020-07-30 22:10:51 +09:00
48c6c7d838
Move Inet[4]AddressUtils to libs/net
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

Remi NGUYEN VAN   commited 2020-06-30 19:19:52 +09:00
f109837101
Add the visibility of net-utils-framework-common for cts-net
DnsResolverTest required DnsPacket to parse DNS answer, and the
DnsPacket class is provided by system previously.
However, DnsPacket was moved to here with changed package,
which has no backward-compatibility and might cause
NoClassDefFoundError. To solve this problem, build the DnsResolverTest with
DnsPacket directly.

Test: build
Test: atest DnsResolverTest
Bug: 150952393
(clean cherry-pick from internal branch)
Merged-In: I463fd58173cee55a210fa6c6b8c9b0d5a74b7906
Change-Id: I463fd58173cee55a210fa6c6b8c9b0d5a74b7906

Luke Huang   commited 2020-06-24 11:39:49 +00:00
fd5479e5d4
src_frameworkcommon: Fix filegroup base path
The filegroups here were set up without an explicit path. As a result,
the files within were incorrectly considered part of the
"src_frameworkcommon.android.net.utils" package by droidstubs'
filter_packages filter (and thus not fed into droidstubs).

This CL fixes the filegroups by adding an explicit path to where the
package tree starts for each of them, such that the path-based
package filter in droidstubs can work correctly.

Also @hide the classes which otherwise would now be considered exposed
API by droidstubs.

Bug: 151160048
Test: make checkapi
Change-Id: I969fc9846294a42554233cffda725797ee0185f4

Adrian Roos   commited 2020-04-02 08:53:30 +00:00
0607dd9a16
Merge "Statically link DnsSdTxtRecord into framework-wifi"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-01-22 06:23:25 +00:00
fd71d872b2
Merge "libs(net/common): Create filegroups for wifi sources"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-01-22 04:36:02 +00:00
27c8b2773a
Merge "Fix visibility for services-common lib"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-01-22 04:35:25 +00:00
062272b951
Merge "Build module common libs as system_current"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-01-22 04:35:11 +00:00
1fe6903738
Run NetworkStaticLibTests on the actual source files.
Currently, NetworkStaticLibTests tests the class files that are
on the bootclasspath of the device. This makes running these
tests slow and/or confusing, because the framework must be
rebuilt and the device flashed before running the tests, and if
this is not done, the old code will be tested instead.

Instead, jarjar the tests so the test can be run without updating
the device.

Bug: 142892223
Test: atest NetworkStaticLibTests passes on device that does not have the library
Change-Id: I6a0dbebddbd0b64e2722078345ffe6b0c0a1801e

Lorenzo Colitti   commited 2020-01-21 15:52:34 +09:00
5d9f8ed872
Statically link DnsSdTxtRecord into framework-wifi
DnsSdTxtRecord is @hide, thus need to statically
link it into framework-wifi.

Bug: 135998869
Test: boots up and connects to wifi
Merged-In: Ic5f7decfdbc3116a15fe8da3841cc7620105996d
Change-Id: Ic5f7decfdbc3116a15fe8da3841cc7620105996d
(clean cherry-pick from internal branch)

David Su   authored and   Remi NGUYEN VAN   commited 2020-01-21 10:41:14 +09:00
37535278c4
libs(net/common): Create filegroups for wifi sources
Safer for wifi to just include the sources that it needs. Then there is
no accidental risk of un-jar-jar'ed classes showing up in it's
namespace.

Bug: 135998869
Test: Compiles
Merged-In: I2532f640fbebd4ca82be7bbb63744bcad653ac34
Change-Id: I2532f640fbebd4ca82be7bbb63744bcad653ac34
(clean cherry-pick from internal branch)

Roshan Pius   authored and   Remi NGUYEN VAN   commited 2020-01-21 10:41:14 +09:00
864bdec16e
Fix visibility for services-common lib
f/b/services/net should be allowed, not just f/b/services.

Test: Dependent change using the build rule builds
Bug: 138306002
Merged-In: Ide48e637df6e1c21cd7c0c688e3fef2ba1c97deb
Change-Id: Ide48e637df6e1c21cd7c0c688e3fef2ba1c97deb
(clean cherry-pick from internal branch)

Remi NGUYEN VAN   commited 2020-01-21 10:41:14 +09:00
376f8d4922
Build module common libs as system_current
The libraries need to build as system_current since they will be used in
modules that should build against that SDK.

As notable changes, NetworkFactory stops using a common BASE for
handler messages, as no message ID is shared with other handlers (all
public messages numbers are for receiving only). It also indexes
NetworkRequests by using the request itself in the request table; this
is fine because .equals() / .hashCode() are implemented properly, and
no request can be used that has the same ID but differences in other
members.

Test: built, flashed, WiFi and telephony working
Test: atest FrameworksNetTests FrameworksWifiTests \
          FrameworksTelephonyTests
Bug: 138306002
Merged-In: I2ea2be0039b67ba34fc26e62bdb839ab7d42300c
Change-Id: I2ea2be0039b67ba34fc26e62bdb839ab7d42300c
(clean cherry-pick from internal branch)

Remi NGUYEN VAN   commited 2020-01-21 10:41:14 +09:00
ce241a3b79
Add a net-utils-telephony-common library for NetworkFactory.
A separate target is necessary for telephony as it needs to jarjar
included classes.

Test: atest FrameworksNetTests FrameworksWifiTests \
          FrameworksTelephonyTests
Bug: 138306002
Change-Id: I4b7f79fc43fe5820c94226662bee0216b61fc599
Merged-In: I4b7f79fc43fe5820c94226662bee0216b61fc599
(clean cherry-pick from internal branch)

Lorenzo Colitti   authored and   Remi NGUYEN VAN   commited 2020-01-21 10:41:05 +09:00
e14bd343e0
Add net-utils-services-common library
net-utils-services-common-srcs for files in src_servicescommon
and library net-utils-services-common could be used in services.jar
or modules.

Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksTelephonyTests
Change-Id: I5043a34100e9ef26148e3a0c1743363d063a3604
Merged-In: I5043a34100e9ef26148e3a0c1743363d063a3604
(clean cherry-pick from internal branch)

Aaron Huang   authored and   Remi NGUYEN VAN   commited 2020-01-21 10:40:58 +09:00
57a9496f19
Add a new static library for mainline modules
Add a network static library for common utilities. This
library could be used by all mainline modules. Initially
create LinkPropertiesUtils and MacAddressUtils.

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: build lib pass
      atest NetworkStaticLibTests
Change-Id: I8f79e4f836819ac83007acffb55103e5d69873e0

Aaron Huang   commited 2020-01-13 00:43:22 +08:00
f73ff8cfce