Commit Graph

3796 Commits

Author SHA1 Message Date
Aaron Huang
286f4e2c88 Merge "Fix proto invalid write type" 2022-03-22 12:18:39 +00:00
Patrick Rohr
4e6570c359 Merge "Revert^2 "Change Ethernet API to use OutcomeReceiver"" 2022-03-22 10:00:08 +00:00
Remi NGUYEN VAN
8d0fa1c2ad Merge "Add Executors to NSD callbacks" 2022-03-22 08:33:48 +00:00
Remi NGUYEN VAN
c7aa9e3c62 Add Executors to NSD callbacks
Add Executor variants to all methods with callbacks.

Bug: 218752665
Test: atest NsdManagerTest
Change-Id: I4c31e2d7ae601ea808b1fd64df32d116c6fff97f
2022-03-18 09:26:11 +00:00
Patrick Rohr
d6156a930e Revert^2 "Change Ethernet API to use OutcomeReceiver"
369c79bca4

Merged-In: I7c46545a47034be409071c2ec007d9e1480c6ed0
Change-Id: If9b055e0862755f1d33b5ba6e026fd827bc1d0ea
2022-03-18 12:06:27 +08:00
Quentin Perret
369c79bca4 Revert "Change Ethernet API to use OutcomeReceiver"
Revert "Change network management listener to outcome receiver"

Revert submission 2028203-ethernet-outcomereceiver

Reason for revert: BuildMonitor investigating b/225169800
Reverted Changes:
I4c204a848:Change Ethernet API to use OutcomeReceiver
I7c46545a4:Change Ethernet API to use OutcomeReceiver
Id8fadfed9:Change network management listener to outcome rece...

Change-Id: I45af594f7233ed89113f4cf7f977092271980672
2022-03-17 15:20:53 +00:00
Patrick Rohr
cf01b8a4f7 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: I7c46545a47034be409071c2ec007d9e1480c6ed0
2022-03-17 08:20:45 +01:00
Patrick Rohr
746d082279 Add Nullable IpConfiguration to ethernet update request
This is not currently used by anyone, but will allow us to only update
NetworkCapabilities in the future. This could be useful for testing.

