Commit graph

47,170 commits

Message SHA1
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
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
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
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
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
Split updateMeteredNetwork{Allow, Deny}List into add and remove
Split the updateXXX methods into an addXXX and removeXXX instead of using
a boolean parameter to indicate whether the uid should be added or removed

Bug: 218494748
Test: atest FrameworksNetTests
Change-Id: I868cf35c8f51b25d8719e618c6c48a5cd642da7f

markchien   commited 2022-03-09 11:17:27 +08:00
e46042b833
Merge changes from topic "start_nearby_cp"
* changes:
  Add try/catch, shim in Nearby initialization
  Add stub NearbyService
  Start Nearby from Connectivity ServiceInitializer

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-03-09 01:39:50 +00:00
a3f45ecdff
Add test for EthernetNetworkUpdateRequest
Test: atest EthernetNetworkUpdateRequest
Change-Id: I2aeacca81f07cf2d73814d20fc9e63e9f1a65843

Patrick Rohr   commited 2022-03-08 16:29:43 +01:00
30d33f4ee3
Add try/catch, shim in Nearby initialization
The try/catch allows using a stub NearbyService on branches that do not
support it yet.

Also update Context.NEARBY_SERVICE to ConstantsShim to be compatible
with all branches.

Bug: 189355156
Test: boots
Change-Id: I7db0035b0d9ada79f00d6ef1ac5b54b2e98489d0

Remi NGUYEN VAN   commited 2022-03-08 10:33:32 +00:00
46d7ddb725
Merge "Merge Android 12L"
Xin Li   authored and   Gerrit Code Review   commited 2022-03-08 06:55:42 +00:00
e6953d54a5
Merge "Remove ConnectivityManager swapActiveStatsMap API"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-03-08 06:31:23 +00:00
5635d505e0
Merge changes Id5f5bdfc,I67b9f30b
* changes:
  [CLATJ#32] ClatCoordinator: untag clat raw socket
  [CLATJ#31] ClatCoordinator: tag raw socket to uid AID_CLAT

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-03-08 00:47:17 +00:00
984c39992c
Merge "BpfHandler: only allow to tag INET/INET6 socket"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-03-08 00:44:59 +00:00
70d1026b6d
Merge Android 12L
Bug: 222710654
Merged-In: I03636e6b8b4dc200fcb039b99190759bc7d5e776
Change-Id: Ib9fccbbe6b6ace0a4ecddc8b84f7244e465b83b6

Xin Li   commited 2022-03-08 00:19:47 +00:00
f08c6c060f
Merge "Using common apex_defaults for com.android.tethering module." am: 6802eadef5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2007756

Change-Id: I03636e6b8b4dc200fcb039b99190759bc7d5e776

Gurpreet Singh   authored and   Automerger Merge Worker   commited 2022-03-07 17:56:53 +00:00
3acad24476
Merge "Using common apex_defaults for com.android.tethering module."
Gurpreet Singh   authored and   Gerrit Code Review   commited 2022-03-07 17:32:37 +00:00
6802eadef5
Merge "Don't attempt to enable rate-limiting before T." am: 33f4e14073
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2010337

Change-Id: If26026f57421c51eb34f38c82229fd524b734299

Treehugger Robot   authored and   Automerger Merge Worker   commited 2022-03-07 16:17:40 +00:00
23037308c6
Merge "Don't attempt to enable rate-limiting before T."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-03-07 15:51:32 +00:00
33f4e14073
Merge "Remove dead code in BpfNetMaps." am: e06458378d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2008696

Change-Id: I1d44c652972e43f6598fcb231bdc538e3836a046

Mark Chien   authored and   Automerger Merge Worker   commited 2022-03-07 15:44:27 +00:00
1e048b4432
Merge "Remove dead code in BpfNetMaps."
Mark Chien   authored and   Gerrit Code Review   commited 2022-03-07 15:19:25 +00:00
e06458378d