Commit Graph

12330 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
cb61701582 Move QoS API classes to Connectivity
The classes were added in S and are used to back ConnectivityManager
APIs. Add them to the connectivity boundary as they belong together with
ConnectivityManager.

Bug: 181512874
Test: m
Change-Id: I03b5978949b200a72813d1ebc4812d851fe3df37
2021-03-01 18:09:30 +09:00
Remi NGUYEN VAN
fc6869064c Move SocketUtils out of the connectivity module
SocketUtils contains system APIs for modules to interact for sockets,
wrapping internal APIs. It should be part of the platform to keep access
to the internal APIs.

This involves splitting NetworkUtils.protectVpn to NetworkUtilsInternal,
since SocketUtils and VpnService are the only users of that method.

The @UnsupportedAppUsage NetworkUtils.protectVpn has low usage
count, and is already available through VpnService.protect.

Bug: 181512874
Test: boots, VPN working
Change-Id: I7028d334975f7536c06afac7a22200c33db707ac
2021-03-01 16:50:08 +09:00
Remi NGUYEN VAN
e593f0a85a Merge "Split out the connectivity API surface" am: d799e71134
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552658

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6e51465cfeab43ff5f154771e2e22a7cd981d066
2021-03-01 02:10:04 +00:00
Remi NGUYEN VAN
d799e71134 Merge "Split out the connectivity API surface" 2021-03-01 01:07:19 +00:00
Junyu Lai
d70fb68230 Merge "[FUI08] Create NeworkStateSnapshot" am: f641e8c44c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536328

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If6f0e981228ef886496f55626b499f9c487af320
2021-02-26 11:30:53 +00:00
Junyu Lai
f641e8c44c Merge "[FUI08] Create NeworkStateSnapshot" 2021-02-26 10:53:36 +00:00
Remi NGUYEN VAN
be1791058f Split out the connectivity API surface
Split out connectivity APIs to connectivity module directories. This
prepares future move of the connectivity code into a mainline module,
but still keeps it implemented by framework-minus-apex for now: the API
stubs are moved to framework-connectivity.stubs, but the implementation
on device remains in the same place.

This allows moving the connectivity code in/out of APEX with minimal
changes.

BYPASS_INCLUSIVE_LANGUAGE_REASON=Moving files, can't modify released API

Bug: 171540887
Test: device boots, connectivity working

Merged-In: I21c42f032efa6c10e36c749df3183ce9679303a7
(cherry-pick from internal branch with API files conflicts)

Change-Id: I21c42f032efa6c10e36c749df3183ce9679303a7
2021-02-26 19:23:25 +09:00
Aaron Huang
b1bf756c8c Use the net-utils-device-common version of HexDump
KeepaliveTracker is included in ConnectivityService mainline
module and it will not be able to access internal util class
com.android.internal.util.HexDump. Use the HexDump defined in
net-utils-device-common to remove dependency on internal util
class.

Bug: 177046265
Test: FrameworksNetTests
Change-Id: I1f5a6a749106b98e2baf22d6a290dcf8b51a6c36
2021-02-26 07:10:19 +00:00
junyulai
74dcf1a32d [FUI08] Create NeworkStateSnapshot
Since NetworkState has UnsupportedAppUsage APIs that cannot
be changed, create another class for follow-up patches
to expose as system API.

Test: NetworkStateSnapshotTest
Bug: 174123988
Change-Id: I54ef872847f34166aa34a79f6178c90ac12b6c72
2021-02-26 11:57:06 +08:00
Junyu Lai
31893354d1 Merge "Fix copyright license of VpnTransportInfo" am: ff35256ebd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607313

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifed529b4a91bb3c52acb3d1ce708a5999a2bb595
2021-02-26 03:56:16 +00:00
Junyu Lai
ff35256ebd Merge "Fix copyright license of VpnTransportInfo" 2021-02-26 03:38:59 +00:00
Remi NGUYEN VAN
28a0d9f352 Merge "Fix CaptivePortalDataTest on R" am: af593a6514
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1605013

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifbfed272ece8e1f4c437281fc6ca46de793520fe
2021-02-26 03:25:46 +00:00
Remi NGUYEN VAN
5cb7ff8c8e Merge "Add public alternative for protectFromVpn" am: cc595f8d17
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1605094

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I759af534bdf50f647351056275857c056998bf14
2021-02-26 03:22:03 +00:00
Remi NGUYEN VAN
af593a6514 Merge "Fix CaptivePortalDataTest on R" 2021-02-26 01:51:14 +00:00
Remi NGUYEN VAN
cc595f8d17 Merge "Add public alternative for protectFromVpn" 2021-02-26 01:50:32 +00:00
Chris Weir
1636f85cab Merge "Update tests for PANS network usage metrics" am: 2a6448ce32
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1578824

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8ac8031b7e405226a1b055be3c80eb902d48338b
2021-02-25 21:52:40 +00:00
Chris Weir
2a6448ce32 Merge "Update tests for PANS network usage metrics" 2021-02-25 21:37:42 +00:00
Yan Yan
6ca69e5f31 Support new IpSecAlgorithm AUTH_AES_CMAC
Bug: 161716062
Test: IpSecAlgorithmTest, verified with CTS
Change-Id: Ideaf4225bd851fad8c8072505c6ad99d85ba616e
2021-02-25 10:35:10 -08:00
Paul Hu
48912f723c Merge "Use alternative PhoneStateListener formal API" am: 5f72702134
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554994

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I221f70b66e229c7209111227c40a0f4c0e616d85
2021-02-25 13:04:23 +00:00
Paul Hu
5f72702134 Merge "Use alternative PhoneStateListener formal API" 2021-02-25 12:14:53 +00:00
Junyu Lai
418c1867c8 Merge "[VCN07] Bypass VCN for non-internet app accessible cellular services" am: c8c6433b56
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1597954

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ied1e0628645c1320cf306fe508820cb80d03373a
2021-02-25 11:03:33 +00:00
lucaslin
aad3854ad9 Add test for getStartUser(), getEndUser() and createForUser()
- Follow-up commit will modify getStartUser() and getEndUser(),
to make sure the result is consistent, add test before changing
getStartUser() and getEndUser().
- Add a test for createForUser() to ensure the last uid of
the previous user is smaller than the first uid of the next user.
- Move this test file to tests/net/common, so that it can be run
in CTS.

