InetAddressUtils's parcelInetAddress and #unparcelInetAddress
methods do not correctly parcel scoped IPv6 addresses. Fix this
by using the same code that LinkProperties uses, and add a test.
Bug: 182785371
Test: atest NetworkStaticLibTests
Change-Id: Idc9fcbcf4b2b0746c19831fef68b0ddc206eb161
Lorenzo Colitticommited 2021-03-15 23:24:06 +09:00
CompatUtil was missing return statements and falled back to S
behavior even on Q and R.
Bug: 179329291
Change-Id: I8efb8e56948383c29d476e0b090619bac156d372
Test: atest CtsNetTestCasesLatestSdk
LocationPermissionChecker was written to be used by multiple
connectivity modules, so it belongs in the frameworks/libs/net library.
The file is moved as-is with minor modifications in the test to avoid
usage of the privileged ActivityManager.getCurrentUser API.
Bug: 181837977
Test: atest NetworkStaticLibTests
Change-Id: I80cff14c06c3cab3e8f3bd1978c2951c4a3317c6
This follow-up change updates EtherType name in the Ethernet header
diagram, replaces "length" filed in the IPv6 header with "payloadLength",
and also make ND options constructor as package private to encapsulate
the constant params(e.g. ICMPv6 type/code).
Bug: 168868607
Test: atest NetworkStackIntegrationTest
Change-Id: Ia0500a7020fd9a85dce2a8c67c21b00b238a4e8d
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 NetworkStaticLibTests
Change-Id: I56286b2991ea9902f9ed78624e2a592138dd4315
ByteArray is the unique type whose actual size might be different
with the size delcared in the annotation, e.g, user initializes an
object manually, or mutates the byte array after parsing from
ByteBuffer. Therefore, checking the length of byte array is required
before writing the array value to output bytes array or ByteBuffer.
Bug: 163492391
Test: atest NetworkStaticLibTests
Change-Id: I28936a2afbe60dd2dadac803d08062df153b2588
indexOf() is based on the current any() implementation, but gives more
flexibility as the caller can know the position of the found element.
Bug: 174541037
Test: atest NetworkStaticLibTests
Change-Id: I1d679b8369aeee359516bb5ca4275c744a606c3a
To keep the tests passing on Q and R, add a CompatUtil class that will
keep creating StringNetworkSpecifiers (now removed) instead.
Bug: 179329291
Test: atest CtsNetTestCases
Merged-In: I14c1ac7cee0ec32353b38ebca4ae6c5cd2e25541
Change-Id: I14c1ac7cee0ec32353b38ebca4ae6c5cd2e25541
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
Instead of having the cached version field protected, which is only
usable by DeviceConfigUtilsTest, have a public method to reset it to -1
so that other tests exercising feature flags can reset it before and
after running.
Bug: 173068192
Test: atest NetworkStaticLibTests
Change-Id: I8f5be3c91b2a47070507d5bf263e2e5d7d9d9d14
Also remove the DEFAULT_LINK_MTU constant, it's dup with ETHER_MTU.
The caller should select the appropriate MTU based on specific link
layer MTU.
Bug: 138926174
Test: atest NetworkStackIntegrationTest
Change-Id: I85e2c487298efaa0032eff3914029801580bb2c4
Proxy is moving into connectivity mainline and its hidden methods
are not accessible outside the module. Thus, move the shared
methods and constants to ProxyUtils to share between module and
platform.
Bug: 172183305
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases:ProxyInfoTest
Change-Id: I7153ce4e77b80964ffad67254b6329973ed61f30
The getNetworkPart() method is used by Settings and wifi. The
method was inside NetworkUtils, but NetworkUtils is moving
to connectivity mainline module. Methods in NetworkUtils will
not be accessible outside module. Thus, move the shared method
and the corresponding helper method to share lib.
Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: Ic39f0debf1146dd84db962857dcead6b498aec49
This patch creates a class in the static lib that contains utils
of NetworkIdentity.
Test: atest NetworkIdentityUtilsTest
Bug: 174123988
Change-Id: I6f0780190017b5eef3312b764107ac1f00e06833
PermissionMonitor is using ArrayUtils#indexOf often in checking
permission methods. It's better to have this method in
CollectionUtils.
Also implement contains() by indexOf method.
Bug: 174541037
Test: atest FrameworksNetTests
Change-Id: I32e2ca815dd35eae9c31188856068eaf3458d250
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
lucaslinauthored and Lucas Lincommited 2021-02-01 07:24:37 +00:00