Commit graph

11,637 commits

Message SHA1
Merge "[FUI03] No-op refactoring of VpnInfo"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-01-27 11:47:34 +00:00
c1140f2a33
Merge "Move connectivity-sources to frameworks/base"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-01-27 07:15:05 +00:00
82a30b6bbe
[FUI03] No-op refactoring of VpnInfo
As a preparation of exposing system API. This patch does some
harmless refactoring, which includes:
  1. Move VpnInfo to android.net
  2. Add nullability annotations
  3. Make members final

Bug: 174123988
Test: TH
Change-Id: I1530bb45d0e84c28c6deac33596bc686058afc0d

junyulai   commited 2021-01-27 15:03:06 +08:00
bd7f3cd75b
Merge changes Ic67cff95,Id7a6175c,I3d6896f5,Iaff727e7
* changes:
  Updates to handler logic for multilayer requests
  Update to sendAllRequestsToProvider for Multilayer
  Multilayer request updates to request callbacks
  Multilayer support when NAI requests are updated

James Mattis   authored and   Gerrit Code Review   commited 2021-01-27 04:50:43 +00:00
4c69988898
Updates to handler logic for multilayer requests
Updates to ConnectivityService network request handler's logic to support
(or disallow support of) multilayer network requests.

Bug: 175239920
Bug: 171991028
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: Ic67cff950d72745d6508a0a037bd33f932d5132c

James Mattis   commited 2021-01-26 18:44:45 -08:00
08131f3446
Update to sendAllRequestsToProvider for Multilayer
Updates to ConnectivityService.sendAllRequestsToProvider to support
Multilayer requests.

Bug: 175051182
Bug: 171991028
Test: atest FrameworksNetTests
atest FrameworksNetIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: Id7a6175cee28d2de1f6194cd0fc8c739d667427d

James Mattis   commited 2021-01-26 18:44:32 -08:00
7b26bba8de
Merge "Update jni to get int descriptor in native layer"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-01-27 02:44:29 +00:00
332aae3a6e
Update jni to get int descriptor in native layer
ConnectivityService is going to become a mainline module which
can not access the hidden APIs. The int descriptor of a
FileDescriptor is hidden for internal use only. The Network and
NetworkUtls will be parts of CS module. The corresponding usage
should be removed. There is no way in a module to access the
descriptor, so update the jni to set a FileDescriptor to native
to get the int descriptor inside the platform.

Also, update the other references in android_net_NetUtils for
getting fd to use the NDK functions in the libnativehelper.

Bug: 170598012
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Test: manually connect to a VPN
Change-Id: I2143c079feac53917a6e7bf7422f3180f51437fb

Chiachang Wang   commited 2021-01-27 02:44:14 +00:00
30199ca9f8
Merge "Fix FrameworksNetIntegrationTests failure"
Paul Hu   authored and   Gerrit Code Review   commited 2021-01-27 00:04:09 +00:00
4071a8ccb1
Merge "Revert^2 "Replace Context#sendStickyBroadcastAsUser()""
Paul Hu   authored and   Gerrit Code Review   commited 2021-01-27 00:04:09 +00:00
d07d47e255
Multilayer request updates to request callbacks
Updated to ConnectivityService to support multilayer requests when
sending request level callbacks.

Bug: 174797702
Bug: 171991028
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: I3d6896f5705509bcfff5544d2eb13c31feaf1937

James Mattis   commited 2021-01-26 12:33:43 -08:00
757e0e8b3e
Multilayer support when NAI requests are updated
Updates to ConnectivityService to support multilayer requests in any
flows which a NetworkAgentInfo has a NetworkRequest added/removed. This
would include both 'listen' and 'request' types of NetworkRequest
objects.

Bug: 174271773
Bug: 171991028
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: Iaff727e792828684e6ad4d07d0081e27992031be

James Mattis   commited 2021-01-26 12:33:37 -08:00
622428ceea
Merge changes I713bc2ec,Ib9ab07c9
* changes:
  [FUI05] Remove wimax data usage unit test
  [FUI14] Get SSID from NetworkCapabilities

Treehugger Robot   authored and   Gerrit Code Review   commited 2021-01-26 13:13:24 +00:00
c5a7a59483
Revert^2 "Replace Context#sendStickyBroadcastAsUser()"
ConnectivityService is using Context#sendStickyBroadcastAsUser
to send sticky broadcast but this API is not able to call after
it becomes part of Connectivity mainline module. Thus, replace it
with Context#sendStickyBroadcast.

