Commit graph

418 commits

Message SHA1
[LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
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

Bob Badour   commited 2021-03-30 22:55:10 -07:00
9802148967
Move net-test-utils to its own directory am: 0fb2de46f0 am: 3d9ec0a4b8
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1654919

Change-Id: Ic7f068d3f9729bb437d0b8dc0ff2c3df4b9d9434

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-31 03:02:21 +00:00
2a57145767
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
[SP28.1] Add onSetWarningAndLimit to test utilities am: 952e18da40 am: c8b2f91ce8
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1469182

Change-Id: I02adf6230ce92c47a8b89a780732905bd05cfbb2

junyulai   authored and   Automerger Merge Worker   commited 2021-03-29 12:12:20 +00:00
006b9353ea
[SP28.2] Add shims to allow test utils built against different SDKs am: ccd68dc9c9 am: ec3c6f19f4
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1654918

Change-Id: I7eb841a359da0600d2bb950eadbc490edd524afa

junyulai   authored and   Automerger Merge Worker   commited 2021-03-29 12:12:19 +00:00
229f13a51d
[SP28.1] Add onSetWarningAndLimit to test utilities
Test: atest NetworkStatsServiceTest
Bug: 149467454
Bug: 170699770
Bug: 170179169
Merged-In: I4cc242e5fba895bb0756733bafc5be1f39b10ac0
Change-Id: I4cc242e5fba895bb0756733bafc5be1f39b10ac0
  (cherry-picked from ag/13970092)

junyulai   commited 2021-03-29 16:38:51 +08:00
3a6ab33439
[SP28.2] Add shims to allow test utils built against different SDKs
Test: build pass with or without aosp/1469125 in frameworks/base
Test: atest NetworkStatsServiceTest TetheringTests
Bug: 149467454
Change-Id: Ie3971ed3b18e0f1a54d4834e310bc6df82e5acdd

junyulai   commited 2021-03-29 16:38:43 +08:00
2b6477198d
Make TestableNetworkCallback understand blocked reasons. am: 5d4e7a5d36 am: b14d6f3014
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1652229

Change-Id: I90fc1bd0b46d63e8dd0c4235ffa6241c7ec95aaa

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-26 04:36:02 +00:00
a0bb79a813
Make TestableNetworkCallback understand blocked reasons.
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 Colitti   commited 2021-03-25 01:42:51 +09:00
4441558954
Merge "Move trimV4AddrZeros to libs/net" am: 54fcb1500e am: 3bb6f4c4eb
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1637461

Change-Id: Id033fc4fab7daed52bf8736b2a65918e7a2b2863

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-18 04:28:50 +00:00
a858b66517
Merge "Move trimV4AddrZeros to libs/net"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-18 03:22:07 +00:00
f809c9beda
Merge "Fix LocationPermissionCheckerTest" am: 9a575c6994 am: 65a71a1643
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1637460

Change-Id: Ib093921a8c606db62e3a3821c08b9334e68c2035

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2021-03-16 07:08:53 +00:00
6c5e275ab8
add NsHeader class and implement buildNsPacket() am: 52a53ee514 am: 8aed802c1a
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1639369

Change-Id: I412661c6623e94c98628f31e63b693a5d88eddac

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2021-03-16 07:07:10 +00:00
6f4636ad2b
Merge "Fix LocationPermissionCheckerTest"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2021-03-16 06:42:28 +00:00
def99b7e52
Move trimV4AddrZeros to libs/net
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

Remi NGUYEN VAN   commited 2021-03-16 14:31:45 +09:00
f323faedfe
Fix LocationPermissionCheckerTest
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

Remi NGUYEN VAN   commited 2021-03-16 13:31:10 +09:00
aad6bc8614
add NsHeader class and implement buildNsPacket()
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 Żenczykowski   commited 2021-03-15 20:58:17 -07:00
c36f0b3f46
Merge "Move TrackRecordTest to libs/net" am: 36399b38e9 am: fe3a205244
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1635999

Change-Id: Ib97272360301f12dfa93799be2a930c3209188b2

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-16 02:48:24 +00:00
ceaff74e33
Merge "Move TrackRecordTest to libs/net"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-16 01:34:16 +00:00
9a392164a9
Add a simple test for Ipv6Utils. am: 98ff7450ab am: 50f4a073e0
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1636001

Change-Id: I7d1c9db8a040f4bb617c6bcd9916383d2551af65

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-16 00:56:25 +00:00
9674b4da33
Fix a bug in InetAddressUtils, and add a test. am: 928d2d4e32 am: 0afe0e9e5a
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1636000

Change-Id: If1ff9196851706f032d501c9f09609cfdcac9101

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-16 00:56:01 +00:00
b26091cb6e
Add a simple test for Ipv6Utils.
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 Colitti   commited 2021-03-16 00:14:48 +09:00
fd52eafb59
Fix a bug in InetAddressUtils, and add a test.
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 Colitti   commited 2021-03-15 23:24:06 +09:00
f4e9b9abcf
Move TrackRecordTest to libs/net
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

Remi NGUYEN VAN   commited 2021-03-15 23:11:41 +09:00
e38b5c29dc
Merge "[VCN04.1] Add assert tool for Set" am: ecb948964f am: ba307f5275
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1623673

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I66208320469f02fb0edda70dd17bd7e7d62deecd

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-03-12 08:24:46 +00:00
89efb0aac6
Merge "[VCN04.1] Add assert tool for Set"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-03-12 07:12:59 +00:00
9fd65a6a6a
Merge "Fix CompatUtil on Q and R" am: b2e6d5baf8 am: fe3d837f96
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1633099

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic09a5a945eec5ff65aac5f89436226d7f2bf69c5

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-12 05:51:29 +00:00
bccc7711a5
Merge "Move LocationPermissionChecker to libs/net" am: 73783aae63 am: a81bc09265
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1618685

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia2bb260043ed6dfaddf4762204720e7cd33a3884

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-12 05:51:23 +00:00
7c17ba8b5f
Merge "Fix CompatUtil on Q and R"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-12 04:54:57 +00:00
15cd8bd30f
Merge "Move LocationPermissionChecker to libs/net"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-12 04:21:41 +00:00
99b0a110ea
Fix CompatUtil on Q and R
CompatUtil was missing return statements and falled back to S
behavior even on Q and R.

Bug: 179329291
Change-Id: I8efb8e56948383c29d476e0b090619bac156d372
Test: atest CtsNetTestCasesLatestSdk

Remi NGUYEN VAN   commited 2021-03-12 01:25:40 +00:00
d105ecf8f1
Merge "Rename StringNetworkSpecifier to Ethernet" am: 1c22944c5e am: 1f5508fb1f
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1574563

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib1fca0cf784120c4c0618901844a777e85bcd094

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-12 00:26:45 +00:00
dca92bdec4
Merge "Rename StringNetworkSpecifier to Ethernet"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-11 23:51:49 +00:00
48c3682a14
Move LocationPermissionChecker to libs/net
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

Remi NGUYEN VAN   commited 2021-03-11 20:08:06 +09:00
59beee8742
Merge "Add helper function to check if collection is empty" am: 78e2f0d124 am: 0a62bcbc24
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1605116

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I220092ecca4049ba33f07d2de053b30fbe6a9069

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-11 03:18:26 +00:00
9345bf2179
Merge "Add helper function to check if collection is empty"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-03-11 01:03:15 +00:00
6918f36393
[VCN04.1] Add assert tool for Set
Test: TH
Bug: 175662146
Change-Id: Ib7e2e61a987def59f8e8fc841d07f37ae894573d

junyulai   commited 2021-03-09 20:08:38 +08:00
0c813cc91e
Merge "Add bit mask constants for the flags used in the ND packet." am: 98e9e80694 am: 41629888ac
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1619359

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iea0ba50e4fbf4cd9dfd9068fd477ea820cff3b11

Xiao Ma   authored and   Automerger Merge Worker   commited 2021-03-09 02:37:32 +00:00
2140d5140b
Merge "Add bit mask constants for the flags used in the ND packet."
Xiao Ma   authored and   Gerrit Code Review   commited 2021-03-09 01:10:44 +00:00
a7c245d1ce
Merge "Check the ByteArray actual size before writing it to ByteBuffer." am: b3a3042446 am: f18bfecc7d
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1566234

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia7c7c4afc4d3e67358bc4fcee008f398fcb8be22

Xiao Ma   authored and   Automerger Merge Worker   commited 2021-03-08 05:46:12 +00:00
1ef098c324
Merge "Check the ByteArray actual size before writing it to ByteBuffer."
Xiao Ma   authored and   Gerrit Code Review   commited 2021-03-08 04:30:17 +00:00
08e32b9378
Merge "Address the comments left in the IPv6 utils change." am: 7c875aafbd am: 020018a69c
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1608020

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I35f3d196b5081e6b27891acfe630c14ad8919a6a

Xiao Ma   authored and   Automerger Merge Worker   commited 2021-03-08 03:56:12 +00:00
ba67b9511f
[CS11]Remove the hidden API usage of BitUtils am: e845f644cd am: 35463a5721
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1618684

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I85150e0535d04ad42768314dc44008b896ee9434

lifr   authored and   Automerger Merge Worker   commited 2021-03-08 02:55:05 +00:00
95dbe797cc
Add bit mask constants for the flags used in the ND packet.
Bug: 168868607
Test: atest NetworkStackIntegrationTest
Change-Id: I6e7ed431f175e911eeff71fdf3f1e651533d3364

Xiao Ma   commited 2021-03-08 02:44:56 +00:00
5b4cfac125
Merge "Address the comments left in the IPv6 utils change."
Xiao Ma   authored and   Gerrit Code Review   commited 2021-03-08 02:44:42 +00:00
f1d9d84201
Address the comments left in the IPv6 utils change.
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

Xiao Ma   commited 2021-03-08 02:36:34 +00:00
5fbc8d5dca
[CS11]Remove the hidden API usage of BitUtils
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

lifr   commited 2021-03-05 16:55:56 +08:00
794adf5f71
[FUI22.1] Add assert utilities for list am: e454573fad am: b4af141a4d
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1614819

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0c8d08ebd37fe45a484ce61fb6a0bc2bff774390

junyulai   authored and   Automerger Merge Worker   commited 2021-03-04 04:21:45 +00:00
bfa12bf2b6
[FUI22.1] Add assert utilities for list
Test: atest NetworkStaticLibTests
Bug: 174123988
Change-Id: Id918227716367264042e6b674ce29c18e2d901e4

junyulai   commited 2021-03-03 21:07:13 +08:00
148bdcb48b
Check the ByteArray actual size before writing it to ByteBuffer.
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

Xiao Ma   commited 2021-03-03 02:53:33 +00:00
9164b775c1