Commit Graph

11699 Commits

Author SHA1 Message Date
Chalard Jean
b97f23ae96 Merge "Add Qos Callback support" am: 29f0f6d47f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1386623

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I73984d62a914a4d96ed116c3c25ebdce7e6426ea
2021-01-22 13:41:39 +00:00
Chalard Jean
f884ddbf97 Merge "Add Qos Callback files" am: a96f7a4d89
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1557008

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I63e1639172bde1ffd498605b9d1a43633cc8a623
2021-01-22 13:31:16 +00:00
Chalard Jean
29f0f6d47f Merge "Add Qos Callback support" 2021-01-22 13:09:24 +00:00
Chalard Jean
a96f7a4d89 Merge "Add Qos Callback files" 2021-01-22 13:06:43 +00:00
Remi NGUYEN VAN
a9630d29d0 Merge "Mark connectivity test utilities as module API" am: 5ef8031d57
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547643

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5973e19d7b7a103235121f5efc1951985e3a4c41
2021-01-22 10:34:16 +00:00
Remi NGUYEN VAN
5ef8031d57 Merge "Mark connectivity test utilities as module API" 2021-01-22 10:11:39 +00:00
Remi NGUYEN VAN
7d4530b98d Mark connectivity test utilities as module API
The API surface is planned to move to the Connectivity module, meaning
that it will be maintained across multiple Android releases.
This is incompatible with TestApi semantics, which are designed to be
removable across releases. Effectively the APIs become SystemApi, so
mark them as such considering that TestApi is not supported by modules.

Remove the NetworkCapabilities.getCapabilities test API that is not
essential for tests, and mark other APIs as module API.

Test: m
Bug: 174436414
Change-Id: Ic04551a9874b3d756cf5e6c77ceabfc7c85d52a6
2021-01-22 16:16:57 +09:00
Daniel Bright
60f02ed76b Add Qos Callback support
* Provide App Developers Qos related info associated to
  a bound socket through ConnectivityManager
* Qos sessions are generated and filtered by Network Agents
  and sent back through the Connectivity Service to the
  API consumer.
* The structure of the code within com.android.server
  is designed to support different types of filters in the
  the future.
* The first type of Qos Attributes are related to EPS
  Bearers in order support RCS.

Bug: 155176305
Test: Added to cts/NetworkAgentTest
Test: Added to ConnectivityServiceTest
Change-Id: I145dd065d9deeee449eb9695ab3f6c8556ee7c09
2021-01-21 20:14:52 -08:00
Daniel Bright
53f0e44449 Add Qos Callback files
* Add QosCallback stub files

Bug: 155176305
Test: N/A
Change-Id: I7c231d60880c37ae1ce49fa8a621badf386ab8a7
2021-01-21 19:50:24 -08:00
Remi NGUYEN VAN
ef75b38a4d Merge "Use network list in UNDERLYING_NETWORKS_CHANGED" am: a6f4de3432
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536308

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I58184fe4f731319b7bf4c8cf24c0a6571e4a1d8b
2021-01-22 01:22:25 +00:00
Remi NGUYEN VAN
d793eb34ca Use network list in UNDERLYING_NETWORKS_CHANGED
The bundle is no longer necessary, as this message is not sent across
processes: the network list can be sent directly in the message obj
pair.

Bug: 173574274
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: Iae049a24212ff9df19b29aead20bf4a594f05f99
2021-01-21 22:36:54 +09:00
Chiachang Wang
d2258450d1 Merge "[IT4.4] Host network activity related logic into a new class" am: 18e77a4752
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1534899

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6158f29302241703367b5392d2f0adcf6f6ccf57
2021-01-21 09:21:33 +00:00
Chiachang Wang
8178ec8ea2 Merge "Use ParcelFileDescriptor instead of FileDescriptor in the aidl" am: 0ad97bf744
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9b7818c5fc851a5b2a1406caec0db3dac3ff55c7
2021-01-21 08:55:33 +00:00
Chiachang Wang
18e77a4752 Merge "[IT4.4] Host network activity related logic into a new class" 2021-01-21 08:41:15 +00:00
Chiachang Wang
0ad97bf744 Merge "Use ParcelFileDescriptor instead of FileDescriptor in the aidl" 2021-01-21 08:40:53 +00:00
Chiachang Wang
979f46a693 Use ParcelFileDescriptor instead of FileDescriptor in the aidl
Using FileDescriptor in the aidl will refer to
Parcel.readRawFileDescriptor() and Parcel.writeRawFileDescriptor()
whilie trying to do parcel operations. Those two APIs are hidden
and not accessible for the incoming ConnectivityService mainline
module. For such use cases in a module, it should be replaced by
using ParcelFileDescriptor that is designed for such usages.