The original commit was reverted because of a test failure. This
reverted commit is bound to the fix and will submit together.

Bug: 177223402
Change-Id: I75b8494e8ee30f484f33e9a9a660c7f9ad75f368
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases
Test: atest CtsNetApi23TestCases
Test: atest FrameworksNetIntegrationTests

Paul Hu   commited 2021-01-26 02:53:06 +00:00
32fd208a71
Merge "Add method to match address \ port with QosFilter"
Daniel Bright   authored and   Gerrit Code Review   commited 2021-01-25 18:03:32 +00:00
591fe5327c
Merge "Revert "Replace Context#sendStickyBroadcastAsUser()""
Will Osborn   authored and   Gerrit Code Review   commited 2021-01-25 17:20:29 +00:00
42a9366c6f
Fix FrameworksNetIntegrationTests failure
The test is broken because CS is using
sendStickyBroadcast with all users context instead of
sendStickyBroadcastAsUser to send sticky broadcast. So update
related code on ConnectivityServiceIntegrationTest.

Bug: 178367782
Test: atest FrameworksNetIntegrationTests
      atest FrameworksNetTests
Change-Id: I7ad94fa31ea16025e6ad62d41235978f45be5d99

paulhu   commited 2021-01-25 23:40:06 +08:00
b15a22e5b9
Revert "Replace Context#sendStickyBroadcastAsUser()"
This reverts commit c529710329.

Reason for revert: DroidMonitor: Potential culprit for Bug http://b/178367782 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I7fd74bf481febf1cba8b6c8fbf01c4908f847606

Will Osborn   commited 2021-01-25 14:34:30 +00:00
3eaba31d42
Merge "Replace Context#sendStickyBroadcastAsUser()"
Paul Hu   authored and   Gerrit Code Review   commited 2021-01-25 05:57:22 +00:00
0a6682146c
Move connectivity-sources to frameworks/base
All sources for the connectivity module are being moved to
frameworks/base/packages/Connectivity, so that they can all be moved to
packages/modules/Connectivity in one move keeping history.

INetworkAgent and INetworkAgentRegistry were created in
packages/modules/Connectivity directly, but this makes managing the
sources until the move harder as the module needs to pull sources from
two different locations. Considering that they do not have history to
move, just move them to frameworks/base/packages/Connectivity without
the commit history.

Bug: 171540887
Test: m
Change-Id: Ic4353115a98b6235c2b5d5ce24741223e618d0a6

Remi NGUYEN VAN   commited 2021-01-25 11:47:42 +09:00
c2fb349511
[FUI05] Remove wimax data usage unit test
In follow-up patches, the network type will be derived from
transport types, which officially doesn't support wimax.
Thus, remove the test which rely on it first since it is
not needed and will not be needed.

Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: I713bc2ec39e3a4fa19ed13d2e9ff9ae35477d726

junyulai   commited 2021-01-22 23:58:14 +08:00
cb95247c1e
[FUI14] Get SSID from NetworkCapabilities
This allows subsequent patches to remove the need of exposing
SSID in NetworkState.

Test: atest NetworkStatsServiceTest
Bug: 174123988
Change-Id: Ib9ab07c9610954c9a5de035a3aefbf6d0bb0b53b

junyulai   commited 2021-01-22 23:58:14 +08:00
de493c006a
Add method to match address \ port with QosFilter
* The match method is only for local address and port since we have
no other use case.

Bug: 155176305
Test: Added new test
Change-Id: I7b45f9912af6a192fc60606f5e0b4cc479aea93f

Daniel Bright   commited 2021-01-22 06:24:41 -08:00
07dd129bbe
Merge "Replace NetworkPolicyManagerInternal#isUidRestrictedOnMeteredNetworks()"
Paul Hu   authored and   Gerrit Code Review   commited 2021-01-22 14:18:47 +00:00
85aad57203
Merge "Add Qos Callback support"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-01-22 13:09:24 +00:00
29f0f6d47f
Merge "Add Qos Callback files"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-01-22 13:06:43 +00:00
a96f7a4d89
Merge "Mark connectivity test utilities as module API"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-01-22 10:11:39 +00:00
5ef8031d57
Replace NetworkPolicyManagerInternal#isUidRestrictedOnMeteredNetworks()
Connectivity service is going to become a mainline module which
will not able to access hidden APIs. NetworkPolicyManagerInternal
is a internal serivce that CS can't be access after be a mainline
module. Thus, create NPMS#isUidRestrictedOnMeteredNetworks() and
NPM#isUidRestrictedOnMeteredNetworks() to replace
NPMI#isUidRestrictedOnMeteredNetworks().