Bug: 170598012
Test: atest FrameworksNetTests:UidRangeTest
      CtsNetTestCasesLatestSdk:UidRangeTest
      Also run above tests on Q and R devices.
Change-Id: I8b146aa14b50911e50a39f266e8d8dc17df853b2
2021-02-25 18:32:40 +08:00
Junyu Lai
c8c6433b56 Merge "[VCN07] Bypass VCN for non-internet app accessible cellular services" 2021-02-25 10:16:03 +00:00
Lucas Lin
2ca3dd7fca Merge "Replace BaseNetworkObserver with BaseNetdUnsolicitedEventListener" am: 19d20f7339
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547454

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Idd7f8fe597639f334e5d99c23ab570a751f8d9d6
2021-02-25 07:44:24 +00:00
lucaslin
87b58aaf97 Fix comments left on aosp/1547454 and aosp/1556106
Bug: 174837473
Test: atest FrameworksNetTests
Change-Id: I35ed84fcc53725fe29896ec37b77ef4fb4778fde
2021-02-25 15:10:29 +08:00
lucaslin
23efc5812a Remove INetworkManagementService from ConnectivityService
Remove INetworkManagementService from ConnectivityService and
related files.

Bug: 174837473
Test: atest FrameworksNetTests FrameworksNetIntegrationTests
Change-Id: Ie6cfd77bbd64a8fd7539b0ea7fd15bf970e40c3d
2021-02-25 15:08:28 +08:00
lucaslin
d5c2d07dab Remove unused INetworkManagementService
Bug: 174837473
Test: atest FrameworksNetTests
Change-Id: I4e4f929f518ae07bf5b4bd1e16d2a85f62ab9d9c
2021-02-25 15:08:18 +08:00
lucaslin
37a16d9574 Remove BaseNetworkObserver from Nat464Xlat
Let ConnectivityService talk to Nat464Xlat through NetworkAgnetInfo
directly:
- Nat464Xlat will be created once there is a new network bringing up,
but Netd doesn't expose the method for unregistering unsolicited event.
- ConnectivityService has already registered netd unsolicited event
listener, so Nat464Xlat doesn't need to register unsolicited event
listenser by itself, it can get the unsolicited event from
ConnectivityService directly.

Bug: 174837473
Test: atest FrameworksNetTests
Change-Id: I751526e8ffa7d25591696ecd8d93b1585c4c20c7
2021-02-25 15:08:05 +08:00
Lucas Lin
19d20f7339 Merge "Replace BaseNetworkObserver with BaseNetdUnsolicitedEventListener" 2021-02-25 06:45:15 +00:00
junyulai
c8d3b9308f Fix copyright license of VpnTransportInfo
Test: TH
Bug: None
Change-Id: Id1fe2c62a0fd60b9833d8b00d2fa2ddc2f031004
2021-02-25 10:31:56 +08:00
James Mattis
ad271a02cf Adding additional docs for OemNetworkPreferences
Bug: 181036259
Test: make and device boot
Change-Id: I60375dc97f6ed1d2959aa920d3099c1841866e1b
2021-02-24 11:34:52 -08:00
James Mattis
96d6a16995 Merge "Unit test automation for Multi-Default Tracking" am: 8b3ccda6bb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1579207

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I610c8356f00cbd983bcb155139db06d2e16d0748
2021-02-24 15:57:46 +00:00
Chris Weir
13c3b49fe9 Update tests for PANS network usage metrics
Update existing tests to use new NetworkTemplate/NetworkIdentity
constructors, and add additional tests for new PANS metrics features.

Bug: 175793874
Bug: 174485293
Test: Run the tests in this CL with atest

