Commit Graph

12707 Commits

Author SHA1 Message Date
Sudheer Shanka
d5da6e7182 Merge "Remove NetworkPolicyManager.isUidBlocked() API." am: 9cff99d059
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652550

Change-Id: Ia95b11bcf91f18338b26146f6bb9488861555303
2021-03-29 16:19:05 +00:00
Sudheer Shanka
90358f5154 Remove NetworkPolicyManager.isUidBlocked() API.
It isn't used by ConnectivityService any more and even if
it needs such utility method in the future, we could create
one which is part of connectivity module and doesn't need
to be exposed as part of NetworkPolicyManager API surface.

Bug: 183696103
Test: atest ./tests/net/java/com/android/server/ConnectivityServiceTest.java
Change-Id: Ie3c681f88e4b2b9bb92d2224c5ea96b074f155d5
2021-03-29 12:39:12 +00:00
Frank Li
b1d27c29ff Merge changes from topic "NetworkAgent02" am: 8539ed6fd2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1654917

Change-Id: If59df525be2483064976d3919cf7033fb94e41e6
2021-03-29 11:43:14 +00:00
lifr
3ab40b5390 [TL02]Remove hidden API usage of NetworkAgent am: f1594291c4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1642722

Change-Id: I12342dc4c4ee8748396b7ced2f344611704caa2d
2021-03-29 11:39:55 +00:00
Frank Li
8539ed6fd2 Merge changes from topic "NetworkAgent02"
* changes:
  Fix cannot success verify count of the networkAgent Config items on R device
  [TL02]Remove hidden API usage of NetworkAgent
2021-03-29 11:08:24 +00:00
Junyu Lai
4890738bde Merge "Support Dual ViLTE stats" am: 371bd281f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540920

Change-Id: Ie65e2a2530b3e10b1cb7b571bbe4e7255caf1b08
2021-03-29 07:37:34 +00:00
lifr
f459c60984 Fix cannot success verify count of the networkAgent Config items on R
device

Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkAgentConfigTest
Fix: 183474500
Change-Id: Ie0fd5ba816c390bfb7bc6512d896a88482c217ec
Merged-In: Ie0fd5ba816c390bfb7bc6512d896a88482c217ec
2021-03-29 15:36:32 +08: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
Junyu Lai
371bd281f5 Merge "Support Dual ViLTE stats" 2021-03-29 06:59:19 +00:00
Remi NGUYEN VAN
7c9169bd61 Merge "Re-implement NetworkUtils#queryUserAccess." am: a99e50dbf7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1650330

Change-Id: I1dd7913bacf5b92e35ec0a5b14da4d9b40513f21
2021-03-29 05:32:39 +00:00
Remi NGUYEN VAN
a99e50dbf7 Merge "Re-implement NetworkUtils#queryUserAccess." 2021-03-29 04:57:40 +00:00
Lorenzo Colitti
092af05525 Re-implement NetworkUtils#queryUserAccess.
Currently, queryUserAccess talks to netd via FwmarkServer.
Doing this from the module would require exposing queryUserAccess
as an NDK API or reimplementing FwmarkClient.

Because queryUserAccess really only uses information that comes
from ConnectivityService/PermissionMonitor anyway, just use that
information without calling to net.

Test: atest HostsideVpnTests
Bug: 171540887
Merged-In: If855de1ea3e1fd2ed30f2795d9b4acfcf969a2dc

Change-Id: If855de1ea3e1fd2ed30f2795d9b4acfcf969a2dc
2021-03-29 12:11:19 +09:00
Treehugger Robot
11d95a5c72 Merge "Add network disconnected callback" am: 6d1437a596
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652259

Change-Id: I75bd112821c42c16d7ed91ecbb4f21104c95204b
2021-03-26 06:28:19 +00:00
Treehugger Robot
6d1437a596 Merge "Add network disconnected callback" 2021-03-26 05:47:33 +00:00
Lorenzo Colitti
7de5bd543e Merge changes from topic "blocked-reasons-callback-tests" am: 2108a92452
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652214

Change-Id: I02f2f4458329e17ab33d792dee98ffe5f6499ad0
2021-03-26 04:04:27 +00:00
paulhu
26611dc3d3 Add MOBILE_DATA_PREFERRED_APPS setting am: 521169738c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1654015

