Commit Graph

478 Commits

Author SHA1 Message Date
Aaron Huang
83400b6b3b Split out the ipsec API surface and use framework-connectivity-tiramisu
(cherry picked from commit 131a866384)
Bug: 204153604
Test: TH
Change-Id: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
Merged-In: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
2022-02-10 19:01:00 +09:00
Frank Li
a531035a8c Merge "[DU03-4]Add NETWORK_STACK Permission check for NetworkStatsService API" 2022-02-10 07:11:59 +00:00
Yan Yan
321b404d92 Merge "Un-finalize IpSecManager" 2022-02-09 18:19:31 +00:00
Frank
c3c367e481 [DU03-4]Add NETWORK_STACK Permission check for NetworkStatsService API
1. getUidStatsForTransport API

Bug: 210066922
Test: atest BatteryStatsImplTest WifiPowerCalculatorTest
            MobileRadioPowerCalculatorTest NetworkStatsServiceTest
Change-Id: I022c34b5af87fe3ff6857ea264bac2f7098eaed4
2022-02-09 22:17:21 +08:00
Jean Chalard
7b00426948 Merge "Making EthernetNetworkSpecifier public" 2022-02-09 08:48:15 +00:00
Yan Yan
98a3a0381f Un-finalize IpSecManager
Allows VCN and IKE unit tests to mock IpSecManager and thus stop
depending on the hidden APIs in the Connectivity module
(e.g. IpSecService binder interface). Otherwise, any changes on
these related hidden APIs will require topic changes across multiple
projects.

Bug: 217572993
Test: make update-api
Test: atest IpSecManagerTest, IpSecManagerTunnelTest
Change-Id: I29f3ac96f83b4271f29a7051d33ccf47a0dd6c57
Merged-In: I29f3ac96f83b4271f29a7051d33ccf47a0dd6c57
2022-02-09 03:32:54 +00:00
Yan Yan
7b04f8f339 Un-finalize IpSecManager
Allows VCN and IKE unit tests to mock IpSecManager and thus stop
depending on the hidden APIs in the Connectivity module
(e.g. IpSecService binder interface). Otherwise, any changes on
these related hidden APIs will require topic changes across multiple
projects.

Bug: 217572993
Test: make update-api
Test: atest IpSecManagerTest, IpSecManagerTunnelTest
Change-Id: I29f3ac96f83b4271f29a7051d33ccf47a0dd6c57
Merged-In: I29f3ac96f83b4271f29a7051d33ccf47a0dd6c57
2022-02-09 03:32:54 +00:00
Yan Yan
34f91fc7b8 Un-finalize IpSecManager
Allows VCN and IKE unit tests to mock IpSecManager and thus stop
depending on the hidden APIs in the Connectivity module
(e.g. IpSecService binder interface). Otherwise, any changes on
these related hidden APIs will require topic changes across multiple
projects.

Bug: 217572993
Test: make update-api
Test: atest IpSecManagerTest, IpSecManagerTunnelTest
Change-Id: I29f3ac96f83b4271f29a7051d33ccf47a0dd6c57
2022-02-08 19:04:05 -08:00
James Mattis
fea7a4f5fd Making EthernetNetworkSpecifier public
Bug: 210485380
Test: atest EthernetServiceTests
atest CtsNetTestCasesLatestSdk

cherry pick of aosp/1971181

Change-Id: Ic0b7a3360745632eb024a97692e49f6c8dafa3ee
2022-02-08 15:54:49 -08:00
Frank
250b1e31d6 [MS68.3] Address comments at aosp/1958144
Test: atest TrafficStatsTest NetworkUsageStatsTest FrameworksNetTests
Bug: 204830222
Change-Id: I5a54b44294021d64d8506eeb570db0db8544472a
2022-02-08 15:12:45 +08:00
James Mattis
38252b94bd Merge "Marking eth network management APIs @SystemApi" 2022-02-07 18:38:01 +00:00
Lorenzo Colitti
889703ce18 Expose MATCH_PROXY as a module-lib API.
It is used by clockwork.

Test: m update-api
Change-Id: I5676f883141afca1511c425b7c36683a6c6bfb9f
2022-02-07 11:45:18 +09:00
Remi NGUYEN VAN
7ede3024bc Add setPollForce to module API
The API was test API in S, but this is not supported in module API
surfaces. Make it module API instead.

Bug: 197717846
Test: Tests already using this API
Change-Id: I9d44b761572f94b08b269478c4a0c20c1171343c
2022-02-07 11:45:18 +09:00
Junyu Lai
0bac7dddd7 [MS54.1] Move NetworkStats to updatable sources
This CL builds NetworkStats related code with the
connectivity module instead of platform.

