Commit graph

47,186 commits

Message SHA1
Merge "Setup permissions for SDK sandbox UIDs."
Martijn Coenen   authored and   Gerrit Code Review   commited 2022-03-18 13:35:51 +00:00
b643f2a356
Merge "Support ignoring validation failures after roam."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-03-18 03:15:49 +00:00
004cbbcdad
Merge changes from topic "ethernetmanagertest"
* changes:
  Add a CTS test for EthernetManager.InterfaceStateListener.
  Add a method to create a TAP interface without bringing it up.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-03-18 02:26:25 +00:00
14c851ccc3
Support ignoring validation failures after roam.
In some scenarios, Wi-Fi connectivity is disrupted after roam. If an application reacts to network errors by calling reportNetworkConnectivity(false), validation will immediately fail and the device will switch to cell data.

Add a way to ignore these validation failures for up to 10 seconds after Wi-Fi roams.

Bug: 216567577
Test: new unit tests

Change-Id: I58de486533bcc7c6e32b23536ae15bccb779e394

he_won.hwang   commited 2022-03-18 10:30:28 +09:00
881307a834
Merge "Revert "Change Ethernet API to use OutcomeReceiver""
Quentin Perret   authored and   Gerrit Code Review   commited 2022-03-17 15:26:19 +00:00
2789c017e6
Revert "Change Ethernet API to use OutcomeReceiver"
Revert "Change Ethernet API to use OutcomeReceiver"

Revert "Change network management listener to outcome receiver"

Revert submission 2028203-ethernet-outcomereceiver

Reason for revert: BuildMonitor investigating b/225169800
Reverted Changes:
I4c204a848:Change Ethernet API to use OutcomeReceiver
I7c46545a4:Change Ethernet API to use OutcomeReceiver
Id8fadfed9:Change network management listener to outcome rece...

Change-Id: Ibd1d70ac3fb691f9a777e59da4886ab60dc969ac

Quentin Perret   commited 2022-03-17 15:20:53 +00:00
41000c6106
Merge "Change Ethernet API to use OutcomeReceiver"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-17 13:53:18 +00:00
a8385cc593
Add a CTS test for EthernetManager.InterfaceStateListener.
Test: CtsNetTestCases:android.net.cts.EthernetManagerTest
Change-Id: Ic956b5e52575a467b405fecf142c7f25925358d4

Lorenzo Colitti   authored and   Xiao Ma   commited 2022-03-17 13:42:34 +00:00
9e560d24c2
Add a method to create a TAP interface without bringing it up.
In S, the behaviour of createTunInterface and createTapInterface
changed so that they bring up the interface before returning it.
This makes it difficult to test code that brings interfaces up
itself, such as IpClient or EthernetManager, because the tests
cannot predict whether that code will see the interface up
or not. This leads to flaky tests and can even make it impossible
to reliably test some behaviour.

Add a method that allows the caller to specify whether to bring
up the interface or not.

Test: new codepath tested by other CL in topic
Test: existing codepaths already well-covered
Change-Id: I0f7698f4dad132f201db4203e65a78c6af564ab2

Lorenzo Colitti   authored and   Xiao Ma   commited 2022-03-17 13:42:34 +00:00
333d5e52f5
Merge "Explicitly check route type in NetworkDiagnostics"
Taras Antoshchuk   authored and   Gerrit Code Review   commited 2022-03-17 11:08:50 +00:00
1c2f79705f
Change Ethernet API to use OutcomeReceiver
This change addresses API review feedback. In addition, it changes the
returned result from Network to the interface name. The current API
returning a Network object is racy and cannot be implemented correctly.
Users should instead use the ConnectivityManager#requestNetwork() API to
get hold of the Network for a given interface.

Bug: 220017952
Test: TH
Change-Id: I4c204a8489c0be006c00581d833f2bb46ae0e71d

Patrick Rohr   commited 2022-03-17 07:21:33 +01:00
ea7e6d56f4
Merge changes from topic "nullable-ipconfig"
* changes:
  Add test for nullable IpConfiguration
  Add Nullable IpConfiguration to ethernet update request
  Replace assertParcelSane with assertParcelingIsLossless

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-17 06:17:02 +00:00
1b13af010a
Add test for nullable IpConfiguration
Test: atest EthernetNetworkUpdateRequestTest
Change-Id: Ibf565d46cfac0d44976ee6187db7234bb082da41

