Added SPDX-license-identifier-Apache-2.0 to:
common/testutils/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Exempt-From-Owner-Approval: janitorial work
Change-Id: Ib947b1cd6eae235e77cd55d57673360c426e80f1
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
Test: build pass with or without aosp/1469125 in frameworks/base
Test: atest NetworkStatsServiceTest TetheringTests
Bug: 149467454
Change-Id: Ie3971ed3b18e0f1a54d4834e310bc6df82e5acdd
This provides some support for tests that want to test the new
onBlockedStatusChanged(Network, int) callback. This cannot be
implemented entirely in TestableNetworkCallback, because in
Kotlin, "override" is a mandatory keyword, but NetworkCallback
(which TestableNetworkCallback inherits from) only has the new
method in S, not R.
The unit tests in the other CL in this topic provide an idea of
how to do this. There may be more elegant ways to do it though.
Bug: 165835257
Test: new ConnectivityServiceTest tests in this topic
Change-Id: Ibdf36a6bc916bf247688c19bfd81f6b62d59bf03
Lorenzo Colitticommited 2021-03-25 01:42:51 +09:00
The utility is @UnsupportedAppUsage, and also used by internal classes
like WifiTrackerLib or Mms, so it needs to be in a shared location.
Bug: 182859030
Test: atest NetworkStaticLibTests
Change-Id: Ia2be2ef62ea1e7dfdff1f54a14d8f2e282d36fca
The mocking of services was incorrect for services queried by class name
instead of service name.
Fix getSystemService mocking to cover both methods.
Bug: 181837977
Test: atest NetworkStaticLibTests
Change-Id: Ifc9bc26e85b5152754941bbe33bccdefff62195a
This is a near trivial copy of NaHeader & buildNaPacket()
Test: builds
Bug: 154669942
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3b9b15e23317363bf9556b06ddecf8a2bf967c61
Maciej Żenczykowskicommited 2021-03-15 20:58:17 -07:00
This will increase test coverage numbers for Tethering until
TetheringPrivilegedTests can be put into coverage runs.
Bug: 182785371
Test: atest NetworkStaticLibTests
Change-Id: Id93e6190e76bfacfe17082848d40f161b3fcab6a
Lorenzo Colitticommited 2021-03-16 00:14:48 +09:00
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
The corresponding class was moved to frameworks/libs/net, so the test
needs to be in the frameworks/libs/net tests too.
Bug: 182785371
Test: atest NetworkStaticLibTests
Change-Id: I761544ec0b2513bf0e3115fd0eaecf47efacda62
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