Commit Graph

5745 Commits

Author SHA1 Message Date
Paul Hu
7b848d34b7 Merge "Add DnsResolverServiceManager" am: 6bc7032b85 am: b3ea5a5a71 am: 206c66213e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1465502

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia89725249d9d6fca7a56b426a4bcb024ac8b1bb8
2020-12-29 03:45:34 +00:00
Paul Hu
6bc7032b85 Merge "Add DnsResolverServiceManager" 2020-12-29 02:14:59 +00:00
Patrick Rohr
5197d1bd33 Add Restricted Mode handling to NetworkPolicyManager
Adds Restricted Mode functionality to NetworkPolicyManager. When this
mode is turned on (via setting), only apps with
android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS will be able to
use the network. For all other apps, the network will be blocked by the
firewall. This is controlled by a new allowlist firewall chain
fw_restricted_mode.

As a first step, this implementation still requires a reboot after the
enabling / disabling the mode to take effect. I will provide the dynamic
configuration in the next CL.

Test: atest CtsHostsideNetworkTests && atest
NetworkPolicyManagerServiceTest
Bug: 170322816
Bug: 157505406
Bug: 170322455
Bug: 175281879

Change-Id: I0731fa842c69683953baaf9ec3a9a03454f4c607
2020-12-28 18:01:34 +01:00
Remi NGUYEN VAN
7cad86140e Merge "Register ethernet listeners on specific Executors" am: a9b2fddb51 am: 3e8c949c01 am: 7d3545917b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1513665

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia74a0b6f967f75841e076bc6b825d7809460adc3
2020-12-28 09:12:36 +00:00
Remi NGUYEN VAN
a9b2fddb51 Merge "Register ethernet listeners on specific Executors" 2020-12-28 07:12:45 +00:00
Chiachang Wang
9545203f3f Merge "[IT4.2] Update argument type of interfaceClassDataActivityChanged" am: dcb4051101 am: 8495b1b1dc am: 67cba56eff
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1531806

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I992dd2f78c0f7334bbe97a03faba161d09a03a71
2020-12-28 02:32:19 +00:00
Chiachang Wang
dcb4051101 Merge "[IT4.2] Update argument type of interfaceClassDataActivityChanged" 2020-12-28 01:05:28 +00:00
Serik Beketayev
db38c539cf Merge "[Mainline] Migrate ProxyInfo" am: 3c3711dffd am: 5565118666 am: 40e7949c5f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1506616

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia6f5bf74bf461f762472ea1d88553db3b9719c80
2020-12-25 09:58:40 +00:00
Remi NGUYEN VAN
ec29ea445c Merge "Migrate away from AsyncChannel in NetworkAgent" 2020-12-25 01:57:44 +00:00
Aaron Huang
1346575ebc Merge "Have NetworkPolicyManagerService create MultipathPolicyTracker" am: a34d9a7af1 am: 8f96256d85 am: 27ace52564
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519960

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I023815a53f01a0459b94033b7e2fa2ed91cca86a
2020-12-24 07:02:53 +00:00
Serik Beketayev
4abaecefc2 [Mainline] Migrate ProxyInfo
Bug: 173455434
Test: atest FrameworksNetTests
Change-Id: I924aed710b62a0c91b888a9e04ac2c90cdfd88d0
2020-12-23 22:15:51 -08:00
Aaron Huang
120dfbbec5 Have NetworkPolicyManagerService create MultipathPolicyTracker
To make connectivity service mainline, this patch makes
MultipathPolicyTracker as a submodule of NetworkPolicyManagerService
to remove the dependencies of ConnectivityService.

Bug: 175015282
Test: FrameworksNetTests
Change-Id: I82a7c62069ffd0683deb2f5ce2f99de120a2a16f
2020-12-23 23:17:15 +08:00
Chiachang Wang
4dd4e08c4e [IT4.2] Update argument type of interfaceClassDataActivityChanged
The argument type of interfaceClassDataActivityChanged takes a
string for the network type. It requires both the receivers and
NMS to do type transformation. The transformation is a redundant
work. Update it to take integer directly and rename to
understandable naming.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: Ibe9fa7a1b71af2dab916b5d615742e77e4174c39
2020-12-23 17:34:08 +08:00
Remi NGUYEN VAN
fb9c6e8d3c Migrate away from AsyncChannel in NetworkAgent
Use two oneway binder interfaces instead.
The interfaces post messages to handlers as was implemented before, but
provide a more strictly defined interface, with less hops between
NetworkAgent, AsyncChannel, and ConnectivityService.