Bug: 170598012
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: Ia7e3a71ccb4b136cc55c9e90a384870c32cfd37b
2021-01-21 08:40:12 +00:00
Paul Hu
0b1c92d785 Merge "Replace Context @hide API in MultinetworkPolicyTracker" am: 161e0b9b78
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1554096

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I33f441fba920d6228be47b2025fcf7303e496da8
2021-01-21 08:07:51 +00:00
Paul Hu
161e0b9b78 Merge "Replace Context @hide API in MultinetworkPolicyTracker" 2021-01-21 07:53:19 +00:00
lucaslin
6d502ed79d [IT4.4] Host network activity related logic into a new class
Create an inner class to handle the network activity related
logic to isolate the code for code cleanliness. It's helpful for
the follow-up modifications to move network activity logic from
NMS to CS to support Connectivityservice mainline.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I33b3b11f2700cb10eb6e3b58b6dfa52251bece80
2021-01-21 06:27:23 +00:00
Remi NGUYEN VAN
4bfba0d2e1 Merge "Mark TestNetworkManager as module API" am: cc041a72e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547638

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic1677f8f4fa436450ebc4d83cc10ff8503f2f9f2
2021-01-21 06:22:58 +00:00
Remi NGUYEN VAN
cc041a72e7 Merge "Mark TestNetworkManager as module API" 2021-01-21 06:02:25 +00:00
Remi NGUYEN VAN
5eee3ec919 Mark TestNetworkManager as module API
The API surface is planned to move to the Connectivity module, meaning
that it will be maintained across multiple Android releases.
This is incompatible with TestApi semantics, which are designed to be
removable across releases. Effectively the APIs become System/module
API, so mark them as such considering that TestApi is not supported by
modules.

Test: m
Bug: 174436414
Change-Id: Icd32fcbb65e9a4bb2b67cb9da7c971281be0781a
2021-01-21 10:45:04 +09:00
paulhu
fd8dac4fe5 Replace Context @hide API in MultinetworkPolicyTracker
MultinetworkPolicyTracker is part of Connectivity mainline module
which cannot call @hide API Context#registerReceiverAsUser. Thus,
replace it to Context#registerReceiverForAllUsers.

Bug: 170634463
Test: atest FrameworksNetTests
Test: Manully check that receiving intent and unregistering
      receiver can work normally.
Change-Id: Ie22a3aa40bc9243082672a64dba7c7940f9ff21a
2021-01-21 01:19:09 +08:00
Junyu Lai
b7b3064394 Merge "Revert "[VCN06] Support request background network"" am: 2fa034c812
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553864

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic8f292997e582da1eeeb469c91a52225ba4a2217
2021-01-19 11:34:18 +00:00
Junyu Lai
2fa034c812 Merge "Revert "[VCN06] Support request background network"" 2021-01-19 10:24:47 +00:00
Junyu Lai
34263da2c9 Revert "[VCN06] Support request background network"
Revert submission 1545847-vcn06

Reason for revert: b/177876289 presubmit failure
Reverted Changes:
I8042ce197:[VCN06.1] Add CTS for request background network
If9aaa87b7:[VCN06] Support request background network

