Commit Graph

11430 Commits

Author SHA1 Message Date
Serik Beketayev
3aa4d1a686 Merge "[Mainline Migration] Migrate NetworkUtils" am: 3422864269
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1498168

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icc0a49e76f87a741f4410b53e9a40012e37fde36
2020-12-10 00:08:03 +00:00
Serik Beketayev
3422864269 Merge "[Mainline Migration] Migrate NetworkUtils" 2020-12-09 23:47:05 +00:00
Lorenzo Colitti
7503fcaebb Merge "Test for the current behaviour of updating a network's owner UID." am: 9157037502
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512690

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I35a50be2f748177cde9400449386465d77a21556
2020-12-08 09:55:56 +00:00
Lorenzo Colitti
9157037502 Merge "Test for the current behaviour of updating a network's owner UID." 2020-12-08 09:10:08 +00:00
Lorenzo Colitti
07bc0cc9c5 Merge "Add comments to the process*FromAgent methods." am: 522180e236
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519518

Change-Id: Ia90b3ae008561b2ec3723770802815b46937022e
2020-12-07 17:07:08 +00:00
Lorenzo Colitti
522180e236 Merge "Add comments to the process*FromAgent methods." 2020-12-07 16:44:11 +00:00
Lorenzo Colitti
6b44e92fde Test for the current behaviour of updating a network's owner UID.
The current behaviour is at least bizarre and arguably incorrect.
Add a test to document the current behaviour so we can check that
any changes we make to this behaviour are correct.

Test: test-only change
Change-Id: I345bd320eced96316d92e520f576ae06b8020d9f
2020-12-08 01:40:47 +09:00
Lorenzo Colitti
96883c93f3 Add comments to the process*FromAgent methods.
Test: comment-only change
Change-Id: I5ebf6e21d79ed669f85ddf9bf466236d4bd59243
2020-12-08 01:17:17 +09:00
Serik Beketayev
754c5be0f7 [Mainline Migration] Migrate NetworkUtils
Migrating makeStrings(), numericToInetAddress() APIs

Bug: 173089079
Test: atest FrameworksNetTests
Change-Id: Ie914fd41bc3ce16d07f5d2768b89ce805b9245a9
2020-12-06 22:33:04 -08:00
Lorenzo Colitti
963a72a3d4 Merge "Add a test for TcpKeepalivePacketDataParcelable.toString()." am: 68150bcb87
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1502382

Change-Id: Ib92977574ffb28cd2e455328260f215352f24b32
2020-12-07 04:43:19 +00:00
Lorenzo Colitti
68150bcb87 Merge "Add a test for TcpKeepalivePacketDataParcelable.toString()." 2020-12-07 04:38:53 +00:00
Cody Kesting
77f472105e Merge "Allow the System UID to unregister ConnDiags CBs." am: 4068bd9259
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1515688

Change-Id: Ia82d68661c99ed5123f2a0668aec4afd5ea48cf5
2020-12-04 17:47:45 +00:00
Cody Kesting
4068bd9259 Merge "Allow the System UID to unregister ConnDiags CBs." 2020-12-04 17:35:28 +00:00
Remi NGUYEN VAN
223874fbdb Merge "Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn" am: ebe3aee39a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512879

Change-Id: I2458f7ab7ad2d65bf8c697b7a6aa40394cdc0605
2020-12-04 03:50:19 +00:00
Remi NGUYEN VAN
ebe3aee39a Merge "Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn" 2020-12-04 02:05:01 +00:00
Cody Kesting
70fa2b2c27 Allow the System UID to unregister ConnDiags CBs.
This CL updates ConnectivityService to allow the System's UID to
unregister ConnectivityDiagnostics callbacks. Preivously, only the
registrant was allowed to unregister them - this caused problems for
callbacks that were attempted to be unregistered via binderDied() when
the registrant app dies.

Bug: 159912975
Bug: 174713659
Test: manually verified
Change-Id: I20d0cad5f902708d366aa703c2893b0ea3e55052
2020-12-03 17:43:50 -08:00
Patrick Rohr
458c6f80b3 Merge changes from topic "restricted-networking-mode" am: ea5b540316
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1505234

Change-Id: I5e1d114c34e185d0b7f9bc68772431065d852dd0
2020-12-03 11:41:07 +00:00
Patrick Rohr
7987ae713d Clean Up NetworkManagementService Tests am: f8fedc34b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1505233

Change-Id: Ia14b1784f36d54f0ba73d5841afedcf8a55a18f2
2020-12-03 11:36:15 +00:00
Aaron Huang
48fc747357 Merge "Migrate Slog to Log used in connectivity service module" am: cc3487c924
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1483963

Change-Id: Ifc655142710654983dc969398f75fd84a2bc0c6e
2020-12-03 10:58:16 +00:00
Patrick Rohr
ea5b540316 Merge changes from topic "restricted-networking-mode"
* changes:
  Add Restricted Mode Firewall Chain
  Clean Up NetworkManagementService Tests