The actual public interface is the NetworkAgent @SystemApi: the binder
interface is an internal implementation detail.

Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: Ie364ab50f416e7821e70f4539a881eea828e1256
2020-12-23 17:30:54 +09:00
Chiachang Wang
0930c03c9e Merge "[IT04] Add uid as parameter of interfaceClassDataActivityChanged" am: baef452e38 am: 04aa5eac85 am: a817ecd4b5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1523339

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ieafdf569c13b1421c18fa3086827e6e432b498d7
2020-12-23 07:31:25 +00:00
Chiachang Wang
baef452e38 Merge "[IT04] Add uid as parameter of interfaceClassDataActivityChanged" 2020-12-23 05:20:33 +00:00
Remi NGUYEN VAN
23f93322c2 Merge "Split NetworkUtils and NetworkUtilsInternal" am: 3ed4fd3a89 am: 635d60201d am: edc6b0fb67
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1513140

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ief9d6a1fae360dbe1c43d5d6bac4dad5850c004b
2020-12-23 02:22:35 +00:00
Remi NGUYEN VAN
3ed4fd3a89 Merge "Split NetworkUtils and NetworkUtilsInternal" 2020-12-23 01:19:27 +00:00
paulhu
b6fcddfd5d Add DnsResolverServiceManager
Add DnsResolverServiceManager to obtain android.net.IDnsResolver
IBinder for incoming connectivity service mainline.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: Ibd7a678ceaaa550ff3d8eff1d0c4d3a5073b5527
2020-12-22 21:31:39 +08:00
Benedict Wong
bdfa53714d Merge "Add additional javadoc for VcnManager" am: ba3f1179a8 am: e1a23d3245 am: 3e867f4ff7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1458805

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I37106e194123c0bab6cb187f194bc7f3b619b693
2020-12-22 09:34:12 +00:00
Benedict Wong
ba3f1179a8 Merge "Add additional javadoc for VcnManager" 2020-12-22 08:11:02 +00:00
Benedict Wong
457fe96023 Merge changes Ifabf5e2b,I2e632532 am: c0e2e1c9bd am: 0ed3d9cb2f am: ade3cf56b3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1501053

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie864a11f42cea063bf922a1df3253fcdc6abf681
2020-12-22 06:59:01 +00:00
Chiachang Wang
e63d69a6b8 Merge "[IT03] Add replacement methods for network activity" am: 4ba82f5dba am: 26c1e82d43 am: 8ccb2ba934
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1523338

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0da6d452e989f7a89e33230cabfdc89c1a49ce6d
2020-12-22 06:58:05 +00:00
Chiachang Wang
9c133bc4e9 [IT04] Add uid as parameter of interfaceClassDataActivityChanged
Add uid into interfaceClassDataActivityChanged in
INetworkManagementEventObserver. This helps the listeners to use
BaseNetworkObserver to listen for target evnets instead of using
whole INetdUnsolicitedEventListener with no-op in other event
that listeners do not care about.

Bug: 170598012
Test: m ; atest FrameworksNetTests
Change-Id: I2a42a522c2ff9b1e0be88261a8574bb7f5292fa6
2020-12-22 08:39:22 +08:00
Benedict Wong
c0e2e1c9bd Merge changes Ifabf5e2b,I2e632532
* changes:
  Add persistence for VcnConfig objects by Subscription Group
  Implement basic VcnConfig and VcnGatewayConnectionConfig
