Commit Graph

220 Commits

Author SHA1 Message Date
Patrick Rohr
50c470e308 Address EthernetManager javadoc review comments
Test: TH
Change-Id: Iafa8979d8e96ea4d078b017e56ee61334d33b5f5
2022-04-04 14:59:42 +02:00
Patrick Rohr
0f2cbe92f1 Update javadoc to match expectation for UnsupportedOperationException
Test: builds
Change-Id: I44eac15972ed099fc12599a78a71557a7b16d593
2022-04-04 14:59:42 +02:00
Remi NGUYEN VAN
0395b70000 Use Sources.bp for building
Reference Sources.bp from Android.bp, so that they are used as build
files.

Sources.bp is separate from Android.bp as it was migrated from the
Android.bp files in the old code location. They can be merged into the
main Android.bp file (or removed by removing the filegroups) after the
migration is done.

Also remove references to the AIDL filegroups, as files are now merged
into the common framework/aidl-export directory which is used as include
directory for aidl source generation already, so they do not need to be
referenced separately. framework/aidl-export can contain AIDLs for S-
API classes that became updatable API in T (the contents of
framework-t), as they are the same as any other API class for the
purposes of AIDL code generation: it's OK for any S+ code to reference
S+ API classes.

Finally, fix reference to mByteStream in IpConfigStoreTest. It was
already wrong but did not break the build because the test was not being
built in the old location.

Bug: 222234190
Test: TH
Merged-In: I81893df9f327abb84f1561b2b33027a2d23a4d65
Merged-In: I67c703e3f7aa9d5787f032a79ed62e45412baf4f
Change-Id: I9093f9ae2f9d76e597f20de48680e459891755b4
2022-03-25 14:58:43 +00:00
Remi NGUYEN VAN
700ffc994f Merge history of ConnectivityT
Renamed files/directories:
ConnectivityT/service/Android.bp --> service-t/Sources.bp
ConnectivityT/framework-t/Android.bp --> framework-t/Sources.bp
ConnectivityT/framework-t/aidl-export --> framework/aidl-export
ConnectivityT/service --> service-t
ConnectivityT/framework-t --> framework-t
ConnectivityT/tests --> tests
ConnectivityT/OWNERS --> (removed)

BUG: 222234190
TEST: TH
Ignore-AOSP-First: Move with history done per-branch
Merged-In: I81893df9f327abb84f1561b2b33027a2d23a4d65
Merged-In: I67c703e3f7aa9d5787f032a79ed62e45412baf4f
Change-Id: I27a91f1a94f9d807f92762436f533c4b0d0114d5
2022-03-25 11:02:45 +00:00
Patrick Rohr
e38626a4a2 Merge "Add getInterfaceList module-lib API in EthernetManager." 2022-03-24 06:15:43 +00:00
Patrick Rohr
f7c4dcaaf4 Merge "Update the module-lib API txt with getInterfaceList api." 2022-03-24 06:15:43 +00:00
Patrick Rohr
95738f7c18 Merge "Fix ethernet enable / disable API" 2022-03-24 06:09:28 +00:00
Patrick Rohr
04f9843d32 Merge "Fix ethernet enable / disable API" 2022-03-24 06:09:28 +00:00
Xiao Ma
bdfed34bbc Update the module-lib API txt with getInterfaceList api.
Bug: 171872016
Test: m
Merged-In: I16c69aa0d236036a600bdae9fb8326ff70fd4fda
Change-Id: I1ee2ad76b4950906516fae7328785b8c583f7adb
2022-03-23 15:18:24 +00:00
markchien
e1cde2694f Update the module-lib API txt with setEthernetEnable API
Bug: 171872016
Test: atest EthernetServiceTests
Change-Id: I61c5209f50ab62327b75813804bde1aa1a014054
Merged-In: I61c5209f50ab62327b75813804bde1aa1a014054
2022-03-23 17:02:14 +08:00
Xiao Ma
1edd4554e5 Add getInterfaceList module-lib API in EthernetManager.
Bug: 171872016
Test: m
Merged-In: Ib0e6c8f67c6ded7d17bb9e0ff49e7ff495c8819d
Change-Id: I94fd147d0f8cf09cb7445fd2b5bc8e4528e8390e
2022-03-22 13:59:40 +00:00
markchien
5912ab6906 Add setEthernetEnabled and its listener API
Bug: 171872016
Test: atest EthernetServiceTests