Change-Id: I4d5c5cfaa2a35a6919517c6e5737fffdd0f217f3
2021-03-26 04:02:02 +00:00
paulhu
43944db404 Add PRIVATE_DNS_MODE setting setter am: 87ac58016f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1654014

Change-Id: I97de83147a0c656802601ec116ee9ee7de114884
2021-03-26 03:58:53 +00:00
paulhu
df6a143255 Expose ConnectivitySettingsManager as module-lib API am: e6badefc33
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1654013

Change-Id: I6b53ced3ed523f984dde3c5b24cd53f832284da0
2021-03-26 03:54:38 +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
Lorenzo Colitti
9150b1ec95 Add unit tests for onBlockedStatusChanged(Network, int).
Bug: 165835257
Test: atest FrameworksNetTests
Change-Id: I0597df71aa94817835d7a2fb54bfcf9222a34b64
2021-03-26 02:37:20 +09:00
paulhu
521169738c Add MOBILE_DATA_PREFERRED_APPS setting
This setting is OEM upstream requirement for mobile data
preferred apps feature.

Bug: 171872461
Test: atest FrameworksNetTests
Merged-In: Ic5e0515b2b948de3d333c8d8e073d0b15514562a
Change-Id: Iba17bf68cffbe39d1c08ad94364b41bbf851bf57
2021-03-26 02:37:19 +09:00
Lorenzo Colitti
60104f59a0 Add onBlockedStatusChanged(Network, int) to NetworkCallback.
This is similar to onBlockedStatusChanged(Network, boolean) but
it allows the callback holder to know the exact reason why
networking was blocked. It is useful to privileged system
components such as JobScheduler that are able to ignore some
blocked reasons but not others.

Also add a new BLOCKED_REASON_LOCKDOWN_VPN that is used when
networking is blocked because an always-on VPN is in
lockdown mode.

Also move BLOCKED_METERED_REASON_MASK to ConnectivityManager.
This is necessary because ConnectivityService must ensure that
the blocked status callbacks are correctly sent when meteredness
changes (e.g., a UID that is blocked on metered networks will
become unblocked on a network that becomes unmetered). In order
to do this it needs to know which reasons apply only on metered
networks.

Bug: 165835257
Test: unit tests in subsequent CLs in the stack
Change-Id: I647db4f5a01280be220288e73ffa85c15bec9370
2021-03-26 02:37:19 +09:00
paulhu
87ac58016f Add PRIVATE_DNS_MODE setting setter
Bug: 182538166
Test: atest FrameworksNetTests
Merged-In: If234426f041606c4881de1eca31b6f5bdb3c6bfe
Change-Id: Iaa9e6cc92f1805ab341c308fc60e947ec4c674f0
2021-03-26 02:37:16 +09:00
paulhu
e6badefc33 Expose ConnectivitySettingsManager as module-lib API
Have getter/setter methods for external modules that can
get/set the setting values.

Bug: 182538166
Test: atest FrameworksNetTests
Merged-In: I82225a43f95e3e1d3e52c4e7a0fc541c0087292e
Change-Id: I61cb00216494e35b6e0dfe444b177cad36ad8afb
2021-03-26 02:35:07 +09:00
Chiachang Wang
cc030c76f5 Merge "Add network created callback support" am: c542ed20fa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1652209

Change-Id: Ibd2d575b5e3bdfc164c4721bc5bbb0c8b90601e0
2021-03-25 13:42:54 +00:00
Chiachang Wang
c542ed20fa Merge "Add network created callback support" 2021-03-25 13:22:17 +00:00
Lucas Lin
b4ac20f26b Merge "Add annotation for Vpn#getNetwork()" am: 3483ccf883
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653946

Change-Id: I3be5109c253365b3c5bc56ae48114f8e37c4f153
2021-03-25 12:30:18 +00:00
Lucas Lin
22f8ded94a Merge "Remove the usage of NETID_UNSET from Vpn.java" am: 0f114dff28
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653929

Change-Id: Ic50dee391e123b9e9debb8e77bac1f0499d939f1
2021-03-25 12:25:42 +00:00
Lucas Lin
cc2827494a Merge "Expose some APIs from ConnectivityManager" am: bcf2a79ec8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653936

Change-Id: I1a31a6162d5098770c0d5b19faa7af83553f6a2e
2021-03-25 12:17:18 +00:00
Lucas Lin
6cece1f221 Merge changes Ic2357dcf,Iddf8c71a am: 29ed3efbfe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653939