2020-12-21 07:10:36 +00:00
Chalard Jean
eeb7c450aa Merge "Move module utils to the module package." 2020-12-21 05:35:09 +00:00
Chiachang Wang
6703edcfed [IT03] Add replacement methods for network activity
Reference for NMS in ConnectivityManager should be removed for
incoming CS mainline. The API for listening network activity
should not go into NMS. As an alternative, the registry requests
should be sent to CS and handled by CS. Add necessary alternative
in IConnectivityManger first. The detail implementation will be
added in the follow up commits.

Bug: 170598012
Test: m
Change-Id: If4d24b937feb88a61f22073af2f671cf20298364
2020-12-21 03:48:54 +00:00
Benedict Wong
7fb0db69b4 Add additional javadoc for VcnManager
This change adds additional detail for the VCN, describing feature set,
use cases and fail-safe modes.

Bug: 163431877
Test: Compiles, Boots (Comment-only change)
Change-Id: I1f82267c20dbbf5875ae27117debdb58f7b96e57
2020-12-18 09:08:54 +00:00
Benedict Wong
ab1b484ac7 Add persistence for VcnConfig objects by Subscription Group
This commit adds the ability for the VcnManagementService to track/store
VCN profiles by subscription groups, and saving/loading to/from disk.

Bug: 163611304
Test: New tests added, passing
Change-Id: Ifabf5e2be090d529cd29e2c68d55ece4858b2aad
2020-12-17 17:17:13 -08:00
Benedict Wong
264973663c Implement basic VcnConfig and VcnGatewayConnectionConfig
This change adds some of the basic fields in VcnConfig and
VcnGatewayConnectionConfig, plus adds a persistability layer to ensure
all VcnConfig(s) are disk-stable.

Bug: 163602123
Bug: 163594033
Test: New tests added, passing
Change-Id: I2e632532809e7768b284be376f2b0a77f634fef5
2020-12-16 17:51:58 -08:00
Chalard Jean
95b575f468 Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Change-Id: If5d1e4a58fb2d6d9544e6d01995dabe445cf1f25
Merged-In: I067eeecd458c34b7f2fbfa439072682661ac750c
2020-12-16 11:44:22 +09:00
Sarah Chin
7f21ec08f7 Move phone ID to extra for action provision
Previously, the phone ID was appended to the broadcast in DCT and sent
to ConnectivityManager. Instead of sending both as an action, send the
phone ID as an extra instead to make the action a protected broadcast.

Test: manually verify a SecurityException when action provision is sent
Test: atest DcTrackerTest
Bug: 172459128
Change-Id: Ic4129def86949d7191d15056852718dadbd72fba
Merged-In: Ic4129def86949d7191d15056852718dadbd72fba
2020-12-15 10:55:22 -08:00
Remi NGUYEN VAN
14d3f78851 Add TcpKeepalivePacketData to SystemApi am: 103ec4aa8d am: a232c68028 am: 40190840bb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494038

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1aa9deefefcaf75959463e8a8a87bfeefb98f0ee
2020-12-15 11:42:19 +00:00
Sarah Chin
a0b9b445a2 Merge "Move phone ID to extra for action provision" 2020-12-15 11:07:25 +00:00
Remi NGUYEN VAN
a232c68028 Add TcpKeepalivePacketData to SystemApi am: 103ec4aa8d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494038

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibe3df65b4e12ecda5d95737f3b1ea18dabc2461d
2020-12-15 09:38:38 +00:00
Remi NGUYEN VAN
eada640d5d Merge changes from topic "tcp_keepalive_fix"
* changes:
  Use API TcpKeepalivePacketData in ClientModeImpl
  Add TcpKeepalivePacketData to SystemApi
2020-12-15 09:02:55 +00:00
Remi NGUYEN VAN
32a5b51fe2 Register ethernet listeners on specific Executors
Have users of EthernetManager#addListener specify an Executor instead of
running callbacks on ConnectivityThread.
For existing clients, run callbacks on the common BackgroundThread.

This change in behavior is fine because addListener is not an API, the
threading model in Q was to run callbacks on the looper of the thread
that first created EthernetManager (so there is already no guarantee on
which thread is used), and the only users are in Settings.

ConnectivityThread is moving to a connectivity-specific JAR, so it
should not be used by external classes.

