Commit Graph

1238 Commits

Author SHA1 Message Date
Motomu Utsumi
2359e7b554 Remove defaultEnabled arg from isNetworkStackFeatureEnabled
Test: NetworkStaticLibsTests
Bug: 279108992
Change-Id: Id5409158fd720efc92e1b39678e636a8a7d5a0a5
2023-09-27 17:39:31 +09:00
Motomu Utsumi
ed4e7ec954 Update the logic of isFeatureEnabled and isFeatureNotChickenedOut
If the flag value is unset or 0, isFeatureEnabled return false and
isFeatureNotChickenedOut return true.
If the flag value is -1 (force disable), both return false.
If the flag value is other values, both query the package version and
return `flagValue <= packageVersion`

Now the only difference is a default behavior when the flag is not set
or 0.
So isFeatureEnabled and isFeatureNotChickenedOut can use the same flag.

This CL also fixes the issue in rollback.
Before this CL, isFeatureNotChickenedOut did not check the module
version and could have a issue if there is a rollback.

Test: NetworkStaticLibsTests
Bug: 279108992
Change-Id: I12d6ebadff3aee7b7c614aca4eb0a34ef0db9857
2023-09-27 17:30:01 +09:00
Motomu Utsumi
195a30f02e Remove lint-baseline in staticlibs
Bug: 300384860
Test: TH
Change-Id: Ic26efebc24b3f7030b6ff66579fc0f5e5d019d5f
2023-09-27 17:24:30 +09:00
Treehugger Robot
1b0f6fe058 Merge "use different log.h header file" into main 2023-09-22 04:11:47 +00:00
Jean Chalard
487191dbe6 Merge changes I8843ce7c,I90566998 into main
* changes:
  Block the package updater while CTS are running
  Add a command to block networking for an app
2023-09-22 02:26:19 +00:00
Maciej Żenczykowski
601d9f8b65 use different log.h header file
Test: TreeHugger
Bug: 299653233
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1e5c7bfc86d2ad61c0bad3b5ef2add94b4ce1481
2023-09-21 22:11:43 +00:00
Chalard Jean
3a6544fb1f Block the package updater while CTS are running
Test: manual
Bug: 284534251
Change-Id: I8843ce7c9e14cfe3f6f3439405d519587f2656ef
2023-09-21 12:57:10 +09:00
Maciej Żenczykowski
127a1441c3 bump min_sdk_version from 29 (Q) to 30 (R)
Mainline no longer supports Q.
These files were recently moved into p/m/C as part of a refactor.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0f06ace921db6c79d63c0048bdb73d167ff606cf
2023-09-19 23:22:58 +00:00
Remi NGUYEN VAN
f1846ac13b Check that wifi, cell validates before tests
Tests are sometimes run on hardware devices with wrongly configured wifi
or cell data. Ensure that this is reported as an infra error, and not a
test error, so the root cause is easier to identify.

Bug: 264170054
Test: atest
Change-Id: I4f964fbd4ee497e8ac92f7729375b75b6c4594a3
2023-09-19 17:26:20 +09:00
Motomu Utsumi
c480039309 Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into libs_net_move_merge
frameworks/libs/net/common ->
packages/modules/Connectivity/staticlibs

frameworks/libs/net/client-libs ->
packages/modules/Connectivity/staticlbs/client-libs

Test: TH
Bug: 296014682
Change-Id: I5dc78f0c4653e20312ab3d488b1e69262dbb9840
2023-09-11 11:53:46 +09:00
Motomu Utsumi
89e9fac536 Merge common/ from platform/frameworks/libs/net/ to staticlibs/ 2023-09-11 11:27:49 +09:00
Motomu Utsumi
daae5ca53d Merge "Rename to isNetworkStackFeatureEnabled" into main 2023-09-08 09:27:13 +00:00
Motomu Utsumi
958ee15299 Merge "Remove unnecessary arguments from isTetheringFeatureEnabled" into main 2023-09-08 09:24:57 +00:00
Maciej Żenczykowski
05304f1437 Merge "fix a compile warning about out of order field init" into main 2023-09-07 15:25:55 +00:00
Xiao Ma
e129bc5958 Merge "Add IA Address option struct." into main 2023-09-07 08:43:12 +00:00
Xiao Ma
af996bec47 Merge "Remove the VisibleForTesting annotation on IaPrefixOption constructor." into main 2023-09-07 08:18:23 +00:00
Maciej Żenczykowski
325f675273 fix a compile warning about out of order field init
http://cs/h/prodkernel/kernel/upstream/torvalds/linux-2.6/+/master:tools/include/uapi/linux/bpf.h?l=1486

