Commit Graph

478 Commits

Author SHA1 Message Date
Patrick Rohr
8e718745d0 Merge "Allowing for null net caps in updateConfiguration" am: adec6f861f am: 834e5611bc am: 7ff0565c1b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2008515

Change-Id: I7ca6c1a999e5d59c72ee60d52561c3c9fa252169
2022-03-09 10:59:50 +00:00
Patrick Rohr
5ba470eded Merge "Allowing for null net caps in updateConfiguration" 2022-03-09 09:16:29 +00:00
Patrick Rohr
adec6f861f Merge "Allowing for null net caps in updateConfiguration" 2022-03-09 09:16:29 +00:00
Patrick Rohr
d1dccf83fc Remove restriction that limits updateConfiguration API to Auto
Test: TH
Change-Id: Ibd1b6493778b98fc765e6eebdfe8f9c1fef29a73
2022-03-08 16:13:48 +00:00
Patrick Rohr
faa9fe86b6 Remove restriction that limits updateConfiguration API to Auto
Test: TH
Change-Id: Ibd1b6493778b98fc765e6eebdfe8f9c1fef29a73
2022-03-08 16:13:48 +00:00
James Mattis
6869c411fc 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
2022-03-08 16:50:35 +01:00
James Mattis
db3007caca 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
2022-03-08 16:50:35 +01:00
Aaron Huang
cf97f22cdc Fix proto invalid write type
While dumpProtoLocked is called, InvalidProtocolBufferException
occurred because types are mismatched between platform side and
module side.

netstats.proto was moved into connectivity module, both the
platform(incident.proto) and the module uses protoc-gen-javastream
to generate the Java classes from it. It should be fine since
platform includes the source of the proto, and jarjar the generated
classess in the module to avoid conflict with platform.

Bug: 218566849
Test: adb shell incident 3001
      adb shell dumpsys netstats --proto
      atest CtsIncidentHostTestCases:IncidentdTest#testIncidentReportDumpAuto