Change-Id: I9c5f96893488f1e103cba740a0bbfb474ffe90b9
2021-03-25 12:07:49 +00:00
lucaslin
e1f3a8b1da Expose NetworkScore to external caller am: 026a987e1e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1653938

Change-Id: I5f2fb6bb6f2de4d81fb3b750053ee5abbe82caeb
2021-03-25 11:53:29 +00:00
Lucas Lin
3483ccf883 Merge "Add annotation for Vpn#getNetwork()" 2021-03-25 11:29:38 +00:00
Lucas Lin
0f114dff28 Merge "Remove the usage of NETID_UNSET from Vpn.java" 2021-03-25 11:29:17 +00:00
Lucas Lin
bcf2a79ec8 Merge "Expose some APIs from ConnectivityManager" 2021-03-25 11:29:08 +00: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
lucaslin
150976c603 Add annotation for Vpn#getNetwork()
- Add @VisibleForTesting & @Nullable for Vpn#getNetwork().
- Remove null check in caller side(test) of Vpn#getNetwork()
because if the code is working properly, it can never be null.

Bug: 182963397
Test: atest FrameworksNetTests
Change-Id: Ic52864003fbebd9f4e95d43fefc2e168437b0122
Merged-In: Ic52864003fbebd9f4e95d43fefc2e168437b0122
  (cherry-picked from ag/13946573)
2021-03-25 10:21:07 +00:00
lucaslin
6b49587384 Remove the usage of NETID_UNSET from Vpn.java
Modify Vpn#getNetId() to Vpn#getNetwork() and uses NETID_UNSET
when getNetwork() returns null in ConnectivityServiceTest.

Bug: 182963397
Test: atest FrameworksNetTests
Change-Id: I69d449705b1dc541287c72af8dc7705dc4733109
Merged-In: I69d449705b1dc541287c72af8dc7705dc4733109
  (cherry-picked from ag/13927650)
2021-03-25 10:19:05 +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
lucaslin
2e68aa2e7a Expose some APIs from ConnectivityManager
- Expose setRequireVpnForUids to Vpn.java
- Expose setLegacyLockdownVpnEnabled to LockdownVpnTracker.java
- Expose requestRouteToHostAddress to
  GnssNetworkConnectivityHandler.java

Bug: 182963397
Test: m
Change-Id: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c
Merged-In: I1fb5ecfbe37878ba3534e6c6c7599ca29db2735c
  (cherry-picked from ag/13927657)
2021-03-25 08:07:53 +00:00
Treehugger Robot
7ffa156a73 Merge "Use a longer test timeout in integration test" am: f652408e6c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1650287

Change-Id: Ia76f196039f7d748f47bd4e9a62eb59c8ad1b116
2021-03-25 01:53:51 +00:00
Treehugger Robot
f652408e6c Merge "Use a longer test timeout in integration test" 2021-03-25 01:24:51 +00:00
Jayachandran Chinnakkannu
6ed7c1c523 Merge "Add 5G/NR QOS support" am: df448f6eaa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1643762

Change-Id: Icd4c21b9731256c9b3d39bffc5fddc43276c5fda
2021-03-24 18:26:19 +00:00
Treehugger Robot
c97c779c98 Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." am: eb3ba19447
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651532

Change-Id: If272068940e9a06efbb40149e2b4dd5fbb1185d6
2021-03-24 18:13:19 +00:00
Jayachandran Chinnakkannu
df448f6eaa Merge "Add 5G/NR QOS support" 2021-03-24 17:44:48 +00:00
Treehugger Robot
eb3ba19447 Merge "Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager." 2021-03-24 17:22:50 +00:00
Sudheer Shanka
04aab0f60f Move BLOCKED_REASON_* constants from NPMS into ConnectivityManager.
These constants will now be including all the reasons for why an
uid's network access can be blocked, instead of only the
restrictions that could be imposed by NPMS.

Bug: 183473548
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Merged-In: I4c544415e12adf442fd2415c371b1b70a39c3aa4
Change-Id: I6dcea43fbefa9eac8b5a971b822a5be5422a54b4
2021-03-25 01:33:26 +09: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
Junyu Lai
f85195ae06 Merge "Fix cannot find removeUnwantedCapability on R device" am: 3ef6584f1b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649302

Change-Id: I11ee0a8d6388f78a9db90756c0cbee93c923e1b8
2021-03-23 12:46:45 +00:00