Change-Id: I9270b02a2d6d1ffcdd83b4f41becaf09a2b91e0a
2021-01-19 09:06:00 +00:00
Treehugger Robot
92884ae4ce Merge "Fix CaptivePortalDataTest#testParcelUnparcel on R" am: d806079674
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553816

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I74a6492618ca1e21e35474c012dee9886239e75a
2021-01-19 04:49:10 +00:00
Treehugger Robot
d806079674 Merge "Fix CaptivePortalDataTest#testParcelUnparcel on R" 2021-01-19 04:45:08 +00:00
Treehugger Robot
ed9f5d54a5 Merge changes I475502fd,Ibf376a6f,Ia52f9caf am: 4fcb0e54a1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553958

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1cf8401a1cf16b8bbd3d46a65c40c642324c00e8
2021-01-19 04:45:06 +00:00
Treehugger Robot
4fcb0e54a1 Merge changes I475502fd,Ibf376a6f,Ia52f9caf
* changes:
  Address comments on aosp/1539753, aosp/1542487 and aosp/1547496.
  Fix propagating underlying caps when a network disconnects.
  Test for bugs with suspended VPN underlying networks.
2021-01-19 04:19:56 +00:00
Remi NGUYEN VAN
da94136cc7 Fix CaptivePortalDataTest#testParcelUnparcel on R
CaptivePortalData only has 7 fields on R, not 8.

Bug: 177290955
Change-Id: I156738d07821fee43420d8af14c4bce36dd0e4a4
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalDataTest on R
2021-01-19 02:33:09 +00:00
Lorenzo Colitti
34007bd8de Address comments on aosp/1539753, aosp/1542487 and aosp/1547496.
Bug: 173331190
Test: test-only change
Change-Id: I475502fde55d24e7ae3f7fe9f43c54740c57a9cf
2021-01-19 10:35:43 +09:00
Junyu Lai
bf098917d8 Merge "[VCN06] Support request background network" am: 95f0791724
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1545847

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5a090a26f0f14317622de9f1971701855723fb56
2021-01-19 01:12:58 +00:00
Junyu Lai
95f0791724 Merge "[VCN06] Support request background network" 2021-01-19 01:04:20 +00:00
Lorenzo Colitti
c284b4b8dd Fix propagating underlying caps when a network disconnects.
aosp/1513052, which generalized support for underlying networks,
broke default network switching when the network underlying a VPN
disconnects.

This is because it calls propagateUnderlyingNetworkCapabilities
in the middle of the bookkeeping operations needed when a
network is disconnected (specifically, after all satisified
requests are removed from the disconnecting network, but before
mDefaultNetworkNai is updated). This is completely incorrect
because propagateUnderlyingNetworkCapabilities can trigger a
network rematch, and running a rematch when the request data
structures are inconsistent is obviously wrong. See the test
changes in this CL for an example of the damage.

Fix this by moving propagateUnderlyingNetworkCapabilities to
before the bookeeping operations begin. It must be before
mDefaultNetworkNai is updated, because otherwise it will not know
that the default network is disconnecting, and it will not be
able to propagate capabilities to VPNs that set underlying
networks to null (i.e., to the default network). It must be
after the nai is removed from mNetworkForNetId because
otherwise it will think that the underlying network is still
connected.

Bug: 173331190
Test: accompanying unit test shows lots of bugs removed
Change-Id: Ibf376a6fa4b34d1c96f8506fa8abbb7595a8c272
2021-01-19 09:40:53 +09:00
Lorenzo Colitti
dbf549c1c7 Test for bugs with suspended VPN underlying networks.
Test: atest --rerun-until-failure 100 ConnectivityServiceTest#testVpnSwitchFromSuspendedToNonSuspended
Change-Id: Ia52f9cafef3f49ae70ad135d017e207eb57fddfe
2021-01-19 00:42:46 +09:00
Lorenzo Colitti
5a27eb5043 Merge changes Ic5750d4f,I9fa888c9,I4211475f am: c127a58770
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547495

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7e727e9e9377690a6badf1a56176138654459493
2021-01-18 14:25:48 +00:00
Lorenzo Colitti
c127a58770 Merge changes Ic5750d4f,I9fa888c9,I4211475f
* changes:
  Deflake testNetworkBlockedStatusAlwaysOnVpn
  Simplify testVpnRestrictedUsers.
  Add test coverage for LockdownVpnTracker.
