Commit Graph

545 Commits

Author SHA1 Message Date
lucaslin
c01630e963 Add test for Vpn#prepare()
Add test for Vpn#prepare() to check if the SecurityException will
be thrown when the caller is not the SYSTEM_UID and doesn't have
CONTROL_VPN permission and its package doesn't match the oldPackage
or the newPackage.

Ignore-AOSP-First: It's a part of security patches.
Bug: 191276656
Test: atest FrameworksNetTests:VpnTest
Change-Id: Ibe0b245561b00442a6377fb849603f8b9026e9c4
Merged-In: Ibe0b245561b00442a6377fb849603f8b9026e9c4
2021-12-23 06:53:18 +00:00
Junyu Lai
2e158b9229 Merge "[MS15.2] Move SUBSCRIBER_ID_MATCH_RULE_* constants to static lib" am: 78d36d7653 am: 6e952001f8 am: e30e727a57
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1930824

Change-Id: I6c64d586daffeb1fd226dabd238ea8b2cfca5b4d
2021-12-23 02:17:03 +00:00
Junyu Lai
78d36d7653 Merge "[MS15.2] Move SUBSCRIBER_ID_MATCH_RULE_* constants to static lib" 2021-12-23 01:35:00 +00:00
Frank Li
32bde18ab2 Merge "[DU02]Remove DevicePolicyManagerInternal from NetworkStatsAccess" am: bacbe802c1 am: 6f9dbdb13a am: 0f96c5d627
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1925684

Change-Id: Ib7fa09e37b46cc7d3fdd5b2c37cc7afd95ff68cc
2021-12-22 15:05:17 +00:00
Frank Li
bacbe802c1 Merge "[DU02]Remove DevicePolicyManagerInternal from NetworkStatsAccess" 2021-12-22 14:13:55 +00:00
Junyu Lai
07c772cf49 [MS15.2] Move SUBSCRIBER_ID_MATCH_RULE_* constants to static lib
Subscriber Id Match Rules won't be exposed as system Api.
Any caller who references NetworkTemplate#SUBSCRIBER_ID_MATCH_RULE_*
should use the one in NetworkStatsUtils instead.
And remove the need of the constants as soon as possible.

Test: atest NetworkPolicyManagerServiceTest \
      FrameworksNetTests
Bug: 204830222
Change-Id: I363a4440f85f1ca818eaf1125e45b141dd6f0e55
2021-12-22 09:41:29 +00:00
Jack Yu
aef2883f44 Added a new network capability MMTEL am: 04bbc5b9b0 am: c98051396a am: 69f3375c30
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1930920

Change-Id: I5b95957f95dc05fca7c5f77de9ad16a5d3f86f23
2021-12-22 09:39:13 +00:00
Jack Yu
04bbc5b9b0 Added a new network capability MMTEL
Added NET_CAPABILITY_MMTEL to indicate a network
support MMTEL (Multimedia telephony). This is for
IMS service to request an IMS network that supports
voice or PS (VoPS for 4G, VoNR for 5G).

This was previously submitted as aosp/1927841, but
which got reverted due to breaking the mainline
build, which uses the pre-built module.

Bug: 210774375
Test: atest ConnectivityServiceTest
Change-Id: If8b691ff4999a4dbf54e7567d9ca74d743dc5ded
2021-12-21 16:31:30 +00:00
lifr
5f66ddac71 [DU02]Remove DevicePolicyManagerInternal from NetworkStatsAccess
NetworkStatsAccess is using DevicePolicyManagerInternal APIs, which
cannot be accessed after moving into the mainline module. So, replace
and remove those hidden API usages.

Bug: 207100745
Test: atest NetworkStatsAccessTest
Change-Id: I0430ed2c47e5a695206cb660e3971ddab6c467dd
2021-12-21 23:45:28 +08:00
Treehugger Robot
8df99de1be Merge "[MS12.2] Add unit test for NetworkTemplate builder" am: 05e12e6f79 am: f5c2f797da am: 9aa4bedc7b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1928058

