Commit Graph

552 Commits

Author SHA1 Message Date
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
Frank
de9b4def5f [DU12]Remove NetworkType Annotation
Bug: 216619447
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
            NetworkStatsSubscriptionsMonitorTest
Change-Id: I58689201a684f581a4b88df058a5e0683da61926
2022-01-27 22:28:20 +08:00
Frank
a522e3ddd1 [DU12]Remove NetworkType Annotation
Bug: 216619447
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
            NetworkStatsSubscriptionsMonitorTest
Change-Id: I58689201a684f581a4b88df058a5e0683da61926
2022-01-27 22:28:20 +08:00
Aaron Huang
e1d6dd86bc Merge "Move the implement of getAllCollapsedRatTypes to StatsPullAtomService" am: e48ca58c47 am: b40701ed97 am: c4e0256170 am: 224765ee63
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1960191

Change-Id: Ic11bb6f312b1d8296b57e8cf5ebd6c04bdaac0f6
2022-01-27 09:30:26 +00:00
Aaron Huang
4cef553adb Merge "Move NETWORK_TYPE_5G_NSA from NetworkTemplate to NetworkStatsManager" am: 75ed57cd6a am: b679307a1c am: de1b970194 am: 788636b582
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1960190

Change-Id: I29e941b328b84986e1ef4a9fcfcce932c86ce69a
2022-01-27 09:29:49 +00:00
Aaron Huang
1618171b38 Move the implement of getAllCollapsedRatTypes to StatsPullAtomService
To make data usage as a mainline module, move getAllCollapsedRatTypes
to StatsPullAtomService since currently it is the only user. Also, the
method needs to call getCollapsedRatType, thus move getCollapsedRatType
to NetworkStatsManager and expose it as module API.

Bug: 210073043
Test: builds, FrameworksNetTests
Change-Id: Ibe41b50f173464694c21dd22841552bdb69a6a14
2022-01-27 12:27:20 +08:00
Aaron Huang
8117e4bbfb Move the implement of getAllCollapsedRatTypes to StatsPullAtomService
To make data usage as a mainline module, move getAllCollapsedRatTypes
to StatsPullAtomService since currently it is the only user. Also, the
method needs to call getCollapsedRatType, thus move getCollapsedRatType
to NetworkStatsManager and expose it as module API.

Bug: 210073043
Test: builds, FrameworksNetTests
Change-Id: Ibe41b50f173464694c21dd22841552bdb69a6a14
2022-01-27 12:27:20 +08:00
Aaron Huang
0bfd365a4f Move NETWORK_TYPE_5G_NSA from NetworkTemplate to NetworkStatsManager
Move NETWORK_TYPE_5G_NSA to NetworkStatsManager. Also expose it as
module API so that it can be used out of module.

Bug: 210073043
Test: builds, FrameworksNetTests
Change-Id: I670c7e1405107bbe30b92fe1a8d81652c46de6d9
2022-01-27 12:23:56 +08:00
Aaron Huang
7a41918fa5 Move NETWORK_TYPE_5G_NSA from NetworkTemplate to NetworkStatsManager
Move NETWORK_TYPE_5G_NSA to NetworkStatsManager. Also expose it as
module API so that it can be used out of module.

Bug: 210073043
Test: builds, FrameworksNetTests
Change-Id: I670c7e1405107bbe30b92fe1a8d81652c46de6d9
2022-01-27 12:23:56 +08:00
Aaron Huang
17a9e07870 Merge "Use public resouce in android.R package" 2022-01-26 15:01:32 +00:00
Aaron Huang
e065c41cdf Merge "Use public resouce in android.R package" 2022-01-26 15:01:32 +00:00
Treehugger Robot
09b7c0ae16 Merge "[MS74] Expose NetworkTemplate#matches" am: 4f6a232bb4 am: 946b17a690 am: c0fc627917 am: d596b16156
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1960186