2020-12-03 10:50:25 +00:00
Aaron Huang
cc3487c924 Merge "Migrate Slog to Log used in connectivity service module" 2020-12-03 10:17:45 +00:00
Xin Li
8afb334ec3 Merge "Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855" into stage-aosp-master 2020-12-03 03:18:49 +00:00
Remi NGUYEN VAN
a879fcbb04 Merge "Do not query CS in NetworkProvider constructor" am: bfc3c02f34
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512873

Change-Id: I227076074a2d58a4b9e5e8aaa972c6338887f568
2020-12-03 02:17:16 +00:00
Remi NGUYEN VAN
bfc3c02f34 Merge "Do not query CS in NetworkProvider constructor" 2020-12-03 01:48:01 +00:00
Remi NGUYEN VAN
14b14d4a50 Merge "Remove CaptivePortal deps on @hide MetricEvents" am: 8a157aaeee
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1513141

Change-Id: I647b1cc3329c527d9afa507864700a521a0908be
2020-12-02 11:53:59 +00:00
Remi NGUYEN VAN
8a157aaeee Merge "Remove CaptivePortal deps on @hide MetricEvents" 2020-12-02 11:12:56 +00:00
Remi NGUYEN VAN
18b4fc1e67 Merge "Add ConnectivityManager.TYPE_PROXY to SystemApi" am: 58606c506b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512885

Change-Id: I0eb069c5ed0daca29f1bc4d3fd62f83879985b1c
2020-12-02 10:05:42 +00:00
Remi NGUYEN VAN
58606c506b Merge "Add ConnectivityManager.TYPE_PROXY to SystemApi" 2020-12-02 09:23:27 +00:00
Xin Li
468855a0b0 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I78222391b83a4add8e964340ec08bb8a1306e1c6
Change-Id: I28bbf40820674675ccf765c912aa8140d3f74ab2
2020-12-02 00:38:58 -08:00
Lorenzo Colitti
4f3407d297 Merge changes Ic5a3e169,I76daa3ab am: c54b7eda99
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512888

Change-Id: Ibc9ad6c89e1214302b92118a01a924fa1481767e
2020-12-02 05:23:05 +00:00
Lorenzo Colitti
c54b7eda99 Merge changes Ic5a3e169,I76daa3ab
* changes:
  Refactor applyUnderlyingCapabilities and its test.
  Move applyUnderlyingCapabilities to ConnectivityService.
2020-12-02 04:55:12 +00:00
Remi NGUYEN VAN
e391512cbb Remove CaptivePortal deps on @hide MetricEvents
The legacy metrics are deprecated, and CaptivePortal is planned to move
to a connectivity-specific jar which cannot reference MetricsEvents.

Bug: 171540887
Test: m
Change-Id: I409375de3844a7fedef707cf9e19a106d82a8e3a
2020-12-02 13:17:09 +09:00
Lucas Lin
9e0129515b Merge "Use public API of NetworkAgent in TestNetworkService" am: 8671a6fe9e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1505291

Change-Id: If37614f211ea2cddb98f06b95b9dfe32e5a98cb5
2020-12-02 03:58:08 +00:00
Lucas Lin
8671a6fe9e Merge "Use public API of NetworkAgent in TestNetworkService" 2020-12-02 03:30:59 +00:00
Treehugger Robot
3da59ba9e3 Merge "Deprecated UserManager.getUsers(excludeDying) / added getAliveUsers()" am: c0b44fca8b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1406256

Change-Id: I6d0d919ddad282d526c2412efdd92e368149ab87
2020-12-01 17:32:56 +00:00
Lorenzo Colitti
d7caf838c0 Refactor applyUnderlyingCapabilities and its test.
This reduces verbose assertions and makes the test more compact.
I'm not sure whether it's actually more valuable, since the
current code, while more verbose, is probably more
straightforward to understand.

Also add a test for passing in a null underlying network (i.e.,
follow default network). This requires a minor refactoring in
ConnectivityService because the applyUnderlyingCapabilities does
not currently treat null specially.

Bug: 173331190
Test: test-only change
Change-Id: Ic5a3e16969ea9e1a529706850f148cb0d5fd8e09
2020-12-02 00:45:57 +09:00
lucaslin
4ead42c078 Use public API of NetworkAgent in TestNetworkService
- Create NetworkAgent by using the public API of NetworkAgent.
- Remove the usage of NetworkInfo.

Bug: 172183305
Test: Build pass.
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk
Test: atest NetworkStackIntegrationTests
Test: atest TetheringIntegrationTests
Change-Id: Icba59295861201c221587caa9df02275c4087fb8
2020-12-01 23:03:02 +08:00
Lorenzo Colitti
cda101be7d Move applyUnderlyingCapabilities to ConnectivityService.
This is essentially a straighforward move of code from Vpn to
ConnectivityService, and from VpnTest to ConnectivityServiceTest.