Change-Id: I2a52227b981ef2da7387b5184bbd882776264a46
2021-12-21 15:40:12 +00:00
Martijn Coenen
27c4f5b400 Merge "Revert "Added a new network capability MMTEL"" am: e5b150a3cd am: 5611484dc1 am: 92ad6580af
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1928149

Change-Id: I25faa69306e474d025bdb94419dfcc86e1728efe
2021-12-21 12:09:18 +00:00
Treehugger Robot
0902b55cf5 Merge "Added a new network capability MMTEL" am: 95d180b5bf am: a28c684662 am: f8ead572a1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1927841

Change-Id: Idb64a787afa8bdbd49c7a319238b6e45553c93b6
2021-12-21 12:08:18 +00:00
Martijn Coenen
e5b150a3cd Merge "Revert "Added a new network capability MMTEL"" 2021-12-21 11:27:16 +00:00
Martijn Coenen
6ebc8ba595 Revert "Added a new network capability MMTEL"
Revert "Added setup/tear down data support"

Revert "Added a new network capability MMTEL"

Revert submission 1927643-mmtel_capability

Reason for revert: b/211586152
Reverted Changes:
Ifea8b1e40:Added a new network capability MMTEL
I38655bef2:Added a new network capability MMTEL
I837606d9e:Added setup/tear down data support
I2c7b291fe:Added a new network capability MMTEL

Change-Id: Ie9b0b0d9017ef8aea7fbb56dda522e7c433144b9
2021-12-21 11:24:01 +00:00
Treehugger Robot
95d180b5bf Merge "Added a new network capability MMTEL" 2021-12-21 10:42:37 +00:00
Junyu Lai
00a8897e98 [MS12.2] Add unit test for NetworkTemplate builder
Test: atest NetworkTemplateTest
Bug: 204830222
Change-Id: Ie83cd4322418449980bece7e13d68f2cacbaf1ef
2021-12-21 03:26:04 +00:00
Junyu Lai
0578623176 Merge "[MS10.2] Move multiplySafeByRational to NetworkStatsUtils" am: c6f89d4832 am: c407c3315f am: 2840adf26f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1919247

Change-Id: Ic776001582760a04efb631616c130bf4260e4b9a
2021-12-21 01:51:07 +00:00
Junyu Lai
c6f89d4832 Merge "[MS10.2] Move multiplySafeByRational to NetworkStatsUtils" 2021-12-21 01:22:14 +00:00
Junyu Lai
b3e62b8d1d [MS10.2] Move multiplySafeByRational to NetworkStatsUtils
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.NetworkStatsUtilsTest
Bug: 204830222
Change-Id: Ib2464bd7607c7ef35fed780fccbc745b565a908c
2021-12-20 09:10:50 +00:00
Treehugger Robot
e48a86422a Merge "Rename libbpf to libbpf_bcc" am: e44ea016e1 am: 7bf5e61c37 am: 05d00b50fd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1906032

Change-Id: Ia0bba1c182fe43b01126e88f86f97c9c09163e59
2021-12-17 01:30:27 +00:00
Treehugger Robot
e44ea016e1 Merge "Rename libbpf to libbpf_bcc" 2021-12-17 00:37:05 +00:00
Jack Yu
f322d4f5e0 Added a new network capability MMTEL
Added NET_CAPABILITY_MMTEL to indicate a network
support MMTEL (Multimedia telephony). This is for
IMS service to request an IMS network that supports
voice or PS (VoPS for 4G, VoNR for 5G).

Bug: 210774375
Test: atest ConnectivityServiceTest
Change-Id: Ifea8b1e40f65c610e925a27be873930fee2df693
2021-12-16 14:38:10 -08:00
Aaron Huang
767e59c01b Merge "Add makeDependencies method in IpSecService related tests" am: 3c1e7398a4 am: c6b730ce81 am: 1bf71ba427
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1904464

