Commit graph android_packages_modules_Co.../framework-t/src/android
Message SHA1
Merge "[DU04-2]Appropriate changes to the NetworkPolicyManager API"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-16 12:28:24 +00:00
73c476d79d
[DU04-2]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: Ic413eb532b5e24d4a7e2afabdcf643ab6607b1ed

Frank   commited 2022-03-16 14:23:50 +08:00
6e429bec00
Merge "Rename setUidForeground to noteUidForeground"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-03-15 23:33:26 +00:00
8d52f75d38
Merge "Let docs tool to list the newly-visible IntDef values"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-03-15 03:55:41 +00:00
583be3615a
Merge "[DU09-2]Modify the NetworkStatsCollection Builder API"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-14 02:36:08 +00:00
23599d75af
Let docs tool to list the newly-visible IntDef values
Some *_ALL constants are exposed in T and they should be mentioned
in documentation. Because there are already defined InDef values
for this kind of constants. Thus, remove the list in the javadoc
and leave these up to the doc tool to list the InDef values.

Bug: 222291452
Test: m doc-comment-check-docs
Change-Id: Ibbaee5389a85bb3d696a518deea0897845553bfa

Aaron Huang   commited 2022-03-11 01:28:59 +08:00
d695111dc9
Rename setUidForeground to noteUidForeground
This patch addresses API review about the naming of
NetworkStatsManager#setUidForeground and it would be
more appropriate to rename it to noteUidForeground.

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

Aaron Huang   commited 2022-03-10 18:31:21 +08:00
e6c13a7dd0
Merge "Remove restriction that limits updateConfiguration API to Auto"
Xiao Ma   authored and   Gerrit Code Review   commited 2022-03-10 03:40:54 +00:00
1bb1076d6e
Merge "Allowing for null net caps in updateConfiguration"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-09 09:16:29 +00:00
adec6f861f
Remove restriction that limits updateConfiguration API to Auto
Test: TH
Change-Id: Ibd1b6493778b98fc765e6eebdfe8f9c1fef29a73

Patrick Rohr   commited 2022-03-08 16:13:48 +00:00
faa9fe86b6
Allowing for null net caps in updateConfiguration
Marking NetworkCapabilities as nullable in updateConfiguration and
updating where needed to support this. This will allow callers of the
ethernet network management updateConfiguration API to use it primarily
for setting an ethernet network's IP configuration.

Bug: 222565654
Bug: 220017952
Bug: 210485380
Test: atest EthernetNetworkUpdateRequestTest

Change-Id: I1f80e950acbd078a6b3378e1fa5f1e4173112e79

James Mattis   authored and   Patrick Rohr   commited 2022-03-08 16:50:35 +01:00
db3007caca
[DU09-2]Modify the NetworkStatsCollection Builder API
1. Adding the bucketDuration with unit as bucketDurationmillis
2. make the Key class be final
3. The Key set parameter be marked with an IntDef

Bug: 220153505
Test: atest NetworkStatsCollectionTest
Change-Id: Iab32b8fc129b77d6786c2f1f2339e515f2eb55f7

Frank   commited 2022-03-07 16:28:55 +08:00
fd5dcd2dd9
Merge "[MS68.3] Address comments at aosp/1958144"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-03 02:26:53 +00:00
0cc12cf02d
Merge "[SUBID01-0]Grow NetworkIdentity to include a new mSubId field"
Frank Li   authored and   Gerrit Code Review   commited 2022-03-02 12:26:11 +00:00
9a74429f56
[SUBID01-0]Grow NetworkIdentity to include a new mSubId field
In the previous design of NSS and NPMS, those only had IMSI to identify
the cell network. Now the telephony has created the "subId" handle,
which is the preferred mechanism for identifying subscribers.

This commit adds NetworkStats support for subscriberId as a part of
the network identity key

Bug: 80526261
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
            NetworkStatsServiceTest NetworkIdentityTest
            NetworkStatsDataMigrationUtilsTest

 (cherry-picked from ag/16825721)

Change-Id: Ie1fe81006555dbcca4b62457fa6c319f04b4576d
Merged-In: Ie1fe81006555dbcca4b62457fa6c319f04b4576d

lifr   authored and   Frank   commited 2022-03-02 11:20:09 +08:00
2bdae7d6e4
[MS68.3] Address comments at aosp/1958144
Test: atest TrafficStatsTest NetworkUsageStatsTest FrameworksNetTests
Bug: 204830222