Patrick Rohr   commited 2022-03-16 20:29:10 +01:00
fb82c3f702
Add Nullable IpConfiguration to ethernet update request
Test: atest EthernetServiceTests
Bug: 220017952
Change-Id: Icb5af11e67e397628484726ab6f69afa5d1fe7f5

Patrick Rohr   commited 2022-03-16 20:29:05 +01:00
8a910f4ecd
Rename setAccessUids to setAllowedUids
Bug: 217725769
Test: ConnectivityServiceTest CtsNetTestCases
Change-Id: Ic8a3f91553d1462b7f54259c467fb90a950bdd59
Merged-In: I8860fbb353eedf5d01e9dc248e4d765046bd562c

Chalard Jean   authored and   Sooraj Sasindran   commited 2022-03-16 17:58:20 +00:00
de665266cd
Merge "Use int array for included and excluded uids"
Sooraj Sasindran   authored and   Gerrit Code Review   commited 2022-03-16 17:56:08 +00:00
2ccbfe9d8f
Replace assertParcelSane with assertParcelingIsLossless
Per review comment on aosp/2012897.

Test: atest EthernetNetworkUpdateRequestTest
Change-Id: Ie2f21d821709cc82af9294d70826f153506fda4f

Patrick Rohr   commited 2022-03-16 17:20:36 +01:00
ceae88da2d
Merge changes from topic "ethernet_mainline"
* changes:
  Fix the NPE thrown when starting Ethernet service in OS lower than T.
  Remove the stub ethernet service from Connectivity module.
  Update hidden API files for EthernetManager API move.
  Provide a stub ethernet service to build in sc-mainline-prod.
  Build ethernet framework source into framework-connectivity-tiramisu

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-16 16:03:30 +00:00
6dde8ac532
Merge "[DU04-4]Appropriate changes to the NetworkPolicyManager API"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-16 12:28:24 +00:00
cd9fe9b220
Merge "Ensure SpiUnavailableException was thrown because of duplicate SPI"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-03-16 08:36:28 +00:00
ef716bcb94
Merge "Add a carrier config to block tethering."
Tom Hsu   authored and   Gerrit Code Review   commited 2022-03-16 07:26:39 +00:00
1c12d0790e
Use int array for included and excluded uids
Use int array for included and excluded uids so that uses
same data type as in PreferentialNetworkServiceConfig

Bug: 217365439
Test: ran connectivity service unit tests
Change-Id: I9ac7e6498df2fd20b8397b2c110296e019c7389e

Sooraj Sasindran   commited 2022-03-16 07:19:11 +00:00
4904176454
Add a carrier config to block tethering.
When KEY_CARRIER_SUPPORTS_TETHERING_BOOL=false, it will behave as if
entitlement check failed and a system notifcation shows up if user
tries to turn on tethering from Settings UI.

Bug: 161206517
Test: manual
Change-Id: I78da390ecb0c8f4f68285ef16da80653f136c11e

Meng Wang   authored and   tom hsu   commited 2022-03-16 12:40:24 +08:00
a84bb2d8ba
[DU04-4]Appropriate changes to the NetworkPolicyManager API
Divide the NetworkPolicyManager API
notifyStatsProviderWarningOrLimitReached into the following two APIs:
1. notifyStatsProviderWarningReached()
2. notifyStatsProviderLimitReached()

Bug: 216474563
Test: atest NetworkStatsServiceTest NetworkPolicyManagerTest
            NetworkPolicyManagerServiceTest OffloadControllerTest
Change-Id: I473b8b677d492a7076e63f445b3a3be24d25e14d

Frank   commited 2022-03-16 12:23:34 +08:00
9ff8eb1829
Fix the NPE thrown when starting Ethernet service in OS lower than T.
Bug: 210586283
Bug: 223993229
Test: m
Merged-In: I5b61643cf99681e4db56468401e8670f90f9257e
Change-Id: If2c74bd5ed53fc571697145041413cbb85482177