Change-Id: I4654350a59dc1ca1a925785ad37f34aa7b481235
Merged-In: I4654350a59dc1ca1a925785ad37f34aa7b481235
2022-03-07 08:44:25 +00:00
Frank
1e0da21bfe [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
2022-03-07 16:28:55 +08:00
Frank
fd5dcd2dd9 [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
2022-03-07 16:28:55 +08:00
Aaron Huang
5fbd57eab4 Fix proto invalid write type
While dumpProtoLocked is called, InvalidProtocolBufferException
occurred because types are mismatched between platform side and
module side.

netstats.proto was moved into connectivity module, both the
platform(incident.proto) and the module uses protoc-gen-javastream
to generate the Java classes from it. It should be fine since
platform includes the source of the proto, and jarjar the generated
classess in the module to avoid conflict with platform.

Bug: 218566849
Test: adb shell incident 3001
      adb shell dumpsys netstats --proto
      atest CtsIncidentHostTestCases:IncidentdTest#testIncidentReportDumpAuto
Change-Id: I4654350a59dc1ca1a925785ad37f34aa7b481235
Merged-In: I4654350a59dc1ca1a925785ad37f34aa7b481235
2022-03-04 06:39:30 +00:00
Frank Li
ef6f50b007 Merge "[MS68.3] Address comments at aosp/1958144" 2022-03-03 02:26:53 +00:00
Frank Li
0cc12cf02d Merge "[MS68.3] Address comments at aosp/1958144" 2022-03-03 02:26:53 +00:00
Frank Li
9de9a8b2de Merge "[SUBID01-0]Grow NetworkIdentity to include a new mSubId field" 2022-03-02 12:26:11 +00:00
Frank Li
9a74429f56 Merge "[SUBID01-0]Grow NetworkIdentity to include a new mSubId field" 2022-03-02 12:26:11 +00:00
lifr
7c9fde88d6 [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
2022-03-02 11:20:09 +08:00
lifr
2bdae7d6e4 [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
2022-03-02 11:20:09 +08:00
Frank
e20ff88e34 [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
2022-03-02 03:05:53 +08:00
Frank
5f93cdff5a [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
2022-03-02 03:05:53 +08:00
Frank
350414997d [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
2022-03-02 02:30:51 +08:00
Frank
5c3fa07cc1 [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
2022-03-02 02:30:51 +08:00
James Mattis
c22df9d3b0 Merge "Updating Eth Update Request to use Builder" am: e5fd971d2e am: 3fb1f8adab am: be7ea07ec8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991011

Change-Id: Idf1b3a44c21886540230cae43ec30035024a74c5
2022-02-28 21:22:52 +00:00
James Mattis
fbb8986a58 Merge "Updating Eth Update Request to use Builder" 2022-02-28 16:55:49 +00:00
James Mattis
e5fd971d2e Merge "Updating Eth Update Request to use Builder" 2022-02-28 16:55:49 +00:00
Lorenzo Colitti
46d003e258 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
2022-02-28 05:32:23 +00:00
Lorenzo Colitti
ca25ad3567 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
2022-02-28 05:32:23 +00:00
James Mattis
aa2202c220 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
2022-02-24 13:38:04 -08:00
James Mattis
420d6e09c9 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
2022-02-24 13:38:04 -08:00
Aaron Huang
d24637842e Merge "Check iface by TextUtils.equals" am: 213018b736 am: cf11f77e11 am: 0eb1037a53
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1946587

Change-Id: Ifc4eb584382781de9ab5e4304357012d95660f66
2022-02-22 12:20:40 +00:00
Aaron Huang
6b1e9e63cb Merge "Check iface by TextUtils.equals" 2022-02-22 09:48:08 +00:00
Aaron Huang
213018b736 Merge "Check iface by TextUtils.equals" 2022-02-22 09:48:08 +00:00
Lorenzo Colitti
8868c1ef52 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
2022-02-18 16:20:48 +08:00
Lorenzo Colitti
fe5ed721be 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
2022-02-18 16:20:48 +08:00
Remi NGUYEN VAN
6dff4abc88 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
2022-02-18 16:20:47 +08:00
Remi NGUYEN VAN
c99a128f51 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
2022-02-18 16:20:47 +08:00
Junyu Lai
6313e5506b [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
2022-02-18 16:20:47 +08:00
Junyu Lai
63627bce56 [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
2022-02-18 16:20:47 +08:00
Junyu Lai
0858a12f92 [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
2022-02-18 16:20:47 +08:00
Junyu Lai
01a87ca336 [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
2022-02-18 16:20:47 +08:00
Treehugger Robot
9c0ae7058c Merge "Fix grammar nit in comment." am: 5870ba5ace am: 03ac8973c3 am: 0169e9a372
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1981670

Change-Id: I0f624e52c718eb24a64b901343ca1faafb3ad0a2
2022-02-16 16:09:10 +00:00
Lorenzo Colitti
6c032e53a0 Fix grammar nit in comment.
Test: None
Change-Id: I60cb2478615efce13f1904092abe5c21bdf0dc9a
2022-02-11 18:50:04 +09:00
Lorenzo Colitti
c54e4f397b Fix grammar nit in comment.
Test: None
Change-Id: I60cb2478615efce13f1904092abe5c21bdf0dc9a
2022-02-11 18:50:04 +09:00
Xiao Ma
7f9ac50065 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
2022-02-11 18:50:04 +09:00
Xiao Ma
11170dd9ef 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
2022-02-11 18:50:04 +09:00
Frank Li
b3015d7ac7 Merge "[SUBID01-0]Grow NetworkIdentity to include a new mSubId field" 2022-02-11 06:19:49 +00:00
James Mattis
81cab05410 Making EthernetNetworkSpecifier public
Bug: 210485380
Test: atest EthernetServiceTests
atest CtsNetTestCasesLatestSdk

Change-Id: Ic0b7a3360745632eb024a97692e49f6c8dafa3ee
Merged-In: Ic0b7a3360745632eb024a97692e49f6c8dafa3ee
2022-02-10 11:25:18 -08:00
James Mattis
ca0be94009 Making EthernetNetworkSpecifier public
Bug: 210485380
Test: atest EthernetServiceTests
atest CtsNetTestCasesLatestSdk

Change-Id: Ic0b7a3360745632eb024a97692e49f6c8dafa3ee
Merged-In: Ic0b7a3360745632eb024a97692e49f6c8dafa3ee
2022-02-10 11:25:18 -08:00
lifr
2c266fbc3b [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
Change-Id: Ie1fe81006555dbcca4b62457fa6c319f04b4576d
2022-02-10 22:49:05 +08:00
Xiao Ma
29cf58992d 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
2022-02-10 20:53:55 +09:00
Aaron Huang
b944ff1540 Split out the ipsec API surface and use framework-connectivity-tiramisu
(cherry picked from commit 1dad7aa006492035293e68080aeaf606df02618a)
Bug: 204153604
Test: TH
Change-Id: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
Merged-In: I6cc8aef6a0ab9ce4bcef2797196b1d1b3687acca
2022-02-10 19:01:00 +09:00