Bug: 174436414
Test: Ethernet client / tethering working
      atest TetheringIntegrationTests
Change-Id: Ic9a959f89915329f79eeeaa0a210ad50811d1291
2020-12-15 17:57:32 +09:00
Chiachang Wang
f4dade2aec Merge "Remove hidden deprecated getActiveNetworkQuotaInfo" am: 9924f6ac8f am: d779d994aa am: 2478855f1b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1527738

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3f3b1e288635d84e93115fddbbafb5321f55646e
2020-12-15 08:55:43 +00:00
Sarah Chin
48eec1970f Move phone ID to extra for action provision
Previously, the phone ID was appended to the broadcast in DCT and sent
to ConnectivityManager. Instead of sending both as an action, send the
phone ID as an extra instead to make the action a protected broadcast.

Test: manually verify a SecurityException when action provision is sent
Test: atest DcTrackerTest
Bug: 172459128
Change-Id: Ic4129def86949d7191d15056852718dadbd72fba
2020-12-15 00:25:01 -08:00
Chiachang Wang
9924f6ac8f Merge "Remove hidden deprecated getActiveNetworkQuotaInfo" 2020-12-15 07:02:54 +00:00
Chiachang Wang
8fd2f6d2aa Remove hidden deprecated getActiveNetworkQuotaInfo
getActiveNetworkQuotaInfo has never been in API surface since it
was introduced. It became essentially functionless since android O,
so there should be no usage dependency upon the hidden method,
In order to support ConnectivityService mainline, remove the
useless function to prevent necessary dependency.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: Ia685b3260256d465ef614b2f577d13344074c787
2020-12-15 06:45:50 +00:00
Remi NGUYEN VAN
103ec4aa8d Add TcpKeepalivePacketData to SystemApi
This is consistent with NattKeepalivePacketData, which is also a
subclass of KeepalivePacketData.

TcpKeepalivePacketData is already used by the wifi module, but
statically linked.

Bug: 172789687
Test: m
Change-Id: I6aee1ae205987521bea4a3838bbece279ffa0e37
2020-12-14 18:43:44 +09:00
Paul Hu
60fefd4efe Merge "Expose TcpRepairWindow as module-lib API" am: f24f42ad0f am: 993efbdf84 am: 39f344f26b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519961

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iae69946c88267eca4c350d902df0af50fca9de5b
2020-12-11 11:04:22 +00:00
Chalard Jean
03867a2590 Merge changes from topic "remove_legacy_NA" am: 362fc1ca1f am: c65281e9c4 am: 0e91f659ba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1456097

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If9cd6ce929a7103d2d6b7195a71ee64ea0a4ee0a
2020-12-11 11:03:36 +00:00
Jeff Sharkey
41859c2353 Merge "Update OWNERS info for NetworkPolicy related files." am: c9dc68f063 am: 532338d7ce am: 05c024c6a1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1522897

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4b90977342f2d8aecf0b8348ee56ad0d673b6017
2020-12-11 10:49:07 +00:00
Paul Hu
f24f42ad0f Merge "Expose TcpRepairWindow as module-lib API" 2020-12-11 05:37:10 +00:00
Chalard Jean
362fc1ca1f Merge changes from topic "remove_legacy_NA"
* changes:
  Remove support for legacy network agents
  Remove deprecated constructors for NetworkAgent
  Migrate NetworkAgentWrapper to the new NA API
  Cleanup TestNetworkService
2020-12-11 02:32:57 +00:00
Sam Saccone
bf33f70982 Merge "Revert "Temporarily replace "android.com" accounts."" 2020-12-10 23:05:03 +00:00
Jeff Sharkey
c9dc68f063 Merge "Update OWNERS info for NetworkPolicy related files." 2020-12-10 14:33:07 +00:00
Lorenzo Colitti
55ba4ffb1d Merge changes I6eb6d92b,I638e29fd,I2348b7a3 am: 435d580374 am: 55477377da am: bea9280e6e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1521657

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I430d7069e1dfbe89780cb459fff9e1eb63daa349
2020-12-10 09:18:35 +00:00