Xiao Ma   commited 2022-03-16 03:25:25 +00:00
799d000c9f
Remove the stub ethernet service from Connectivity module.
The stub ethernet service lib will be useless after removing all legacy
dependencies on ethernet-service.jar, so delete it from Connectivity
module as well.

Bug: 210586283
Test: m
Merged-In: Ica60df1140bf3f7345e61d642c9e9b706602c50b
Change-Id: Iadd1d6a4046a8960ec35f5d51ae5dc2f42eb3bfb

Xiao Ma   commited 2022-03-16 02:25:28 +00:00
1bc5454f41
Update hidden API files for EthernetManager API move.
Test: m
Bug: 210586283
Merged-In: I995c81f9bcfdd57c37f679878b6973d3de739803
Change-Id: I5f8c35a225cad94c87b00f7523497d145d335a13

Xiao Ma   commited 2022-03-16 02:09:25 +00:00
885acf0abc
Merge "Rename setUidForeground to noteUidForeground"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-03-15 23:33:26 +00:00
8b7896b51a
Merge "API review: Additional comment for QosSession."
Sewook Seo   authored and   Gerrit Code Review   commited 2022-03-15 10:10:27 +00:00
c8fadc5cde
Setup permissions for SDK sandbox UIDs.
Applications may have an additional SDK sandbox process that should run
with the same network policy as the app itself. There is a 1:1 mapping
between appId and the SDK sandbox process that belongs to it; use that
mapping to set the same policy for SDK sandbox processes as for the app
that they belong to.

Bug: 215012578
Test: atest com.android.server.PermissionMonitorTest
Change-Id: Ibd2ada09c94d46e048f5731b90a721d8e85d3289

Martijn Coenen   commited 2022-03-15 10:06:39 +01:00
3f01be0407
Merge "Add a NetworkAgent API to indicate that a network will be replaced."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-03-15 04:44:16 +00:00
9f6e6c4e27
Provide a stub ethernet service to build in sc-mainline-prod.
This CL also creates a fake ethernet-service.jar to ensure that
targets that depend on ethernet-service do not break.
Because ethernet-service.jar is on the system server classpath,
these classes cannot be in the com.android.server.ethernet
package, otherwise ConnectivityServiceInitializer will load
them instead of the real classes.

Test: m
Bug: 210586283
Merged-In: I6a4a0dc68233d4229d1cae4e5b196e287ef2ed5b
Change-Id: I591dcaf0fe6303cffa15aa0b869e429c626dc887

Lorenzo Colitti   authored and   Xiao Ma   commited 2022-03-14 14:06:58 +00:00
1050a077ba
Build ethernet framework source into framework-connectivity-tiramisu
- move ethernet APIs, build it into framework-connectivity-tiramisu
- start ethernet service from ConnectivityServiceInitializer
- fix EthernetManager dependnecy in Tethering module
- fix EthernetNetworkSpecifier dependency in framework-connectivity
- fix the ethernet related config resource

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I54857b8517649048a343c72797668394d5225766
Merged-In: I54857b8517649048a343c72797668394d5225766

Xiao Ma   commited 2022-03-14 14:06:35 +00:00
0a171c006c
Add a NetworkAgent API to indicate that a network will be replaced.
This is useful for link layers that disconnect but know they will
reconnect to a similar network soon, and do not want the device
to switch to another network until the reconnect happens. An
example is wifi switching to another network that is on a
different subnet without the device switching to cellular data.

This works by immediately destroying the network, so the link
layer can reuse the same interface name for the new network. It
would be possible to delay destroying the network until the new
network connects, but in practice this does not seem useful,
because the if the link layer reuses the interface, then the
interface will be undergoing reconfiguration, and will likely
not be usable for app traffic.

This CL also moves the call to onNetworkDestroyed into
destroyNativeNetwork. This is needed to ensure that the new
API calls onNetworkDestroyed even though most teardown
operations have not happened. This causes onNetworkDestroyed to
happen before the netId is marked free, but that shouldn't cause
any behavioural changes because netId allocation is an
implementation detail of ConnectivityService and is not
observable by apps or system components.

Bug: 216567577
Test: builds, boots
Test: atest FrameworksNetTests FrameworksNetIntegrationTests
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCases:android.net.cts.NetworkAgentTest#testDestroyAndAwaitReplacement
Change-Id: I9f9e022fef66b31a29cce560413321075e992756