This includes:
1. Add netstats.proto to the module.
2. Add lib dependencies for all callers.
3. Include several source files in platform and add jarjar rule
   to it. Modify callers accordingly.

Test: TH
Bug: 197717846
Change-Id: I244693aebe1782d9e67502638ff8145c51462e1e
2022-02-07 11:45:17 +09:00
Junyu Lai
2b01633f81 [MS62.1] Start NetworkStatsService from the module
NetworkStatsService is going to be moved into Connectivity mainlne
module and it will be not visible to SystemServiceResistry after
migration done. Thus:
1. Register service in NetworkStatsServiceInitialalizer, a separate
   initializer is needed because the service needs to be created
   before NetworkPolicyManagerService's initialization.
2. Call SystemReady at PHASE_ACTIVITY_MANAGER_READY phase where
   it needs to be ready before StatsPullAtomService pulls at
   PHASE_THIRD_PARTY_APPS_CAN_START.
3. Register manager in ConnectivityFrameworkInitializerTiramisu
   instead of SystemServiceRegistery.

Test: atest FrameworksNetTests CtsNetTestCases NetworkUsageStatsTest
Bug: 204830222
Change-Id: I95020d816ed613ce3480a0720a5b71dcdc7fab72
2022-02-07 11:45:17 +09:00
James Mattis
28547370d4 Marking eth network management APIs @SystemApi
Annotating ethernet network management APIs in EthernetManager
with @SystemApi.

Bug: 210485380
Test: atest EthernetServiceTests
atest CtsNetTestCasesLatestSdk

Change-Id: I10429441fd4d7b9bcaa7437b844420a43a415d72
Merged-In: I10429441fd4d7b9bcaa7437b844420a43a415d72
2022-02-04 17:09:34 -08:00
James Mattis
5e1593f3a6 Marking eth network management APIs @SystemApi
Annotating ethernet network management APIs in EthernetManager
with @SystemApi.

Bug: 210485380
Test: atest EthernetServiceTests
atest CtsNetTestCasesLatestSdk

Change-Id: I10429441fd4d7b9bcaa7437b844420a43a415d72
Merged-In: I10429441fd4d7b9bcaa7437b844420a43a415d72
2022-02-04 17:09:34 -08:00
James Mattis
d8d9fb13a8 Marking eth network management APIs @SystemApi
Annotating ethernet network management APIs in EthernetManager
with @SystemApi.

Bug: 210485380
Test: atest EthernetServiceTests
      atest CtsNetTestCasesLatestSdk

cherry pick of aosp/1969839

Change-Id: I10429441fd4d7b9bcaa7437b844420a43a415d72
2022-02-04 17:07:31 -08:00
James Mattis
94ed798c18 Merge "Adding permission for Ethernet Network Management" 2022-02-04 23:05:27 +00:00
James Mattis
eac7dc0e8d Merge "Adding permission for Ethernet Network Management" 2022-02-04 23:05:27 +00:00
Remi NGUYEN VAN
b029fea129 Merge "Support discovering services with a NetworkRequest" am: 7b8b3ccb8e am: 2317504e35 am: 00a4143745 am: 599b35b504
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952113

Change-Id: I7a634de94c38f1d5a03f8ebdcfb5e2aa906878a9
2022-02-04 12:55:43 +00:00
Remi NGUYEN VAN
53d5d4f67a Merge changes from topic "nsd_serviceinfo_network" am: 585b14d79c am: 2d8dd0e89c am: 50aefe8550 am: 639ae66673
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1944534

Change-Id: I35e0a36eda4c5a4cc9111bedd8d4068efa75e830
2022-02-04 12:54:31 +00:00
Remi NGUYEN VAN
1d93ed0cce Merge "Support discovering services with a NetworkRequest" 2022-02-04 12:07:58 +00:00
Remi NGUYEN VAN
7b8b3ccb8e Merge "Support discovering services with a NetworkRequest" 2022-02-04 12:07:58 +00:00
Remi NGUYEN VAN
585b14d79c Merge changes from topic "nsd_serviceinfo_network"
* changes:
  Support discover/resolve on specific networks
  NSD: Specify on what interface to getAddrInfo
2022-02-04 12:07:38 +00:00
Remi NGUYEN VAN
d4b1ac25a3 Merge changes from topic "nsd_serviceinfo_network"
* changes:
  Support discover/resolve on specific networks
  NSD: Specify on what interface to getAddrInfo
2022-02-04 12:07:38 +00:00
James Mattis
9efdbcb6c8 Merge "Adding permission for Ethernet Network Management" 2022-02-03 20:08:15 +00:00
Remi NGUYEN VAN
173a33f259 Support discovering services with a NetworkRequest
A common mistake when using service discovery is to mismanage networks,
expecting to find or be able to access services on networks that may not
be available yet, or may be stale/lost.

