Commit Graph

66 Commits

Author SHA1 Message Date
Jayachandran Chinnakkannu
2e83d431f0 Merge "QOS filter matching support based on remote address and port number for connected sockets" am: fd92919d9d am: 61736254b7 am: cea0264ef0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1687813

Change-Id: I04ada71bdea2c3851fd6925126f6ff2bfdecad2c
2021-05-14 21:19:17 +00:00
Chiachang Wang
c5c3bfb20e Replace clearAll with withoutDefaultCapabilities
As the feedback from API review, the clearAll method in Builder
does not match the actual usage. Thus, remove it and replace
with withoutDefaultCapabilities to provide clearer usage.

Bug: 184735772
Test: make update-api ; m
Change-Id: Ida8d25d57504864f046e3403f593cc606fbfe982
CTS-Coverage-Bug: 186061922
2021-05-14 14:53:47 +08:00
Jayachandran C
eab334d00a QOS filter matching support based on remote address and port number for connected sockets
This CL adds APIs for telephony to perform filter matching based on
remote address if the socket is connected. Additional checks will be
performed on the state of socket to avoid the future callbacks in a
separate CL.

Bug: 181916576
Test: Manually verified in live T-Mobile network
      atest ConnectivityServiceTest
      atest com.android.internal.telephony.dataconnection.QosCallbackTrackerTest

Change-Id: I6fbd4e84c76bc4acbf4e59f06f8e86e0237bae29
2021-05-13 09:50:13 -07:00
Chiachang Wang
14a74d0c62 Merge "Address API review feedback" 2021-04-26 00:22:27 +00:00
Chiachang Wang
2cd79f28d8 Address API review feedback
Address API review feedback to:
 - Rename NetworkAgent#setTeardownDelayMs to
   NetworkAgent#setTeardownDelayMillis
 - Use getters instead of fields in VpnTransportInfo
 - Rename registerDefaultNetworkCallbackAsUid to
   registerDefaultNetworkCallbackForUid in ConnectiivityManager

Bug: 183972850
Bug: 185246410
Fix: 184735863
Test: make update-api
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I5e8c4bed8bda40d507afa894c359b5e24ee5d868
Merged-In: I5e8c4bed8bda40d507afa894c359b5e24ee5d868
2021-04-23 02:46:05 +00:00
Chiachang Wang
2e98f6cd57 Address API review feedback
Address API review feedback to:
 - Rename NetworkAgent#setTeardownDelayMs to
   NetworkAgent#setTeardownDelayMillis
 - Use getters instead of fields in VpnTransportInfo
 - Rename registerDefaultNetworkCallbackAsUid to
   registerDefaultNetworkCallbackForUid in ConnectiivityManager

Bug: 183972850
Bug: 185246410
Fix: 184735863
Test: make update-api
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk
Test: atest FrameworksMockingServicesTests
Change-Id: I5e8c4bed8bda40d507afa894c359b5e24ee5d868
2021-04-20 09:30:59 +00:00
junyulai
3c409e8ce7 [VCN19] Rename get/setSubIds to get/setSubscriptionIds
Test: atest FrameworksNetTests FrameworksVcnTests
Fix: 185215036
Merged-In: I9d90df5fc13b36d2cdc4920b456dcc87fcd2b3a7
Change-Id: I9d90df5fc13b36d2cdc4920b456dcc87fcd2b3a7
  (cherry-picked from ag/14198665)
2021-04-19 17:41:01 +08:00
Junyu Lai
d175339d58 Merge "[VCN19] Rename get/setSubIds to get/setSubscriptionIds" into sc-dev 2021-04-16 15:59:16 +00:00
junyulai
58153cc4c4 [VCN19] Rename get/setSubIds to get/setSubscriptionIds
Test: atest FrameworksNetTests FrameworksVcnTests
Fix: 185215036
Ignore-AOSP-First: avoid merge conflict
Change-Id: I9d90df5fc13b36d2cdc4920b456dcc87fcd2b3a7
2021-04-15 18:05:38 +08:00
Chalard Jean
e634b28204 Allow network providers to set the linger duration.
Test: atest CtsNetTestCases:NetworkAgentTest#testSetLingerDuration
Ignore-AOSP-First: prevent merge conflict
CTS-Coverage-Bug: 184796264
Bug: 184227264
Change-Id: I7f420faa40863385114705d6971cf00887d03318
2021-04-14 20:26:12 +08:00
Chiachang Wang
9b653a7c46 Merge "Rename APIs in NetworkAgentConfig.Builder" am: 3cbfc11c93 am: d9feace234 am: 3633ac43f6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669047