Lorenzo Colitti   commited 2022-03-14 21:52:37 +09:00
ffa2ed3d1c
Ensure SpiUnavailableException was thrown because of duplicate SPI
SpiUnavailableException.getSpi() is public API so it should be tested.

Test: CtsNetTestCases:IpSecManagerTest
Change-Id: I68856b80b0ec819b0603dfe0a06ff813be3c5dda

Aaron Huang   commited 2022-03-14 20:06:59 +08:00
3c6cc0c4e1
Merge "Rename "service-nearby" to "service-nearby-pre-jarjar""
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-03-14 09:07:43 +00:00
bcf3b1b58b
Merge "Rename redactNetworkCapabilitiesForPackage and update its javadoc"
Lucas Lin   authored and   Gerrit Code Review   commited 2022-03-14 08:05:08 +00:00
ba61dca57c
Merge "[DU09-3]Modify the NetworkStatsCollection Builder API"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-14 02:36:08 +00:00
3f5703df80
Merge changes I5af6ce96,Ibc1f6813
* changes:
  Refactor make{Tether4Key, Tether4Value ConntrackEvent} helper
  BpfCoordinatorTest: refactor upstream and downstream setup functions

Nucca Chen   authored and   Gerrit Code Review   commited 2022-03-11 18:05:14 +00:00
3938102448
API review: Additional comment for QosSession.
Additional comment on getSessionId in QosSession.

Bug: 216368595
Test: build
Change-Id: I0575253ef490e3d456e69816d52075c2d10813f0

sewookseo   authored and   Sewook Seo   commited 2022-03-10 22:28:15 +00:00
5f703feca1
Merge "Use U32 from shared library"
Mark Chien   authored and   Gerrit Code Review   commited 2022-03-10 16:27:33 +00:00
98502b78bc
Merge "Add test coverage for NetworkStats.Bucket#getRoaming()"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-03-10 12:14:10 +00:00
23f5e54efa
Rename setUidForeground to noteUidForeground
Addresses API review feedback. Both setUidForeground in
NetworkStatsManager and NetworkStatsService are renamed to
noteUidForeground. Thus, the caller in test should be also
modified.

Bug: 222291301
Test: atest FrameworksNetTests
Change-Id: Ifa1e1af3d9fd8b1dc75a8f37947a5958f60ed415

Aaron Huang   commited 2022-03-10 18:33:50 +08:00
5417280f17
Merge "Add DisableConfigSyncTargetPreparer to CTS/MTS"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-03-10 09:34:00 +00:00
2aae895972
Rename "service-nearby" to "service-nearby-pre-jarjar"
Change-Id: I99ef6ee39e89f99b0878909e2d1f2962df513d1a
Test: unit test
Bug: 217115866
Merged-In: I80c8538372659a04145178fcc8e1af98e78e3681

Remi NGUYEN VAN   commited 2022-03-10 04:32:19 +00:00
b6cde3d2dc
Merge "cts: Re-launch the desired activity after screen-on on TVs."
Ross Yeh   authored and   Gerrit Code Review   commited 2022-03-10 01:13:37 +00:00
422c7dd460
Merge "Add test for EthernetNetworkUpdateRequest"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-09 09:16:29 +00:00
6758a5dfff
Add test coverage for NetworkStats.Bucket#getRoaming()
Bug: 217771804
Test: CtsNetTestCases
Change-Id: I16778488540476c2d1e77378a020c548eb894f0a
Merged-In: I16778488540476c2d1e77378a020c548eb894f0a

Aaron Huang   commited 2022-03-09 08:42:40 +00:00
fdbe9847a9
Use U32 from shared library
There is U32 added in frameworks/libs/net. Use shared one to avoid
duplicated code.

Bug: 215095957
Test: m
Change-Id: I861bc2f65ea947a908de2ec83e9b137d3342c8ce

markchien   commited 2022-03-09 15:05:16 +08:00
22c1a3aa1f
Merge "Split updateMeteredNetwork{Allow, Deny}List into add and remove"
Mark Chien   authored and   Gerrit Code Review   commited 2022-03-09 05:00:58 +00:00
cc29690fc1