Change-Id: I8598dd981e5efab1153e0b2068db45e8e2ee5510
2021-12-16 13:22:00 +00:00
Aaron Huang
3c1e7398a4 Merge "Add makeDependencies method in IpSecService related tests" 2021-12-16 12:32:41 +00:00
Aaron Huang
70e3b16dcf Merge "Change to use Dependencies in IpSecService Tests" am: 286c0e5336 am: 90f307450c am: e4d6a01bcd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1904463

Change-Id: Ic7621cd1ae8faaab4021d33e42ccc2d9c4237c9b
2021-12-15 08:51:23 +00:00
Aaron Huang
286c0e5336 Merge "Change to use Dependencies in IpSecService Tests" 2021-12-15 07:53:23 +00:00
Treehugger Robot
23ec69be0f Merge "[MS07.2] Move NetworkStatsCollection/IdentitySet into frameworks" am: 7577131341 am: a9656625d2 am: bb49fe4bef
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895330

Change-Id: Id03f0efb4d052fd2da6bfd3d50bbb9a94cd299da
2021-12-10 19:35:17 +00:00
Treehugger Robot
a9656625d2 Merge "[MS07.2] Move NetworkStatsCollection/IdentitySet into frameworks" am: 7577131341
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895330

Change-Id: I3d84b1a82e07a9b4a56ddc88f3f81d875870517c
2021-12-10 18:57:07 +00:00
Aaron Huang
9792b5b5e6 Add makeDependencies method in IpSecService related tests
Bug: 204153604
Test: FrameworksNetTest
Change-Id: Iea5731273e4772966466088f11a4c6334fa19f5d
2021-12-10 12:11:20 +00:00
Junyu Lai
e9710f0918 [MS07.2] Move NetworkStatsCollection/IdentitySet into frameworks
These files are needed for the data migration util system Api
interfaces. Thus, they need to be moved into frameworks folder.

This change also set the @IgnoreUpTo annotation to S, since
these tests are testing purely platform code on S- devices which
is not really necessary for MTS. Also the tests are still covered
by the unit tests, since they are always verifying HEAD.

Test: TH
Bug: 197717846
Change-Id: I93c19b4860864c724be9f9f889ee2173f4605198
2021-12-09 08:43:16 +00:00
Connor O'Brien
e0a64bb50c Rename libbpf to libbpf_bcc
This is to prevent a name collision with "upstream"
libbpf (external/libbpf) which is built using the same name.

Bug: 203823368
Test: m FrameworksNetTests
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I9a009493fe0482967ab1f92516514715cfd457d6
2021-12-07 23:05:24 +00:00
Paul Hu
f5a8e6aaf0 Merge "Remove NsdSettings from test" am: 5c3c3af9b6 am: b8c0a764bd am: 9c885da24c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1908687

Change-Id: Idd673ff2140a7ee574f408e94bdaf100918b0fb3
2021-12-07 06:37:27 +00:00
Paul Hu
b8c0a764bd Merge "Remove NsdSettings from test" am: 5c3c3af9b6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1908687

Change-Id: Id2ff4ca8c54ea88966d78d4000384ea4aa780ad4
2021-12-07 06:01:16 +00:00
Paul Hu
5c3c3af9b6 Merge "Remove NsdSettings from test" 2021-12-07 05:43:44 +00:00
paulhu
850bd91c3a Remove NsdSettings from test
NsdSettings has been removed from NsdService, so the test needs
to update accordingly.

Bug: 206702844
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I23b6323b2d870746737370b9a3fc90e530e3d2ed
2021-12-03 22:26:39 +08:00
Ken Chen
1c96ed7db0 Merge "[NETD-BPF#4] Move bpf_shared.h from netd to module" am: 3f8d3ff9bf am: 303a4916de am: 686a2635a2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1870274

Change-Id: I85d13f04ecc44767eb917c0d8ae1e85df54e3e7b
2021-12-03 09:50:47 +00:00
Ken Chen
303a4916de Merge "[NETD-BPF#4] Move bpf_shared.h from netd to module" am: 3f8d3ff9bf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1870274