Change-Id: I1988750dd4b65a3d74c33c8fc120bb3bcb705320
2021-04-12 15:14:26 +00:00
Chiachang Wang
3d1e89d298 Rename APIs in NetworkAgentConfig.Builder
As API review feedback, rename disableProvisioningNotification()
to setEnabledProvisioningNotification and disableNat64Detection()
to setEnabledNat64Detection. Also, update code in caller side
accordingly.

Bug: 184735772
Test: make update-api ; atest FrameworksNetTests
Change-Id: If7305634863d1503c967e5593ebd0c8af2174bea
2021-04-12 17:27:47 +08:00
Remi NGUYEN VAN
2d52a9ddda Merge "Replace fields with getters in keepalive API" am: bc01e88edc am: 4c1a04c308 am: 2c5dcb4c03
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669345

Change-Id: I73f6f89eb2d1255743d10c1ec1c92770845bdd63
2021-04-09 02:34:59 +00:00
Remi NGUYEN VAN
029a0cff8a Replace fields with getters in keepalive API
General guidance is to have getters in the API instead of fields.

Fixes: 181014882
Test: m
Change-Id: Id4bfc447701e8d0380163047779fbba043f17b6f
2021-04-08 14:06:53 +09:00
Benedict Wong
54c906b000 Merge "Downgrade list of subIds in NetworkCapabilities to @SystemApi" am: 87e0ab8905 am: d5af88a835 am: 01001e2ddf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652974

Change-Id: I7a85feb9753ae91ff3d67dc82c8bc880a6626074
2021-04-03 02:01:25 +00:00
Benedict Wong
87e0ab8905 Merge "Downgrade list of subIds in NetworkCapabilities to @SystemApi" 2021-04-02 22:33:20 +00:00
Sarah Chin
129857619f Merge "API to get network visible network capability name" 2021-04-02 16:50:10 +00:00
Benedict Wong
4310e45eff Downgrade list of subIds in NetworkCapabilities to @SystemApi
This change downgrades API visibility for the list-of-subIds in the
NetworkCapabilities to SystemApi

Bug: 175662146
Test: atest NetworkCapabilitiesTest#testSubIds
Test: atest FrameworksNetTests
Change-Id: I372fa9eaa7585aefd1710948ca007456feedd578
2021-04-02 01:18:11 -07:00
Aaron Huang
55a22edbab Merge "Expose BIP and VSIM relavent definitions" 2021-04-01 11:38:17 +00:00
Chalard Jean
b82a74b077 Expose sendNetworkScore that takes a NetworkScore
Bug: 167544279
Test: FrameworksNetTests
CTS-Coverage-Bug: 184037351
Change-Id: I5dd9b526c53cb99a5e4ae87f1e3724a7a1870e78
2021-03-31 13:26:46 +00:00
Chalard Jean
c44fa15b73 [NS08] Expose public NetworkScore API
This exposes the two bits settable by the network agents in
Android S on NetworkScore. This is meant to be extensible in
future releases, or possibly for OEM upstreams.

Test: builds
CTS-Coverage-Bug: 184037351
Bug: 167544279
Change-Id: Id7ee1bd3e2679f0bd5200d5c299f18a33b87847c
2021-03-30 23:54:19 +09:00
Lorenzo Colitti
61a9bf9f02 Merge changes If539cf5d,I9765f1c9,I6d3007a1 am: 2206e976c1 am: 8c9d2c1823 am: 958a701738
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652262

Change-Id: I94e5cf19a7b7dac8400cb7acf80b39a864099956
2021-03-30 02:24:00 +00:00
Lorenzo Colitti
6d88078151 Add a setTeardownDelayMs API to NetworkAgent.
This allows transports to request that when the network is
disconnected, the system should delay destroying the native
network until the specified time has passed after the network
disconnected.

Bug: 181941583
Test: next CL in the stack
Change-Id: I9765f1c9d1e55c23c6d583d6709dbe06505975b1
2021-03-29 21:33:08 +09:00
lifr
f1594291c4 [TL02]Remove hidden API usage of NetworkAgent
The connection service will become the mainline module.
Remove the hidden API usage of NetworkAgent.

Bug: 170598012
CTS-Coverage-Bug: 170598012
Test: atest FrameworksNetTests FrameworksTelephonyTests
      atest FrameworksWifiTests
Change-Id: I4e4040ae7f94bdf479c7df9ec2ffabafbe06331c
Merged-In: I4e4040ae7f94bdf479c7df9ec2ffabafbe06331c
2021-03-29 15:33:44 +08:00
Chiachang Wang
ec5b130e4e Expose BIP and VSIM relavent definitions
In order to support special APNs below, OEM may need extra
NetworkCapabilities and apn type definition to support the
carriers request. Add corresponding definition into API
surface.