Also correct the permission check in isUidNetworkingBlocked()
that needs to check OBSERVE_NETWORK_POLICY only.

Bug: 170598012
Test: atest FrameworksNetTests
Test: atest FrameworksCoreTests:NetworkPolicyManagerTest
Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest
Test: atest CtsNetTestCases
Test: atest CtsHostsideNetworkTests
Change-Id: I5801a3a2076f3eb199a0226c38c85014b26c64e7

paulhu   commited 2021-01-22 16:14:28 +08:00
76cf0c5c8e
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

Remi NGUYEN VAN   commited 2021-01-22 16:16:57 +09:00
7d4530b98d
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

Daniel Bright   commited 2021-01-21 20:14:52 -08:00
60f02ed76b
Add Qos Callback files
* Add QosCallback stub files

Bug: 155176305
Test: N/A
Change-Id: I7c231d60880c37ae1ce49fa8a621badf386ab8a7

Daniel Bright   commited 2021-01-21 19:50:24 -08:00
53f0e44449
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

Remi NGUYEN VAN   authored and   Chalard Jean   commited 2021-01-21 22:36:54 +09:00
d793eb34ca
Merge "[IT4.4] Host network activity related logic into a new class"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-01-21 08:41:15 +00:00
18e77a4752
Merge "Use ParcelFileDescriptor instead of FileDescriptor in the aidl"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-01-21 08:40:53 +00:00
0ad97bf744
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

Chiachang Wang   commited 2021-01-21 08:40:12 +00:00
979f46a693
Merge "Replace Context @hide API in MultinetworkPolicyTracker"
Paul Hu   authored and   Gerrit Code Review   commited 2021-01-21 07:53:19 +00:00
161e0b9b78
[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

lucaslin   authored and   Chiachang Wang   commited 2021-01-21 06:27:23 +00:00
6d502ed79d
Merge "Mark TestNetworkManager as module API"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-01-21 06:02:25 +00:00
cc041a72e7
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

Remi NGUYEN VAN   commited 2021-01-21 10:45:04 +09:00
5eee3ec919
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

paulhu   commited 2021-01-21 01:19:09 +08:00
fd8dac4fe5
Merge "Revert "[VCN06] Support request background network""
Junyu Lai   authored and   Gerrit Code Review   commited 2021-01-19 10:24:47 +00:00
2fa034c812
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

Junyu Lai   commited 2021-01-19 09:06:00 +00:00
34263da2c9
Merge "Fix CaptivePortalDataTest#testParcelUnparcel on R"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-01-19 04:45:08 +00:00
d806079674
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.

Treehugger Robot   authored and   Gerrit Code Review   commited 2021-01-19 04:19:56 +00:00
4fcb0e54a1
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

Remi NGUYEN VAN   commited 2021-01-19 02:33:09 +00:00
da94136cc7
Address comments on aosp/1539753, aosp/1542487 and aosp/1547496.
Bug: 173331190
Test: test-only change
Change-Id: I475502fde55d24e7ae3f7fe9f43c54740c57a9cf

Lorenzo Colitti   commited 2021-01-19 10:35:43 +09:00
34007bd8de
Merge "[VCN06] Support request background network"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-01-19 01:04:20 +00:00
95f0791724
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

Lorenzo Colitti   commited 2021-01-19 09:40:53 +09:00
c284b4b8dd
Test for bugs with suspended VPN underlying networks.
Test: atest --rerun-until-failure 100 ConnectivityServiceTest#testVpnSwitchFromSuspendedToNonSuspended
Change-Id: Ia52f9cafef3f49ae70ad135d017e207eb57fddfe

Lorenzo Colitti   commited 2021-01-19 00:42:46 +09:00
dbf549c1c7
Merge changes Ic5750d4f,I9fa888c9,I4211475f
* changes:
  Deflake testNetworkBlockedStatusAlwaysOnVpn
  Simplify testVpnRestrictedUsers.
  Add test coverage for LockdownVpnTracker.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-01-18 14:03:54 +00:00
c127a58770