Test: atest EthernetServiceTests
Bug: 220017952
Change-Id: I9697399bad2bfe66c6f328064be75f4dfa10af81
2022-03-16 20:28:45 +01:00
Patrick Rohr
112f3762bb Merge "Split out the ethernet API surface and use framework-connectivity-t" 2022-03-16 16:03:30 +00:00
Frank Li
62bfe3e882 Merge "[DU04-2]Appropriate changes to the NetworkPolicyManager API" 2022-03-16 12:28:24 +00:00
Frank
b9bacae1fc [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
2022-03-16 14:23:50 +08:00
Lorenzo Colitti
2a4a56b004 Merge "Rename setUidForeground to noteUidForeground" 2022-03-15 23:33:26 +00:00
Aaron Huang
1b60475d2b Merge "Let docs tool to list the newly-visible IntDef values" 2022-03-15 03:55:41 +00:00
Xiao Ma
dbc8e0fb2b Split out the ethernet API surface and use framework-connectivity-t
Ethernet framework and service source code is going to be moved to
Connectivity mainline module, this CL contains below corresponding
changes to adapt the migration in f/b side:

1. Split out ethernet module-lib APIs to Connectivity module.
   Add the ethernet resource filegroup to tiramisu-updatable-sources
   filegroup as well, build them together. Also update the module-lib
   and system api txt to reflect the APIs change. Remove the hidden
   APIs which are moved to Connectivity module. This removal fixes the
   api inconsistent issue with Tethering/apex/hidden/.

2. Remove EthernetService from SystemServer which will be registered
   from ConnectivityServiceInitializer.

3. Replace the BackgroundThread class(imported from f/b/core/java)
   with the one in the modules-utils-backgroundthread lib, which is
   visible to Connectivity module.

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I3e13cb9c0e348333af295c2537d459aa6700ff17
Merged-In: I1956848d3248cc56e9841d221e5e4c160bed65a4
2022-03-14 13:47:01 +00:00
Frank Li
96189e9851 Merge "[DU09-2]Modify the NetworkStatsCollection Builder API" 2022-03-14 02:36:08 +00:00
Aaron Huang
0619e29450 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
2022-03-11 01:28:59 +08:00
Aaron Huang
cdc5fe2b2b 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
2022-03-10 18:31:21 +08:00
Xiao Ma
2560006257 Merge "Remove restriction that limits updateConfiguration API to Auto" 2022-03-10 03:40:54 +00:00
Patrick Rohr
5ba470eded 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
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
Patrick Rohr
0a4236d08b Fix log message when failing to open bpf maps
s/create/open/

Test: TH
Change-Id: I7fd1b280ab15aaa0757cfb3afcc20bf377a3bcef
2022-03-08 08:38:05 +00:00
Xin Li
6342a7f58a Merge "Merge Android 12L" 2022-03-08 06:55:02 +00: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
markchien
5ccdf994d6 Remove ConnectivityManager swapActiveStatsMap API
swapActiveStatsMap is temporary added for the NetworkStatsFactory to
call BpfNetMaps#swapActiveStatsMap in tethering mainline module. Now
NetworkStatsFactory already be mainlined, calling BpfNetMaps#swapActiveStatsMap
directly.

Bug: 218494448
Test: atest ConnectivityCoverageTests
      atest FrameworksNetTests
Change-Id: I25618020c078c7de3f0036c48d06d7816a431f62
2022-03-07 12:35:48 +08:00
Frank Li
fe46e4531c Merge "[MS68.3] Address comments at aosp/1958144" am: ef6f50b007
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1964907

Change-Id: Idd8ef239098fe5806d099e9392662479dfedebbc
2022-03-03 02:54:44 +00:00
Frank Li
ef6f50b007 Merge "[MS68.3] Address comments at aosp/1958144" 2022-03-03 02:26:53 +00:00
Frank Li
05b51067c8 Merge "[SUBID01-0]Grow NetworkIdentity to include a new mSubId field" am: 9de9a8b2de
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1894970

Change-Id: I8000c63c159d50d032853abb91723eab20da1e0a
2022-03-02 12:55:30 +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
0c63b854e1 Merge "[DU03-4]Add NETWORK_STACK Permission check for NetworkStatsService API" am: 2da74e0820
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2004530

Change-Id: I8808a5ae604d0533385e8200d7b06ef43017d21a
2022-03-02 08:20:49 +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
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
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
James Mattis
0b41b8bc5c Merge "Updating Eth Update Request to use Builder" am: fbb8986a58
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991011

Change-Id: I27f21050ab836c812f7fa353fa77a81c839fcde5
2022-02-28 17:12:47 +00:00
James Mattis
fbb8986a58 Merge "Updating Eth Update Request to use Builder" 2022-02-28 16:55:49 +00:00
Lorenzo Colitti
783122a228 Merge changes from topic "ms52-movenetstats" am: 46d003e258
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1987470

Change-Id: I20304b5f7dcf214ff4cc7da0cb142d2b3fd57211
2022-02-28 06:27:14 +00:00
Remi NGUYEN VAN
b899488eda Add setPollForce to module API am: 6dff4abc88
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1987469

Change-Id: Icc0825a99853b565c31f9718d6bd4850408b067d
2022-02-28 06:27:10 +00:00
Remi NGUYEN VAN
8b9258125c Move networkstats JNI to connectivity module am: a24baedab8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1987468

Change-Id: Icae9025ce53eca8a6636037f3baf7a6c17e5a5da
2022-02-28 06:26:56 +00:00
Junyu Lai
0f5560ac9e [MS54.1] Move NetworkStats to updatable sources am: 6313e5506b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1987467

Change-Id: I97311b503c0f959ed98199c89c6a7b657ab8be43
2022-02-28 06:26:49 +00:00
Junyu Lai
085ed25ed1 [MS62.1] Start NetworkStatsService from the module am: 0858a12f92
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1987466

Change-Id: I1f72e7f3fbcb64052e90a10bc2869076fc9ecea7
2022-02-28 06:26:36 +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
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
Aaron Huang
c4f95e136a Merge "Check iface by TextUtils.equals" am: 6b1e9e63cb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1946587

Change-Id: Id8fc2d7463688eab87259a310492d6a5c02c8a7a
2022-02-22 11:30:00 +00:00
Aaron Huang
6b1e9e63cb Merge "Check iface by TextUtils.equals" 2022-02-22 09:48:08 +00:00
Maciej Żenczykowski
94b0f2ff81 Merge "Fix system_server crash while iterating CookieTagMap" am: dd5a31eb2d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1990333

Change-Id: I04bd616a62ba77219c0ae812d2337e474b1fe2c2
2022-02-19 22:03:23 +00:00
markchien
c4cfd83ad4 Fix system_server crash while iterating CookieTagMap
When uid is removed, NetworkStatsService will iterate CookieTagMap and
delete the corresponded uid socketTag value. But not only
NetworkStatsService would detete CookieTagMap entries. There are other
threads may also delete CookieTagMap entries such as #unTagSocket in
bpfHandler and desctroy socket listener in TrafficController. System
server crash as NPE because the CookieTagMap entry it iterate just be
removed by other threads at the same time. This is just a simple fix to
prevent the crash. Will have follow up CL for formal fix.

Bug: 220084230
Test: m
Change-Id: I08cad87f537fb09499faf1ff5cfd443fcb8ce436
2022-02-18 10:11:15 +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
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
a24baedab8 Move networkstats JNI to connectivity module
Reorganize networkstats JNI so it can be included in the connectivity
module.

Bug: 197717846
Test: m
Change-Id: I815ea379f3d9915041c80ac5e743ce62e05f4cf8
Merged-In: I815ea379f3d9915041c80ac5e743ce62e05f4cf8
2022-02-18 16:20:47 +08:00