Merged-In: Iefd24d955572589c5bd3ca9a8139ea6e44979e8a
Change-Id: Iefd24d955572589c5bd3ca9a8139ea6e44979e8a
2022-03-22 13:58:14 +00:00
Aaron Huang
286f4e2c88 Merge "Fix proto invalid write type" 2022-03-22 12:18:39 +00:00
Patrick Rohr
3879cf1a78 Fix ethernet enable / disable API
The ethernet APIs connectNetwork() / disconnectNetwork() are
inaccurately named. Physical link state cannot be changed by calling an
API. This change renames these functions to enableInterface and
disableInterface, respectively, to better reflect their intention and
behavior.

Test: atest EthernetManagerPermissionTest
Merged-In: I3361ad0e01e761ffd77faf6c55924fa4612ede90
Change-Id: I3361ad0e01e761ffd77faf6c55924fa4612ede90
2022-03-22 12:12:48 +00:00
Patrick Rohr
a873f582a1 Fix ethernet enable / disable API
The ethernet APIs connectNetwork() / disconnectNetwork() are
inaccurately named. Physical link state cannot be changed by calling an
API. This change renames these functions to enableInterface and
disableInterface, respectively, to better reflect their intention and
behavior.

Test: atest EthernetManagerPermissionTest
Merged-In: I0f2866d09b745e7bdb261a1258f94cfd51223a8f
Change-Id: I0f2866d09b745e7bdb261a1258f94cfd51223a8f
2022-03-22 10:00:50 +00:00
Patrick Rohr
a68fba1659 Merge "Revert^2 "Change Ethernet API to use OutcomeReceiver"" 2022-03-22 10:00:08 +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
b58df4bf13 Merge "Add executors to NsdManager" 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
2cef8f1314 Revert^2 "Change Ethernet API to use OutcomeReceiver"
41000c6106

Merged-In: I4c204a8489c0be006c00581d833f2bb46ae0e71d
Change-Id: I42f5ca159db523f85903c411c4a4838eb324c5ad
2022-03-18 12:11:51 +08: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
Quentin Perret
41000c6106 Revert "Change Ethernet API to use OutcomeReceiver"
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: Ibd1d70ac3fb691f9a777e59da4886ab60dc969ac
2022-03-17 15:20:53 +00:00
Remi NGUYEN VAN
59145dc7f8 Add executors to NsdManager
Add executors to APIs added in T, and overloads with Executors for
consistency to register/resolve.

Bug: 218752665
Test: atest NsdManagerTest
Change-Id: I9d89ea8352aa8274a90bf6cb273d5b45828f53cc
2022-03-17 11:01:56 +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
ea7e6d56f4 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: I4c204a8489c0be006c00581d833f2bb46ae0e71d
2022-03-17 07:21:33 +01:00
Patrick Rohr
8a910f4ecd Add Nullable IpConfiguration to ethernet update request
Test: atest EthernetServiceTests
Bug: 220017952
Change-Id: Icb5af11e67e397628484726ab6f69afa5d1fe7f5
2022-03-16 20:29:05 +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
Patrick Rohr
6dde8ac532 Merge changes from topic "ethernet_mainline"
* changes:
  Fix the NPE thrown when starting Ethernet service in OS lower than T.
  Remove the stub ethernet service from Connectivity module.
  Update hidden API files for EthernetManager API move.
  Provide a stub ethernet service to build in sc-mainline-prod.
  Build ethernet framework source into framework-connectivity-tiramisu
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
Lorenzo Colitti
8b7896b51a 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
0a171c006c Build ethernet framework source into framework-connectivity-tiramisu
- move ethernet APIs, build it into framework-connectivity-tiramisu
- start ethernet service from ConnectivityServiceInitializer
- fix EthernetManager dependnecy in Tethering module
- fix EthernetNetworkSpecifier dependency in framework-connectivity
- fix the ethernet related config resource

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I54857b8517649048a343c72797668394d5225766
Merged-In: I54857b8517649048a343c72797668394d5225766
2022-03-14 14:06:35 +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
5417280f17 Rename setUidForeground to noteUidForeground
Addresses API review feedback. Both setUidForeground in
NetworkStatsManager and NetworkStatsService are renamed to
noteUidForeground. Thus, the caller in test should be also
modified.

Bug: 222291301
Test: atest FrameworksNetTests
Change-Id: Ifa1e1af3d9fd8b1dc75a8f37947a5958f60ed415
2022-03-10 18:33:50 +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
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
349fadfa52 [DU09-3]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: I8919ed595c2d339e8a5c0fc163b3c40edb4a2ad8
2022-03-07 16:31:26 +08: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 Li
ef6f50b007 Merge "[MS68.3] Address comments at aosp/1958144" 2022-03-03 02:26:53 +00:00