(cherry-picked from ag/16813003)

Change-Id: I5a54b44294021d64d8506eeb570db0db8544472a
Merged-In: I5a54b44294021d64d8506eeb570db0db8544472a

Frank   commited 2022-03-02 03:05:53 +08:00
5f93cdff5a
[DU03-4]Add NETWORK_STACK Permission check for NetworkStatsService API
1. getUidStatsForTransport API

Bug: 210066922
Test: atest BatteryStatsImplTest WifiPowerCalculatorTest
            MobileRadioPowerCalculatorTest NetworkStatsServiceTest

(cherry-picked from ag/16816095)

Change-Id: I022c34b5af87fe3ff6857ea264bac2f7098eaed4
Merged-In: I022c34b5af87fe3ff6857ea264bac2f7098eaed4

Frank   commited 2022-03-02 02:30:51 +08:00
5c3fa07cc1
Merge "Updating Eth Update Request to use Builder"
James Mattis   authored and   Gerrit Code Review   commited 2022-02-28 16:55:49 +00:00
e5fd971d2e
Merge changes from topic "ms52-movenetstats"
* changes:
  Expose MATCH_PROXY as a module-lib API.
  Add setPollForce to module API
  Move networkstats JNI to connectivity module
  [MS54.1] Move NetworkStats to updatable sources
  [MS62.1] Start NetworkStatsService from the module

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-28 05:32:23 +00:00
ca25ad3567
Updating Eth Update Request to use Builder
Updating EthernetNetworkUpdateRequest to use a builder for
creation and also changing to use IpConfiguration instead of
StaticIpConfiguration.

Bug: 220017952
Bug: 210487893
Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I78b002c12cf927c075671b75f0fe0d7878443b56

James Mattis   commited 2022-02-24 13:38:04 -08:00
420d6e09c9
Merge "Check iface by TextUtils.equals"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-02-22 09:48:08 +00:00
213018b736
Expose MATCH_PROXY as a module-lib API.
It is used by clockwork.

Test: m update-api
  (cherry-picked from ag/16786203)
Change-Id: I5676f883141afca1511c425b7c36683a6c6bfb9f
Merged-In: I5676f883141afca1511c425b7c36683a6c6bfb9f

Lorenzo Colitti   authored and   junyulai   commited 2022-02-18 16:20:48 +08:00
fe5ed721be
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
  (cherry-picked from ag/16780943)
Change-Id: I9d44b761572f94b08b269478c4a0c20c1171343c
Merged-In: I9d44b761572f94b08b269478c4a0c20c1171343c