Bug: 173331190
Test: passes existing tests, moved tests pass
Change-Id: I76daa3abcc777e9c3ba57efb750de0e2e2f3bb74
2020-12-01 23:23:47 +09:00
Felipe Leme
11cf60b2c5 Deprecated UserManager.getUsers(excludeDying) / added getAliveUsers()
The existing method is confusing (the argument used to be called
includeDying) and it puts the burden on the caller (which need to
understand what the parameter means).

Furthermore:

- The majority of calls are for getUsers(excludeDying=true).
- The calls for getUsers(excludeDying=false) are equivalent to
  calls to getUsers()

Test: m
Test: a VpnTest ConnectivityServiceTest PermissionMonitorTest

Bug: 157921703
Change-Id: Ife767a40b7b7790ba28b5377046de822ddbf275c
Merged-In: Ife767a40b7b7790ba28b5377046de822ddbf275c
(cherry picked from commit 6dc6d2b96498bcca132913dbfc6338f8f9f6c697)
2020-12-01 15:25:52 +08:00
Remi NGUYEN VAN
2946cfe8d4 Merge "Run OemNetworkPreferencesTest with DevSdkIgnoreRunner" am: f2d92dc1ee
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512665

Change-Id: I48f1f591f9da798f5c154314c6cf00d504e9f435
2020-12-01 01:57:43 +00:00
Remi NGUYEN VAN
f2d92dc1ee Merge "Run OemNetworkPreferencesTest with DevSdkIgnoreRunner" 2020-12-01 01:33:42 +00:00
Patrick Rohr
660722501f Add Restricted Mode Firewall Chain
Adding new allowlist firewall chain to support restricted networking
mode. See go/restricted-networking-mode.

Bug: b/157505406
Bug: b/170323408
Test: atest NetworkManagementServiceTest
Change-Id: I8e39b3d7b129ad74224d0c1311135b7b48f6514f
2020-11-30 18:36:02 +01:00
Patrick Rohr
f8fedc34b0 Clean Up NetworkManagementService Tests
Cleaning up tests, so I can easily add more for restricted networking
mode.
I merged the NetworkManagementInternalTests with the
NetworkManagementServiceTests.

Test: atest NetworkManagementServiceTest
Change-Id: If8c3cc1883cfb2524eeb78e23165fc868130f0e7
2020-11-30 18:35:44 +01:00
Lorenzo Colitti
f044795629 Merge changes If2201f39,Ia1c366c5 am: 5dab5fb9c4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1509889

Change-Id: I6ad54ba833d242ed790123c381a308ef678e4d4d
2020-11-30 15:01:45 +00:00
Lorenzo Colitti
5dab5fb9c4 Merge changes If2201f39,Ia1c366c5
* changes:
  Stop calling Vpn#updateCapabilities in CS.
  Stop accessing VPNs in checkConnectivityDiagnosticsPermissions.
2020-11-30 14:14:38 +00:00
Lorenzo Colitti
a2f800ca78 Merge changes I982543cd,I41c3bf6c,Id3e5f6e1 am: 4f42110c4f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1511316

Change-Id: Iac22dfcf6550233df7dc7c33689cb797503e24f9
2020-11-30 13:54:52 +00:00
Lorenzo Colitti
4f42110c4f Merge changes I982543cd,I41c3bf6c,Id3e5f6e1
* changes:
  Add a provider to VPN
  Small VPN cleanup
  Migrate VPN to the public NetworkAgent API.
2020-11-30 13:48:26 +00:00
Remi NGUYEN VAN
ee660cfd90 Add ConnectivityManager.TYPE_PROXY to SystemApi
This follows other TYPE_* constants like TYPE_WIFI_P2P that are
@SystemApi or public.
TYPE_PROXY has a use-case for the system to set network policies based
on proxy network templates. Although network types are deprecated, that
use-case needs to be supported and significant amounts of network
management would need to be rewritten to stop using network types.

The constant needs to be API as ConnectivityManager is planned to move
out of framework.jar, so only its formal API will be available to the
system server.

Bug: 174436414
Test: m
Change-Id: I266ed6bc59f5eb72302afe14472c93933733c8f8
2020-11-30 19:23:45 +09:00
Remi NGUYEN VAN
00c5e70471 Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn
Instead of sharing the constant from LinkProperties, use the already
defined constant in the NetworkConstants class.

This allows Ikev2VpnProfile to allow depending on non-public
LinkProperties APIs, as LinkProperties is planned to move to
framework-connectivity.

Bug: 174436414
Test: m
Change-Id: I594bb7e81bc7681799c16eff621a5ffd1b29624c
2020-11-30 17:18:51 +09:00
Chalard Jean
c99d746c06 Add a provider to VPN
Test: FrameworksNetTests NetworkStackTests
Change-Id: I982543cdee358bb62d3b56a7fd9d71dc18908b65
2020-11-30 16:15:19 +09:00