2021-01-18 14:03:54 +00:00
Treehugger Robot
c000462ea0 Merge "Enforce that NetworkAgentInfo fields are never null." am: 3a6e50bdb9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553734

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I12eba91f29b55b7162889e1d44de15580f839195
2021-01-18 10:24:27 +00:00
Treehugger Robot
3a6e50bdb9 Merge "Enforce that NetworkAgentInfo fields are never null." 2021-01-18 09:32:39 +00:00
junyulai
6ecf04d6f7 [VCN06] Support request background network
This will be mainly used by VCN management service which will
need to hold the networks but preserve the backgrounded-ness
of the networks.

Test: android.net.ConnectivityManagerTest#testRequestType
Test: android.net.cts.ConnectivityManagerTest#testRequestBackgroundNetwork /
      --rerun-until-failure 100
Test: ConnectivityServiceTest#testBackgroundNetworks
Test: m -j doc-comment-check-docs
Bug: 175662146
Change-Id: If9aaa87b7e71c2b695ac7b08858850e975b28bb6
2021-01-18 16:32:08 +08:00
Lorenzo Colitti
5c27674ad1 Deflake testNetworkBlockedStatusAlwaysOnVpn
This test flakes about 1% of the time on my device. This is due
to the test calling expectNetworkRejectNonSecureVpn() before the
handler thread has processed the call to setAlwaysOnVpnPackage.

Fix this by waiting for callbacks where it is possible to do so,
and by calling waitForIdle where it is not.

Test: test-only change
Change-Id: Ic5750d4fdf9e7e3654a2b6ade74da6bc5de18fb6
2021-01-18 17:28:52 +09:00
Lorenzo Colitti
79ff36588d Simplify testVpnRestrictedUsers.
Code review comments have suggested that this test is too long
and difficult to understand. Split it into two tests and put some
of the common setup into setup methods and statics.

Bug: 173331190
Test: test-only change
Change-Id: I9fa888c940d7048f1ba6836a5706fbdb84b5f5c9
2021-01-18 17:28:52 +09:00
Lorenzo Colitti
756a7345e8 Add test coverage for LockdownVpnTracker.
Also add a comment to an existing test.

Bug: 173331190
Test: test-only change
Change-Id: I4211475f053f0cdf2b804132c52ce5205a772193
2021-01-18 17:28:50 +09:00
Lorenzo Colitti
83d065696f Enforce that NetworkAgentInfo fields are never null.
These fields have been recently audited, confirmed never to be
null, and annotated @NonNull. Ensure that they can never become
null by throwing exceptions in the codepaths that set them.
Also remove some null checks.

Test: atest FrameworksNetTests
Change-Id: I6ce5bb4d69a990f1c857c599b7e50e372352eb87
2021-01-18 07:49:26 +00:00
Lorenzo Colitti
d9df019897 Merge "Mark several NetworkAgentInfo members @NonNull and address TODO." am: f49e1b0c6c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552502

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I904873d1998948ef58e6179a78c5d87834fa7c86
2021-01-18 06:33:36 +00:00
Lorenzo Colitti
f49e1b0c6c Merge "Mark several NetworkAgentInfo members @NonNull and address TODO." 2021-01-18 05:51:38 +00:00
Paul Hu
22a26d0918 Merge "Remove unused IpConnectivityMetrics in CS" am: 671085fbde
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552660

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If123fae795475433f61f9264f0a2e3b51676056c
2021-01-18 05:45:22 +00:00
Paul Hu
671085fbde Merge "Remove unused IpConnectivityMetrics in CS" 2021-01-18 05:26:35 +00:00
paulhu
a1b4fbe5a0 Remove unused IpConnectivityMetrics in CS
ConnectivityService doesn't call any IpConnectivityMetrics
methods, so remove all usages from CS.

Bug: 177656797
Test: atest FrameworksNetTests
Test: atest FrameworksNetIntegrationTests
Change-Id: I2fb3b6b08cd8013eb8f75882f77ca699a2df927e
2021-01-18 04:03:32 +00:00