Change-Id: Ic25002c1cb0ad702be4114b91ce5114da716531b
2021-12-03 09:20:00 +00:00
Ken Chen
3f8d3ff9bf Merge "[NETD-BPF#4] Move bpf_shared.h from netd to module" 2021-12-03 08:15:06 +00:00
Paul Hu
0102c0fcfe Merge "Save uid netd network permissions" am: 6fafdc1548 am: b0a10cd127 am: 33c6908ef1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1773890

Change-Id: I5da3391ff6f1f8f51afc09e625c14b5cdd5dd659
2021-11-29 04:26:35 +00:00
Paul Hu
b0a10cd127 Merge "Save uid netd network permissions" am: 6fafdc1548
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1773890

Change-Id: Ibff437f91017017cc6fcc7e456e621e2ad81995a
2021-11-29 03:45:46 +00:00
Aaron Huang
ced49fd763 Change to use Dependencies in IpSecService Tests
The interface IpSecServiceConfiguration is refactored to static
class Dependencies. Refine the tests to use Dependencies.

Bug: 204153604
Test: FrameworksNetTests
Change-Id: Ie2b79b1d948a19f64600ed9ea3b60b192dd92dfd
2021-11-27 00:27:33 +08:00
paulhu
b2d5b054d3 Save uid netd network permissions
PermissionMonitor only saves netd network permissions by appId.
Then apply same permision to uids which are same appId. But
UIDS_ALLOWED_ON_RESTRICTED_NETWORKS can allow single uid has
restricted network permission. Thus, save the netd network
permissions by uid that can apply different permission to each
uid.

Bug: 192431153
Test: atest FrameworksNetTests
Change-Id: I942cbe0fa30758a7497c47a1b684ed70c4e3b09e
2021-11-26 14:47:01 +08:00
Ken Chen
335c0d4249 [NETD-BPF#4] Move bpf_shared.h from netd to module
The header file is referenced by the part going to be mainlined in Netd.
Note that some platform visibility is required with this commit, since
users of bpf_shared.h is currently located in platform. The visibility
can be removed when all users are moved out of platform.

Bug: 202086915
Test: m; flash; boot
Test: cd system/netd && atest
Test: cd packages/modules/Connectivity && atest
Test: atest FrameworksNetTests
Change-Id: I5c16511b6a2d4eb80dfd93157cbc98d5030bd5ac
2021-11-23 11:53:46 +08:00
Remi NGUYEN VAN
33b7412577 Merge "Update NSD tests without AsyncChannel" am: 469d941752 am: b7fd5bd3e1 am: ee2dd397d6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1823893

Change-Id: I054e294cb32c0abf70e3ea419db09a2e492e3bc5
2021-11-22 06:45:59 +00:00
Remi NGUYEN VAN
b7fd5bd3e1 Merge "Update NSD tests without AsyncChannel" am: 469d941752
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1823893

Change-Id: I897bdce6cdaf4ea390d8ce6be03b87bacd6da82e
2021-11-22 06:19:18 +00:00
Aaron Huang
3bde36484b Merge "Use real ProxyTracker in ConnectivityServiceTest" am: c7037475fa am: 4fc403c3b0 am: 1faca14f77
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1885529

Change-Id: I2f4a689aae9dafbad0bb5e3cd74f43a5c72fd898
2021-11-22 06:03:37 +00:00
Remi NGUYEN VAN
469d941752 Merge "Update NSD tests without AsyncChannel" 2021-11-22 05:58:15 +00:00
Aaron Huang
4fc403c3b0 Merge "Use real ProxyTracker in ConnectivityServiceTest" am: c7037475fa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1885529

Change-Id: Id685a51b37d59a822aaa9307f9d4b55053211612
2021-11-22 05:41:34 +00:00
Aaron Huang
c7037475fa Merge "Use real ProxyTracker in ConnectivityServiceTest" 2021-11-22 05:25:28 +00:00
Remi NGUYEN VAN
d1ed21007a Remove unused service and test dependencies am: f96ecf2708 am: e03f77170a am: 7d865f3e10
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1895317

Change-Id: I22260179985637d82e20b346786bed44148e5dc2
2021-11-19 16:27:47 +00:00