Change-Id: Id1d9b54c7e359f893c3f155760a4b750a704e224
2022-01-26 12:40:36 +00:00
Treehugger Robot
4f6a232bb4 Merge "[MS74] Expose NetworkTemplate#matches" 2022-01-26 11:33:29 +00:00
Treehugger Robot
2e88e9aac7 Merge "[MS74] Expose NetworkTemplate#matches" 2022-01-26 11:33:29 +00:00
Treehugger Robot
9f9c02a359 Merge "[MS78.1] Fix NetworkIdentity#Builder crashing on 5G NSA networks" am: e73b1c2270 am: dfc48164f3 am: a088975530 am: 3aed030c7e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1958896

Change-Id: Ib3df7b938ec24b07e9fc6649ab13c3035b1f5cba
2022-01-26 11:25:50 +00:00
Junyu Lai
ce3dbdb741 [MS78.1] Fix NetworkIdentity#Builder crashing on 5G NSA networks
Test: atest NetworkIdentityTest
Fix: 216193400
Change-Id: Iaeae0c66f222ae8730439c5aedf5d5818855875d
2022-01-26 07:35:47 +00:00
Junyu Lai
9a61a18103 [MS78.1] Fix NetworkIdentity#Builder crashing on 5G NSA networks
Test: atest NetworkIdentityTest
Fix: 216193400
Change-Id: Iaeae0c66f222ae8730439c5aedf5d5818855875d
2022-01-26 07:35:47 +00:00
Junyu Lai
350eca2910 Merge "[DU09-0]Adding the NetworkStatsCollection Builder" am: b6ac084831 am: a6c7dd6df0 am: 41e14bee2e am: d72265b4e1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1956982

Change-Id: I037367b61971930d397eeb1044c8dbb5087f07e4
2022-01-25 17:43:24 +00:00
Junyu Lai
770bdc232b Merge "[MS69.1] Fix TrafficStats.init crashs for supplemental process" am: a6889ec04f am: 498a92aac8 am: e1bf1d894d am: c1878210d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1959129

Change-Id: I965b8795a738419d2f9e3759f04d29d3e64174ca
2022-01-25 17:41:05 +00:00
junyulai
ad252f8347 [MS74] Expose NetworkTemplate#matches
This is used by NetworkPolicyManagerService to find
relevant networks of a given NetworkPolicy.

Test: TH
Bug: 204830222
Change-Id: I7176ab727bf208e0fd05ecb9c2bcb00cd3438031
2022-01-26 01:38:44 +08:00
junyulai
a47e4001ac [MS74] Expose NetworkTemplate#matches
This is used by NetworkPolicyManagerService to find
relevant networks of a given NetworkPolicy.

Test: TH
Bug: 204830222
Change-Id: I7176ab727bf208e0fd05ecb9c2bcb00cd3438031
2022-01-26 01:38:44 +08:00
Junyu Lai
b6ac084831 Merge "[DU09-0]Adding the NetworkStatsCollection Builder" 2022-01-25 16:44:16 +00:00
Junyu Lai
fd58681122 Merge "[DU09-0]Adding the NetworkStatsCollection Builder" 2022-01-25 16:44:16 +00:00
Junyu Lai
a6889ec04f Merge "[MS69.1] Fix TrafficStats.init crashs for supplemental process" 2022-01-25 16:26:34 +00:00
Junyu Lai
ce9178e863 Merge "[MS69.1] Fix TrafficStats.init crashs for supplemental process" 2022-01-25 16:26:34 +00:00
Junyu Lai
d0437973a6 Merge "[MS68.1] Register usage callback from NetworkPolicyManagerService" am: 0534b453bc am: 4531d6630b am: 1fa0cb1ed0 am: 2ab01da081
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1958144

Change-Id: I88866a6211c5105d23123757d505011dcab29d3d
2022-01-25 14:44:27 +00:00
Junyu Lai
0534b453bc Merge "[MS68.1] Register usage callback from NetworkPolicyManagerService" 2022-01-25 13:30:57 +00:00