This new API allows clients to start service discovery with just a
NetworkRequest, letting NsdManager track networks and notify when
services are found/lost for each network.

Bug: 190249673
Test: atest NsdManagerTest
Change-Id: I12e799aa48fce2d1a35f708c5617386b1cc70f21
2022-02-03 13:04:20 +09:00
Remi NGUYEN VAN
1ddba4c56a Support discovering services with a NetworkRequest
A common mistake when using service discovery is to mismanage networks,
expecting to find or be able to access services on networks that may not
be available yet, or may be stale/lost.

This new API allows clients to start service discovery with just a
NetworkRequest, letting NsdManager track networks and notify when
services are found/lost for each network.

Bug: 190249673
Test: atest NsdManagerTest
Change-Id: I12e799aa48fce2d1a35f708c5617386b1cc70f21
2022-02-03 13:04:20 +09:00
Remi NGUYEN VAN
bca7618ded Support discover/resolve on specific networks
This adds a Network member to NsdServiceInfo, allowing discovered
services to report which network they were discovered on, and clients to
specify which network to resolve the service on. If clients use the
discovered NsdServiceInfo to resolve a service, it will be resolved on
the network where it was discovered instead of an unspecified network.

Also add a network parameter to a new overload of
NsdManager#discoverServices, so that clients can discover on specific
networks.

Bug: 190249673
Test: atest NsdManagerTest

Change-Id: Idc4bf9fde0f4b0328204a8cd2eedc12fffbbbdba
2022-02-03 13:04:08 +09:00
Remi NGUYEN VAN
23651306c3 Support discover/resolve on specific networks
This adds a Network member to NsdServiceInfo, allowing discovered
services to report which network they were discovered on, and clients to
specify which network to resolve the service on. If clients use the
discovered NsdServiceInfo to resolve a service, it will be resolved on
the network where it was discovered instead of an unspecified network.

Also add a network parameter to a new overload of
NsdManager#discoverServices, so that clients can discover on specific
networks.

Bug: 190249673
Test: atest NsdManagerTest

Change-Id: Idc4bf9fde0f4b0328204a8cd2eedc12fffbbbdba
2022-02-03 13:04:08 +09:00
James Mattis
8def132983 Adding permission for Ethernet Network Management
Adding MANAGE_ETHERNET_NETWORKS as a signature level permission
to allow an application to dynamically change ethernet network values.

Bug: 210485380
Test: atest EthernetServiceTests

cherry pick of aosp/1964543

Change-Id: Icf9c2accc86735cc981adc0d5a24802e0616ffaf
2022-02-02 19:40:59 -08:00
Aaron Huang
131a866384 Split out the ipsec API surface and use framework-connectivity-tiramisu
Bug: 204153604
Test: TH
Change-Id: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
2022-02-03 09:47:41 +09:00
James Mattis
07550b5354 Adding permission for Ethernet Network Management
Adding MANAGE_ETHERNET_NETWORKS as a signature level permission
to allow an application to dynamically change ethernet network values.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: Icf9c2accc86735cc981adc0d5a24802e0616ffaf
Merged-In: Icf9c2accc86735cc981adc0d5a24802e0616ffaf
2022-02-02 16:34:46 -08:00
James Mattis
74a5a70b6f Adding permission for Ethernet Network Management
Adding MANAGE_ETHERNET_NETWORKS as a signature level permission
to allow an application to dynamically change ethernet network values.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: Icf9c2accc86735cc981adc0d5a24802e0616ffaf
Merged-In: Icf9c2accc86735cc981adc0d5a24802e0616ffaf
2022-02-02 16:34:46 -08:00
James Mattis
ccd8ed78b5 Merge "Renaming Ethernet Network Management Classes" am: 525001eeec am: f925d9fc35 am: 9f19cd8917 am: 23a35f6722
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1965622

Change-Id: I4baf47dd0a24aafd8ae376263ad2f23741eb4f1e
2022-02-02 21:15:08 +00:00
James Mattis
a46242b7ab Renaming Ethernet Network Management Classes
Renaming InternalNetwork* files and classes related to ethernet network
management to EthernetNetwork* as ethernet is the only trasnport these
particular files are used with.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: Ieb3915c032ef5fcd6b36eb09878119de7668bb4b
2022-02-01 21:02:10 -08:00
James Mattis
1ecadfa763 Renaming Ethernet Network Management Classes
Renaming InternalNetwork* files and classes related to ethernet network
management to EthernetNetwork* as ethernet is the only trasnport these
particular files are used with.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: Ieb3915c032ef5fcd6b36eb09878119de7668bb4b
2022-02-01 21:02:10 -08:00
James Mattis
1afe437079 Merge "InternalNetworkManagementException Changes" am: 27c75f17a6 am: 53db8ea3c0 am: 226ec060c4 am: fa897dbe2c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952437

