Commit Graph

272 Commits

Author SHA1 Message Date
Xiao Ma
a76690a3b7 Introduce cache schema for generic Struct class.
Bug: 163492391
Test: atest android.net.util.StructTest --rerun-until-failure
Change-Id: Idffad7d3b907d8853ed7d296808a2e0e2736cbbe
2020-11-24 18:03:07 +09:00
Baligh Uddin
ae4770df38 Add visibility rules for packages/modules/Connectivity/Tethering
BUG: 167962976
Test: TH
Change-Id: I4f9c63d27fe7f10534e89f3d132f26b2f45e7b07
2020-10-29 03:57:51 +00:00
Mark Chien
dea71cd586 Merge "Move jarjar rules from NetworkStaticTestsLib to NetworkStaticTests" 2020-10-26 12:22:32 +00:00
markchien
c064abd0db Move jarjar rules from NetworkStaticTestsLib to NetworkStaticTests
jarjar should be applied on the final artifact (android_test,
android_app, java_library that goes into an apex), not on any
intermediate (android_library etc).

Bug: 171670016
Test: atest NetworkStaticTests
      atest TetheringCoverageTests
      atest NetworkCoverageTests
Change-Id: I86a15133112c555e08275efbde99e68315aa6bc2
2020-10-26 09:52:13 +00:00
Chalard Jean
c746481d10 Add basic tests for CompareResult
...as suggested in aosp/1448415

Test: this
Change-Id: I8469ba6cbcbd9c1b414cfde6cda27505c210526c
2020-10-19 16:17:50 +09:00
Xiao Ma
ea53144db0 Improve code style in Struct.java and add tests for Type.U64 represented
by long primitive.

Bug: 163492391
Test: atest android.net.util.StructTest --rerun-until-failure
Change-Id: I0120d7ab063d9d170e8b6e6a6077f8f86db93d67
2020-10-13 06:59:51 +00:00
Xiao Ma
1f2650f6d6 Merge "Define a generic class to parse structured message." 2020-10-09 13:20:31 +00:00
Xiao Ma
6f95cefd38 Define a generic class to parse structured message.
Bug: 163492391
Test: atest android.net.util.StructTest --rerun-until-failure
Change-Id: I1848984d80998d87acccc52287a351d27708dedc
2020-10-09 18:25:34 +09:00
Remi NGUYEN VAN
ff57cec7d1 Move IpUtils to frameworks/libs/net
The utility classes are useful for mainline modules and their tests, for
example IpClientIntegrationTest.

Bug: 168868607
Test: m && atest NetworkStackCoverageTests
Change-Id: Ie3eea7731fa45cd58cd4acf8249da68ff3eb6a70
2020-10-05 11:25:18 +09:00
Chalard Jean
b1856fe06b Rename utils to remove the Kt suffix
Nobody cares what language this is written in

Test: builds
Change-Id: I3ed3bce276479fd503e716a06fd4912da8c49eda
2020-07-31 15:24:34 +09:00
Chalard Jean
48c6c7d838 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
2020-07-30 22:10:51 +09:00
Remi NGUYEN VAN
f109837101 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
2020-06-30 19:19:52 +09:00
Luke Huang
85c290e33e Move DnsPacket to libs/net
This class might be used by some mainline modules.
Cut the dependency between it and framework base classes.

Bug: 151052811
Test: atest DnsPacketTest
Test: atest DnsResolverTest
(clean cherry-pick from internal branch)
Merged-In: Id12aaedb6dd75144ca9b58b94bfcd845a1f16360
Change-Id: Id12aaedb6dd75144ca9b58b94bfcd845a1f16360
2020-06-24 19:37:25 +08:00
markchien
ba972ca71f Make NetworkStaticLibTests as test lib
Share the tests with TetheringCoverageTests because
tethering module use net-utils-framework-common.

Remove unused static library. Currently we do not implement any
unit test for net-utils-services-common. "net-utils-services-common"
can be back when we add new test for it.

Bug: 148636687
Test: atest NetworkStaticLibTests
      atest TetheringCoverageTests
Change-Id: I2f3a94b2ba50cd4d73303961bf1661a3091ab033
2020-04-22 03:04:37 +00:00
Benedict Wong
3fa91de697 Merge "Add IpRange utility to convert IP ranges to IpPrefix" 2020-02-04 22:49:50 +00:00
Benedict Wong
db0915c14c Add IpRange utility to convert IP ranges to IpPrefix
IKE Traffic Selectors are defined to be an IP range, with a start and an
end IP address. However, the Android system works in IP Prefixes. This
commit adds a utility to convert between the two.

Bug: 144246767
Test: New tests added, passing
Change-Id: I428fee682dea21346f92c5c628642dee3c785ba9
2020-01-29 23:08:10 -08:00
Tyler Wear
3767434b21 Update CompareOrUpdateResult with NULL NULL Check
Add a test to CompareOrUpdateResult where the new and old item
list are both NULL.

Test: Updated unit test
Change-Id: I6821028409d29ab864af52685629630cbf16db3b
2020-01-28 16:42:22 -08:00
Tyler Wear
65e8b66875 Update CompareOrUpdateResult with NULL Check
Like CompareResult, add in null check for input objects.

Test: updated unit test
Change-Id: Iea63752ff23a5bfb1cc5cb716ec579bec6c403bf
2020-01-27 10:55:38 -08:00
Lorenzo Colitti
9c0c6a5c05 Add a CompareOrUpdateResult class.
This is like CompareResult, but also has the concept of an item
being "updated" (i.e., the same, but with different properties,
in the old and the new list of items). This is needed to support
updating routes.

Bug: 142892223
Test: new unit test
Change-Id: Ide5e31acb9baa6a5d3f50e9965d4019eb7c82cd4
2020-01-21 17:26:48 +09:00
Lorenzo Colitti
5d9f8ed872 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
2020-01-21 15:52:34 +09:00
Aaron Huang
05a9dfef78 Add NetUtils to net static library
This class includes network common utilities.

Bug: 139268426
Bug: 135998869
Bug: 138306002
Bug: 143925787
Test: build lib pass
      atest NetworkStaticLibTests
Change-Id: I1ffe723aa4ff2ed7bc46f34106701c91fe93032a
2020-01-13 00:43:54 +08:00
Aaron Huang
f73ff8cfce 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
2020-01-13 00:43:22 +08:00