VSIM: for Virtual SIM service
BIP: for Bearer Independent Protocol

Bug: 130869457
Test: make update-api
Change-Id: I41e881c6fe39e92d5cdac2d0a02fa8a8e814c9c5
Merged-In: I41e881c6fe39e92d5cdac2d0a02fa8a8e814c9c5
2021-03-26 06:17:25 +00:00
Chalard Jean
be07793b86 Merge changes from topic "ns05" into sc-dev
* changes:
  [NS06] Implement the don't-reap mechanism
  [NS05] Feed network offer callbacks
2021-03-26 05:07:39 +00:00
Chiachang Wang
3ffcb398e2 Add network disconnected callback
Create a network callback to notify network agent after the
native network being destroyed by netd which means the network
is fully disconnected. The NetworkAgent may handle this event
after sending disconnect state to ConnectivityService to proceed
its pending works that have to be done after it.

Bug: 178725261
Test: make update-api
Change-Id: I602ff2c688909473b03b72c9407d4286608cff4c
Merged-In: I602ff2c688909473b03b72c9407d4286608cff4c
2021-03-26 02:53:29 +00:00
Sarah Chin
bba22b2120 API to get network visible network capability name
Test: atest DataConnectionTest, DcTrackerTest
Bug: 181916712
CTS-Coverage-Bug: 183553812
Change-Id: Iae63ac4d62641cee2bd0f0c5f50dd729750d514c
Merged-In: Iae63ac4d62641cee2bd0f0c5f50dd729750d514c
2021-03-25 15:10:39 -07:00
Chalard Jean
f278aba302 [NS06] Implement the don't-reap mechanism
This exposes a mechanism for network providers to tell
the network stack that a given network must be kept up
for some specific reason. This is meant to be easier
for them than to have to file a request, in particular
because there is no guaranteed way to make sure the
request will be best matched by any given network.

Test: new test for this
Bug: 167544279
Change-Id: I238a3ee5ee9262477a23b897e4141769dd1505d1
2021-03-25 14:10:06 +00:00
Chiachang Wang
c542ed20fa Merge "Add network created callback support" 2021-03-25 13:22:17 +00:00
Chiachang Wang
38e6236781 Expose BIP and VSIM relavent definitions
In order to support special APNs below, OEM may need extra
NetworkCapabilities and apn type definition to support the
carriers request. Add corresponding definition into API
surface.

VSIM: for Virtual SIM service
BIP: for Bearer Independent Protocol

Bug: 130869457
Test: make update-api
Change-Id: I41e881c6fe39e92d5cdac2d0a02fa8a8e814c9c5
2021-03-25 21:19:37 +08:00
Chalard Jean
7b6a33bd50 [NS05] Feed network offer callbacks
The design is very simply expressed :
An offer is needed for a request if and only if that offer
might beat the satisfier for that request.

The implementation of "might beat" is NetworkRanker#mightBeat.

Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Bug: 167544279
Change-Id: I0fe911eef2483ecbac48c733d56283b81538690a
2021-03-25 22:13:10 +09:00
Lucas Lin
29ed3efbfe Merge changes Ic2357dcf,Iddf8c71a
* changes:
  Expose NetworkAgent constructor taking a NetworkScore parameter
  Expose NetworkScore to external caller
2021-03-25 11:28:28 +00:00
Chiachang Wang
fb0d390e6f Add network created callback support
Create a network callback to notify network agent after
netd has created the network, so that the NetworkAgent may
wait for this callback and ensure the pre-work to communicate
with netd completed.

Bug: 178725261
Test: make update-api
Change-Id: I8c2ff7bd6980ae838abc5669f9419d62741b8666
Merged-In: I8c2ff7bd6980ae838abc5669f9419d62741b8666
2021-03-25 18:27:24 +08:00
Chiachang Wang
4ab0a63b36 Add network disconnected callback
Create a network callback to notify network agent after the
native network being destroyed by netd which means the network
is fully disconnected. The NetworkAgent may handle this event
after sending disconnect state to ConnectivityService to proceed
its pending works that have to be done after it.

Bug: 178725261
Test: make update-api
Change-Id: I602ff2c688909473b03b72c9407d4286608cff4c
CTS-Coverage-Bug: 178725261
2021-03-25 09:58:48 +00:00
TreeHugger Robot
a2e53b9d30 Merge "Add network created callback support" into sc-dev 2021-03-25 08:52:56 +00:00
Chiachang Wang
823542095f Expose NetworkAgent constructor taking a NetworkScore parameter
Vpn constructs NetworkAgent with this exposed NetworkAgent
constructor. Given NetworkAgent is moving into the incoming
connectivity module, Vpn which is outside the module will not
be able to access it if it's not in the API surface. Thus,
expose it to allow Vpn to use it.