Change-Id: I1b9805f75fee091086b38f95ebd3872e98bfd879
2022-02-02 01:24:05 +00:00
James Mattis
aeb8a06c23 InternalNetworkManagementException Changes
Update to InternalNetworkManagementException in order to allow all
members to be parcelable.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I17f119a66face8a927546657490969aa3073c54b
2022-02-01 09:21:09 -08:00
James Mattis
2ed5ef560c InternalNetworkManagementException Changes
Update to InternalNetworkManagementException in order to allow all
members to be parcelable.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I17f119a66face8a927546657490969aa3073c54b
2022-02-01 09:21:09 -08:00
Lorenzo Colitti
85cb7ec628 Merge changes from topics "move-kerneltotag", "move-socket-tagging-to-mainline" am: a6bc0e1373 am: 820885090d am: a00becaa86 am: 2eaf028bae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964912

Change-Id: Ie5bdbb43340b8866dff6a68d0375ea2e065e9ba6
2022-01-31 14:39:04 +00:00
Lorenzo Colitti
a6bc0e1373 Merge changes from topics "move-kerneltotag", "move-socket-tagging-to-mainline"
* changes:
  Move socket tagging implementation to mainline.
  Move kernelToTag to NetworkStatsFactory.
2022-01-31 13:35:30 +00:00
Lorenzo Colitti
623d59f6ad Merge changes from topics "move-kerneltotag", "move-socket-tagging-to-mainline"
* changes:
  Move socket tagging implementation to mainline.
  Move kernelToTag to NetworkStatsFactory.
2022-01-31 13:35:30 +00:00
Lorenzo Colitti
81b707f491 Move socket tagging implementation to mainline.
Currently, socket tagging is implemented in the framework. The
Java code is in NetworkManagmentSocketTagger.java and the JNI is
in libandroid and loaded by the general framework JNI loader.

- Move the Java implementation to TrafficStats, which is the only
  caller of NetworkManagmentSocketTagger. This simplifies the
  code a bit because a number of methods can be deleted.

- Move the JNI code to a new JNI library in the APEX. The library
  depends only on the NDK and statically links the NDK-only
  version of libnativehelper. Its size is only 5k on ARM and 10k
  on ARM64.

- Temporarily make the framework depend on this library until the
  rest of the T connectivity code moves to the APEX.

Test: atest NetworkUsageStatsTest CtsNetTestCases:TrafficStatsTest
Change-Id: I050c7c515237f68b78d08987bc443f50a7949c06
2022-01-30 15:59:44 +09:00
Lorenzo Colitti
d2ae7390f5 Move socket tagging implementation to mainline.
Currently, socket tagging is implemented in the framework. The
Java code is in NetworkManagmentSocketTagger.java and the JNI is
in libandroid and loaded by the general framework JNI loader.

- Move the Java implementation to TrafficStats, which is the only
  caller of NetworkManagmentSocketTagger. This simplifies the
  code a bit because a number of methods can be deleted.

- Move the JNI code to a new JNI library in the APEX. The library
  depends only on the NDK and statically links the NDK-only
  version of libnativehelper. Its size is only 5k on ARM and 10k
  on ARM64.

- Temporarily make the framework depend on this library until the
  rest of the T connectivity code moves to the APEX.

Test: atest NetworkUsageStatsTest CtsNetTestCases:TrafficStatsTest
Change-Id: I050c7c515237f68b78d08987bc443f50a7949c06
2022-01-30 15:59:44 +09:00
Junyu Lai
83c7aa94b2 Merge "[MS59.3] Expose NetworkStatsDataMigrationUtils" am: 8de5088578 am: e156948ba1 am: ea3eef06bb am: 675c4de2c8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1961599

Change-Id: Ie96aa4f519816b3c76f6f9e4dc2400070f4d326b
2022-01-29 05:26:20 +00:00
junyulai
aa6eed54a7 [MS59.3] Expose NetworkStatsDataMigrationUtils
Test: TH
Bug: 204830222
Change-Id: I15a45fbadeb69b70a0e983b00de9e934d29749d6
2022-01-28 11:03:53 +00:00
junyulai
505fc639be [MS59.3] Expose NetworkStatsDataMigrationUtils
Test: TH
Bug: 204830222
Change-Id: I15a45fbadeb69b70a0e983b00de9e934d29749d6
2022-01-28 11:03:53 +00:00
Junyu Lai
a0d98ead71 Merge "[DU12]Remove NetworkType Annotation" am: 7da58cca81 am: 5a4f6f806f am: c96293258a am: ccbccf1099
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1963221

Change-Id: I25de40b8818edfdfc1b55b4b6fcb9ecf0de37d00
2022-01-27 22:54:37 +00:00