Change-Id: I6f50993397d886a266874da0047c02022a69f62e
2021-02-23 22:16:19 -08:00
Remi NGUYEN VAN
da62581840 Add public alternative for protectFromVpn
The method is called directly by VpnService#protect.

Bug: 171540887
Test: m
Change-Id: I7cbb1ef1301dcf8d27b2cc39c0431a0156fe3442
2021-02-24 14:49:35 +09:00
James Mattis
ec1fb89d18 Unit test automation for Multi-Default Tracking
Unit test automation validating how multiple default networks are
tracked within ConnectivityService when set by network preferences
used with setOemNetworkPreference() API functionality.

Bug: 178632672
Bug: 172347841
Bug: 170068946
Test: atest FrameworksNetTests
Change-Id: Iae1935944214efaa8a21636c55e6d8be816275f7
2021-02-23 19:03:34 -08:00
Remi NGUYEN VAN
7ad622c832 Fix CaptivePortalDataTest on R
The test can only use setUserPortalUrl(Uri, int) and
setVenueInfoUrl(Uri, int) on S+.

Bug: 180870236
Change-Id: I1cfa765ad12a228e09eb146d1e6e5ba2e3aa3979
Test: atest FrameworksNetTestCases
2021-02-24 02:08:42 +00:00
Chiachang Wang
dc6c4ea570 Merge "Remove UidRange.createForUser() with userId integers" am: 88163e28a0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1596511

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I736f502788487fd8c0d3f6037866c17945831d62
2021-02-24 00:46:03 +00:00
Paul Hu
7d6897ecfa Merge "Use PermissionUtils" am: 8734459730
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1559098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I81a3b8d23d1d708675206b36367326c44113c46d
2021-02-24 00:29:54 +00:00
Chiachang Wang
e888d27537 Merge "Move shared methods to net shared lib" am: abe07f8916
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1571901

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3baac3770814ea1aba213e54430c44308b0c07bc
2021-02-24 00:16:42 +00:00
Treehugger Robot
9f306d5ec2 Merge "Clean up T&C implementation" am: 7a9f087992
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1583505

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I28c5722b7d9e4089be8f42149c3a0407ea3500a7
2021-02-23 23:49:21 +00:00
Lucas Lin
f0d30464b8 Merge changes I852e3a53,I86755647,I0ed8b0c6 am: 9b56fad5b9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553736

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0428b441b34d48157a28dfc0463976be135146f4
2021-02-23 22:27:15 +00:00
Treehugger Robot
31e31d2265 Merge "Revert "Revert "Delete VPN methods in ConnectivityManager.""" am: e2a5851dd8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1597635

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie9256f3912623619be712b82810f4086c6773bba
2021-02-23 22:24:15 +00:00
Paul Hu
c99a9d8ec0 Merge "Stop using SysetmConfig#getSystemPermissions on PermissionMonitor" am: 6b5305b3b2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1545848

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia4697e282fbc46044d1a1f477568ef9ccb02d221
2021-02-23 22:15:51 +00:00
Paul Hu
3e36d1a041 Merge "Remove ArrayUtils usage in connectivity classes" am: 661aa358b6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1513051

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2c7b2314ea6d6a8b234836ab4d47319daf8cd642
2021-02-23 22:11:19 +00:00
paulhu
a6ee212462 Implement Settings#checkAndNoteChangeNetworkStateOperation on CS
Connectivity is becoming a mainline module in S and
ConnectivityManager#enforceChangePermission is using
Settings#checkAndNoteChangeNetworkStateOperation for performing a
strict and comprehensive check of whether a calling package is
allowed to change the state of network. However, Mainline modules
are not allowed to use non-formal APIs, fortunately CS is the
only caller of this ConnectivityManager#enforceChangePermission.
Thus, implement the Settings API on ConnectivityService and remove
the ConnectivityManager#enforceChangePermission and
Settings#checkAndNoteChangeNetworkStateOperation.

Bug: 178565313
Test: atest FrameworksNetTests
Change-Id: I6f03398c1735b89470ad5bdbe3a036929daeb53c
Merged-In: I6f03398c1735b89470ad5bdbe3a036929daeb53c
2021-02-23 08:35:38 +00:00
Chiachang Wang
88163e28a0 Merge "Remove UidRange.createForUser() with userId integers" 2021-02-23 07:17:07 +00:00
Paul Hu
8734459730 Merge "Use PermissionUtils" 2021-02-23 01:48:58 +00:00
Chiachang Wang
abe07f8916 Merge "Move shared methods to net shared lib" 2021-02-23 00:58:59 +00:00
Treehugger Robot
7a9f087992 Merge "Clean up T&C implementation" 2021-02-22 19:58:43 +00:00
lucaslin
66f44213bc Replace BaseNetworkObserver with BaseNetdUnsolicitedEventListener
ConnectivityService will be a part of mainline module, to prevent
using @hide API of NetworkManagementService in TestNetworkService,
use function inside NetdUtils instead.

Bug: 170598012
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: Id615f7b900d26d0f5887adcd8221dc8bef239923
2021-02-23 01:12:55 +08:00