Bug: 182963397
Test: make update-api
Change-Id: Ic2357dcfff3233e0dd17b48b0e376a5095ef60fa
Merged-In: Ic2357dcfff3233e0dd17b48b0e376a5095ef60fa
CTS-Coverage-Bug: 172183305
  (cherry-picked from ag/13966707)
2021-03-25 08:40:27 +00:00
lucaslin
026a987e1e Expose NetworkScore to external caller
NetworkScore will be a part of mainline module, so the external
callers cannot call its hidden APIs. Expose needed APIs to
the external callers.

CTS-Coverage-Bug: 182963397
Bug: 182963397
Test: m
Change-Id: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
Merged-In: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
  (cherry-picked from ag/13947595)
2021-03-25 08:15:09 +00:00
Chiachang Wang
85d72bdad0 Add network created callback support
Create a network callback to notify network agent after
netd has created the network, so that the NetworkAgent may
wait for this callback and ensure the pre-work to communicate
with netd completed.

Bug: 178725261
Test: make update-api
Change-Id: I8c2ff7bd6980ae838abc5669f9419d62741b8666
CTS-Coverage-Bug: 178725261
2021-03-25 00:27:11 +00:00
Jayachandran Chinnakkannu
24411775d7 Merge "Add 5G/NR QOS support" am: df448f6eaa am: 6ed7c1c523 am: 3bad6f9856
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1643762

Change-Id: I74c0d7d771d0b7e067dddc582389f77b8a899542
2021-03-24 18:58:50 +00:00
Jayachandran C
8ae3bf3f92 Add 5G/NR QOS support
Bug: 155176305
Bug: 182317794
Test: atest ConnectivityServiceTest
      atest QosCallbackTrackerTest

Change-Id: Idf6d8a7c3b80bc50a2c1244ceaefea9381d40c2f
2021-03-23 19:14:21 -07:00
Sarah Chin
89888d72e7 API to get network visible network capability name
Test: atest DataConnectionTest, DcTrackerTest
Bug: 181916712
CTS-Coverage-Bug: 183553812
Change-Id: Iae63ac4d62641cee2bd0f0c5f50dd729750d514c
2021-03-24 00:27:11 +00:00
TreeHugger Robot
e719bfb2bc Merge "Expose NetworkAgent constructor taking a NetworkScore parameter" into sc-dev 2021-03-23 12:45:24 +00:00
Lucas Lin
a652f6bec8 Merge "Expose NetworkScore to external caller" into sc-dev 2021-03-23 12:18:23 +00:00
Chiachang Wang
5c3c52975a Expose NetworkAgent constructor taking a NetworkScore parameter
Vpn constructs NetworkAgent with this exposed NetworkAgent
constructor. Given NetworkAgent is moving into the incoming
connectivity module, Vpn which is outside the module will not
be able to access it if it's not in the API surface. Thus,
expose it to allow Vpn to use it.

Bug: 182963397
Test: make update-api
Change-Id: Ic2357dcfff3233e0dd17b48b0e376a5095ef60fa
CTS-Coverage-Bug: 172183305
2021-03-23 08:51:05 +00:00
lucaslin
10d347a2fe Expose NetworkScore to external caller
NetworkScore will be a part of mainline module, so the external
callers cannot call its hidden APIs. Expose needed APIs to
the external callers.

CTS-Coverage-Bug: 182963397
Bug: 182963397
Test: m
Change-Id: Iddf8c71a5f51a40bc6ff78626b3e8ee530d1b7eb
2021-03-23 16:17:37 +08:00
Frank Li
133793bd46 Merge "[TL02]Remove hidden API usage of NetworkAgent" into sc-dev 2021-03-23 02:03:59 +00:00
lifr
cbe8c09525 [TL02]Remove hidden API usage of NetworkAgent
The connection service will become the mainline module.
Remove the hidden API usage of NetworkAgent.

Bug: 170598012
CTS-Coverage-Bug: 170598012
Test: atest FrameworksNetTests FrameworksTelephonyTests
      atest FrameworksWifiTests
Change-Id: I4e4040ae7f94bdf479c7df9ec2ffabafbe06331c
2021-03-23 02:01:38 +00:00
Jayachandran Chinnakkannu
fce4049a1d Merge "Swap parameters in QosCallback#registerQosCallback" 2021-03-21 21:02:36 +00:00
Roshan Pius
332e7a241a resolve merge conflicts of 403b7fd0b0a6736bcee1817fb5c774f8c8a040de to stage-aosp-master
Change-Id: Ib9d7923104ac0a60f6af5a3a2d2b7f13bc0262e3
2021-03-21 19:16:33 +00:00