Remi NGUYEN VAN   authored and   junyulai   commited 2022-02-18 16:20:47 +08:00
c99a128f51
[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
Merged-In: I244693aebe1782d9e67502638ff8145c51462e1e

Junyu Lai   authored and   junyulai   commited 2022-02-18 16:20:47 +08:00
63627bce56
[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
  (cherry-picked from ag/16688794)
Change-Id: I95020d816ed613ce3480a0720a5b71dcdc7fab72
Merged-In: I95020d816ed613ce3480a0720a5b71dcdc7fab72

Junyu Lai   authored and   junyulai   commited 2022-02-18 16:20:47 +08:00
01a87ca336
Fix grammar nit in comment.
Test: None
Change-Id: I60cb2478615efce13f1904092abe5c21bdf0dc9a

Lorenzo Colitti   commited 2022-02-11 18:50:04 +09:00
c54e4f397b
Expose EthernetManager state and control APIs.
This CL exposes EthernetManager APIs that settings and other
system components can use to modify and monitor Ethernet state.
The new APIs are similar to the existing @hide methods but
pass on more information and meet API guidelines:

1. Add an InterfaceStateListener interface, and
   addInterfaceStateListener and removeInterfaceStateListener
   methods that meet API guidelines (e.g., take Executor, take
   SAM parameter last, etc.) This new listener passes interface
   state (absent, up, down), role (client or server) and IP
   configuration.
2. Implement the legacy Listener type as a subinterface of the
   new interface. Hopefully existing callers should be able to
   use it unchanged.
3. Expose setIncludeTestInterfaces as module-lib api instead of
   TestApi, since modules cannot expose TestApi methods.

Bug: 210586283
Test: m
Test: atest EthernetServiceTests
Test: atest EthernetTetheringTest
Change-Id: I88240a546ab51d128ed83775499f2bcabab74db0
Merged-In: I88240a546ab51d128ed83775499f2bcabab74db0

Xiao Ma   authored and   Lorenzo Colitti   commited 2022-02-11 18:50:04 +09:00
11170dd9ef
Making EthernetNetworkSpecifier public
Bug: 210485380
Test: atest EthernetServiceTests
atest CtsNetTestCasesLatestSdk

Change-Id: Ic0b7a3360745632eb024a97692e49f6c8dafa3ee
Merged-In: Ic0b7a3360745632eb024a97692e49f6c8dafa3ee

James Mattis   commited 2022-02-10 11:25:18 -08:00
ca0be94009
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

Aaron Huang   authored and   Lorenzo Colitti   commited 2022-02-10 19:01:00 +09:00
83400b6b3b
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

Yan Yan   commited 2022-02-09 03:32:54 +00:00
7b04f8f339
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

James Mattis   commited 2022-02-04 17:09:34 -08:00
5e1593f3a6
Merge "Adding permission for Ethernet Network Management"
James Mattis   authored and   Gerrit Code Review   commited 2022-02-04 23:05:27 +00:00
eac7dc0e8d
Merge "Support discovering services with a NetworkRequest"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-02-04 12:07:58 +00:00
7b8b3ccb8e
Merge changes from topic "nsd_serviceinfo_network"
* changes:
  Support discover/resolve on specific networks
  NSD: Specify on what interface to getAddrInfo

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-02-04 12:07:38 +00:00
585b14d79c
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

Remi NGUYEN VAN   commited 2022-02-03 13:04:20 +09:00
1ddba4c56a
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

Remi NGUYEN VAN   commited 2022-02-03 13:04:08 +09:00
bca7618ded
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

James Mattis   commited 2022-02-02 16:34:46 -08:00
74a5a70b6f
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

James Mattis   commited 2022-02-01 21:02:10 -08:00
a46242b7ab
InternalNetworkManagementException Changes
Update to InternalNetworkManagementException in order to allow all
members to be parcelable.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I17f119a66face8a927546657490969aa3073c54b

James Mattis   commited 2022-02-01 09:21:09 -08:00
aeb8a06c23
Merge changes from topics "move-kerneltotag", "move-socket-tagging-to-mainline"
* changes:
  Move socket tagging implementation to mainline.
  Move kernelToTag to NetworkStatsFactory.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-01-31 13:35:30 +00:00
a6bc0e1373
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

Lorenzo Colitti   commited 2022-01-30 15:59:44 +09:00
81b707f491
[MS59.3] Expose NetworkStatsDataMigrationUtils
Test: TH
Bug: 204830222
Change-Id: I15a45fbadeb69b70a0e983b00de9e934d29749d6

junyulai   authored and   Junyu Lai   commited 2022-01-28 11:03:53 +00:00
aa6eed54a7
[DU12]Remove NetworkType Annotation
Bug: 216619447
Test: atest NetworkTemplateTest NetworkStatsCollectionTest
            NetworkStatsSubscriptionsMonitorTest
Change-Id: I58689201a684f581a4b88df058a5e0683da61926

Frank   commited 2022-01-27 22:28:20 +08:00
de9b4def5f
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

Aaron Huang   commited 2022-01-27 12:27:20 +08:00
1618171b38
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

Aaron Huang   commited 2022-01-27 12:23:56 +08:00
0bfd365a4f
Merge "Use public resouce in android.R package"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-01-26 15:01:32 +00:00
17a9e07870
Merge "[MS74] Expose NetworkTemplate#matches"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-26 11:33:29 +00:00
4f6a232bb4
[MS78.1] Fix NetworkIdentity#Builder crashing on 5G NSA networks
Test: atest NetworkIdentityTest
Fix: 216193400
Change-Id: Iaeae0c66f222ae8730439c5aedf5d5818855875d

Junyu Lai   commited 2022-01-26 07:35:47 +00:00
ce3dbdb741
[MS74] Expose NetworkTemplate#matches
This is used by NetworkPolicyManagerService to find
relevant networks of a given NetworkPolicy.

Test: TH
Bug: 204830222
Change-Id: I7176ab727bf208e0fd05ecb9c2bcb00cd3438031

junyulai   commited 2022-01-26 01:38:44 +08:00
ad252f8347
Merge "[DU09-0]Adding the NetworkStatsCollection Builder"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-01-25 16:44:16 +00:00
b6ac084831