struct { /* anonymous struct used by BPF_PROG_TEST_RUN command */
		__u32		prog_fd;
		__u32		retval;
		__u32		data_size_in;
		__u32		data_size_out;
		__aligned_u64	data_in;
		__aligned_u64	data_out;
...

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2c08b65bdcdbd7fb9872b6d4cbbf542fe28ef916
2023-09-06 23:51:37 +00:00
Motomu Utsumi
eff2facfd5 Merge common/ from platform/frameworks/libs/net/ to staticlibs/ 2023-09-05 19:04:56 +09:00
Motomu Utsumi
e323c1db81 Rename to isNetworkStackFeatureEnabled
DeviceConfigUtils had isFeatureEnabled for NetworkStack and Tethering
which were confusing since the difference was only the arguments.
This CL renames isFeatureEnabled for NetworkStack module to
isNetworkStackFeatureEnabled to avoid confusion.

This CL also removes unnecessary arguments.

Bug: 279108992
Test: m
Change-Id: I523b98bd3754c209c64ce7d1513b5afcb36599b9
2023-09-05 17:50:24 +09:00
Motomu Utsumi
6a22207190 Remove unnecessary arguments from isTetheringFeatureEnabled
Test: m
Bug: 279108992
Change-Id: Iadc1b4665c364bf754ed32e7bb53b78e555ed457
2023-09-05 17:50:15 +09:00
Yuyang Huang
343683916f Merge "Add util to check if permission has system signature" into main 2023-09-05 08:45:40 +00:00
Motomu Utsumi
49ca226029 Merge client-libs/ from platform/frameworks/libs/net/ to staticlibs/client-libs/ 2023-09-05 15:43:10 +09:00
Mark White
1b6679da15 Merge "Created empty framework-location non-updatable module" into main 2023-08-31 16:00:54 +00:00
Xiao Ma
bdd723259e Merge "Add isNetworkStackFeatureNotChickenedOut API for NetworkStack module." into main 2023-08-31 03:11:01 +00:00
Junyu Lai
fefde209df Merge "Make structs in StructTest accessible from Struct" into main 2023-08-29 10:44:51 +00:00
Junyu Lai
e2eff036ed Make structs in StructTest accessible from Struct
After link Struct statically into framework-connectivity,
the structs in StructTest are no longer accessible from Struct
because Struct is loaded by bootclasspath classloader.
Make classes and members public for accessing from Struct.

Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.StructTest
Bug: 297836825
Change-Id: I3b1f466f10247306c84d6cac0d7402353770fac4
2023-08-29 10:33:38 +08:00
Mark White
66d39cdccd Created empty framework-location non-updatable module
Bug: 289776578
Test: m CtsLocationCoarseTestCases CtsLocationFineTestCases CtsLocationGnssTestCases CtsLocationNoneTestCases CtsLocationPrivilegedTestCases
Change-Id: I6922384386e6e6467484d20f6db74a4e49209374
2023-08-28 12:15:22 +00:00
Xiao Ma
9209b00164 Add isNetworkStackFeatureNotChickenedOut API for NetworkStack module.
Bug: 279108992
Test: atest NetworkStaticLibsTests
Change-Id: If42eb401b812017bd4d724b4323a8d51f7430606
2023-08-28 17:52:04 +09:00
Yuyang Huang
82952a2228 Add util to check if permission has system signature
Bug: 294777050
Test: m
Change-Id: I66e94595ce5f4ab3b4f372e4e5e6cb06dc686c21
2023-08-24 16:48:48 +09:00
Yuyang Huang
62a016e514 Merge "Move ArpPacket.java to frameworks/libs/net" into main 2023-08-24 07:12:27 +00:00
Motomu Utsumi
2330eae94d Merge "Add libnetd_utils_headers cc_library_headers" into main 2023-08-24 06:39:11 +00:00
Yuyang Huang
6acc55e129 Move ArpPacket.java to frameworks/libs/net
Bug: 281639507
Test: TH
Change-Id: Ic0d273695d3f0f85a0ec56337a9d12d77b60ea3b
2023-08-24 12:48:02 +09:00
Motomu Utsumi
7bca2922b8 Add class to help Kotlin to pass nullable to java @NonNull for testing
Follow up CL for aosp/2700076

Bug: 296972712
Test: build with aosp/2688146
Change-Id: Ib582ef41f34baf0bb896e32d681843358f928c87
2023-08-23 13:01:29 +09:00
Motomu Utsumi
68cd731381 Add libnetd_utils_headers cc_library_headers
There is a module that specifies libnetdutils/include from include_dirs
which is not recommended.
Using the cc_library_headers makes it easy to move
frameworks/libs/net to packages/modules/Connectivity.

Bug: 296014682
Test: m

Change-Id: Ia52ede9787009102ebf626fcb3b337511b0a809f
2023-08-22 19:16:12 +09:00
Maciej Żenczykowski
1ef814da95 Merge "BpfMap.h - hide getMap()" into main 2023-08-22 00:32:09 +00:00
Maciej Żenczykowski
12c0ea929c BpfMap.h - hide getMap()
This leaks (what should be) an internal only fd.

There's still multiple uses of getMap() left in:
  common/native/bpf_headers/BpfMapTest.cpp

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I87a36f3f935ba9148ae4456fc6bf14b0e04f6038
2023-08-21 19:53:04 +00:00
Colin Cross
1d1c0e7282 Merge "Fix kotlin nullable errors in net-test-utils and NetworkStaticLibTests" into main 2023-08-21 19:04:15 +00:00
Maciej Żenczykowski
ef136ebfa1 Merge "BpfMap.h - add 3 using statements" into main 2023-08-21 17:20:17 +00:00
Maciej Żenczykowski
82ae7ff289 Merge "BpfMap.java - remove getNextRawKey()" into main 2023-08-21 17:15:32 +00:00
Maciej Żenczykowski
4ed5e9e497 Merge "BpfMap.java - remove getRawValue()" into main 2023-08-21 17:15:14 +00:00
Maciej Żenczykowski
2bb8c5cd27 Merge "BpfMap - slightly simplify isEmpty()" into main 2023-08-21 17:14:55 +00:00
Motomu Utsumi
656c77f4f0 Merge "Rename to isTetheringFeatureEnabled" into main 2023-08-21 03:17:38 +00:00
Chiachang Wang
bdbcc0cc30 Merge "Address review comments in aosp/2677976" into main 2023-08-21 02:34:01 +00:00
Maciej Żenczykowski
eb1eb69f86 BpfMap.h - add 3 using statements
in particular base::Result is needlessly verbose

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ide0de9acec79b9aeeaff7ec92270304907bd10d4
2023-08-20 23:33:46 +00:00
Maciej Żenczykowski
b6a23b1504 BpfMap.java - remove getRawValue()
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6903a29773ee4782c0f2ae64561e1c0fdcba618f
2023-08-20 14:05:43 +00:00
Maciej Żenczykowski
2c87b82603 BpfMap.java - remove getNextRawKey()
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ida62d346c1d6df800b5d45b67de60e945ac2b4c8
2023-08-20 13:01:13 +00:00
Maciej Żenczykowski
910cf4da9b BpfMap - slightly simplify isEmpty()
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9b93224ec2d4ff717d5e39c3ad50e63ac73f5f7c
2023-08-20 12:03:26 +00:00
Patrick Rohr
10fe61b520 Merge "Improve test logs using TrackRecord backtrace" into main 2023-08-18 22:32:51 +00:00
Patrick Rohr
5bf2947997 Improve test logs using TrackRecord backtrace
eventuallyExpect methods should print the received callbacks since
poll() was called for better debugging.

Test: atest EthernetManagerTest
Change-Id: Ia08abf2436b050a7e319b9f70694ce3d132b4fc3
2023-08-18 09:35:13 -07:00
Patrick Rohr
0622dafd75 Merge "TrackRecord: add a method to return callbacks since last poll" into main 2023-08-18 14:10:21 +00:00