Commit Graph

24 Commits

Author SHA1 Message Date
James Mattis
5aa01c3196 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: I5be8543afd70f2edca76a9366cee4ccf61f0d0e7
2022-02-01 21:11:05 -08:00
James Mattis
9b9952ebe1 Implementation of Eth Connect & Disconnect Network
Implementation of EthernetService APIs for ConnectNetwork() and
DisconnectNetwork().

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I4c3e361d052206cb28b97fc439bfeac8e7e0fec0
2022-02-01 21:10:18 -08:00
James Mattis
724a0aea08 Updates so Network Mgmt Callbacks Are Sent
Updates so that network management API updates in the ethernet stack can
handle concurrent requests correctly in regards to notifying caller
supplied callbacks.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I8073251b2c63309da031c2b1c98d61614deadfe8
2022-01-27 14:43:20 -08:00
Pavan Kumar M
b63e7aebee Synchronize the IpClient events
If the ipClient is stopped before handling the events in
Handler thread, ethernet network factory might end up
creating a network agent for a network which is already
cleared.

This change fixes the issue by handling the events only
if ipClient is initialized.

Tests:

  Builds, Boots, EthernetNetworkFactoryTest.
  Ethernet related test scenarios

Bug: 207057937
Change-Id: If7ff7abf5f0dcdb0e94de0502bfdf981f9f20298
2022-01-13 11:52:06 +05:30
James Mattis
7f0823c15f Implementation of Eth Service updateConfiguration
EthernetServiceImpl#updateConfiguration API implementation to allow
for dynamically updating the network capability or ip configuration of
an ethernet based interface.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: Idd3b7875a24643d245d0f4bb6f2f4c459898116e
2022-01-11 19:13:26 -08:00
James Mattis
cfa7a08bcf Replacing IIpClient with Manager in ethNetFactory
Replacing IIpClient with IpClientManager to reduce code duplication,
increase readability and maintainability as well as making
EthernetNetworkFactory easier to unit test.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I283653171c0cc47ad94a67d6dbd65b924cdf1ada
2022-01-05 16:12:16 -08:00
James Mattis
18ed8f6680 Code cleanup on EthernetNetworkFactoryTest
Code cleanup on EthernetNetworkFactoryTest.

Bug: 210485380
Test: atest EthernetServiceTests:
com.android.server.ethernet.EthernetNetworkFactoryTest

Change-Id: I38c568d0760e4273f1ca8540bac268f07876b67f
2022-01-05 15:49:33 -08:00
James Mattis
a5f724dfdd Changes to make eth service methods more testable
Updates to make methods in EthernetServiceImpl that rely on
EthernetTracker unit testable. This CL also includes added tests for
such methods in EthernetServiceImplTest.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I63969b60cc4cf9d391e2cd21d02e1bdc8988aba8
2022-01-05 14:59:56 -08:00
James Mattis
cc1dac61b3 Eth Service updates to validate net mgmt calls
Updates to ethernet service code to validate calls to ethernet network
management APIs.

Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I66b91c6d12e6859de33760ab21bb00f1477720e8
2022-01-05 13:50:42 -08:00
Xiao Ma
3a26d1b8ed Import InterfaceParams class from f/libs/net/common.
Ethernet service related files are going to be moved into Connectivity
mainline module. Import InterfaceParams class in EthernetNetworkFactory
from f/libs/net/common, which is visible to Connectivity module.

Bug: 210586283
Test: atest EthernetServiceTests
Change-Id: I98ebb04cc3c2b685464e7f2689424794957088b3
2021-12-21 08:06:07 +00:00
Pavan Kumar M
e600bef8f9 Handle neighbor lost event
Neighbor lost event is received when gateway is not reachable.
Ethernet Factory currently doesn't handle the neighbor lost event and
network will not be brought down. This results in loss of
connectivity even if there are other networks like WiFi.

Restart NetworkInterfaceState when neighbor lost event is
received. If there is a better network like WiFi, it will become
default and apps will be able to use internet. If ethernet gets
connected again, and has backhaul connectivity, it will become
default.

Bug: 180077540
Tests: Builds, Boots, EthernetServiceTests
Change-Id: I26d720994ecb35f6529358a53e115091e7817c2f
2021-12-15 22:56:06 +05:30
James Mattis
2fc1c08cb5 Adding test coverage for eth transport overrides
Added test coverage regarding how EthernetTracker consumes the xml
config as set in config_ethernet_interfaces. Additionally, adding
test coverage for transport override functionality in
EthernetNetworkFactory.

Bug: 206170402
Test: atest com.android.server.ethernet.EthernetTrackerTest
&& atest com.android.server.ethernet.EthernetNetworkFactoryTest

Change-Id: I3d55a230d3f28154ed6fdac6d63ed57bf589d3bd
2021-12-07 16:43:33 -08:00
James Mattis
68c4a5108b Removing unused int network score from eth factory
Hard coded network scores are no longer used however they still exist
in EthernetNetworkFactory. This change removes this unused code in
favor of the NetworkScore object.

Bug: 209679953
Test: m && atest com.android.server.ethernet.EthernetNetworkFactoryTest

Change-Id: Ic9035964fc0e0bdf1dbd1ee845ba3293c753dd8d
2021-12-07 16:38:05 -08:00
Patrick Rohr
e78e8828d6 Add Tests for EthernetNetworkFactory
Test: atest EthernetNetworkFactoryTest
Bug: 191635995
Change-Id: I1c07bb6d30706c4e13002eb402fadfecb97b36d1
2021-07-28 14:22:41 +02:00
Chiachang Wang
bbd8b43c93 Replace clearAll with withoutDefaultCapabilities in NC#Builder
Update the naming and usgae according to API review feedback.

Bug: 184735772
Test: atest EthernetTrackerTest
Change-Id: Ie8dc0bcdf46ceebda5d6062231b48c1f63b250f6
Merged-In: Ie8dc0bcdf46ceebda5d6062231b48c1f63b250f6
2021-05-14 10:36:56 +00:00
Chiachang Wang
58e0c49c2e Remove hidden connectivity methods usage in ethernet test
Bug: 182859030
Test: atest EthernetTrackerTest
Test: 1. remove framework-connectivity.impl from framework bp
      2. cd frameworks/opt/net/ethernet/tests ; mm
Change-Id: Ifaeebfca75dc77eec30dd722ddb3166610795b26
2021-04-14 16:31:37 +08:00
lifr
89f2f50aee [CS07]Remove hidden API usage of NetworkCapabilities
The connection service will become the mainline module. The mutable
NetworkCapabilities is deprecated, and the NetworkCapabilities should
be built through their Builder instead.

Bug: 170598012
Test: atest EthernetServiceTests
Change-Id: I09661ddda24d652ed791a7c6b093541e20a15e77
2021-03-05 16:45:48 +08:00
Bob Badour
7909a21be4 [LSC] Add LOCAL_LICENSE_KINDS to frameworks/opt/net/ethernet
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  tests/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I9e5f4513d6a737c8e31639babd7a4e6342968214
2021-02-16 04:09:57 -08:00
lucaslin
e81b053c1f Fix EthernetTrackerTest#createNetworkCapabilities
aosp/1307433 added NET_CAPABILITY_NOT_ROAMING,
NET_CAPABILITY_NOT_CONGESTED and NET_CAPABILITY_NOT_SUSPENDED
for ethernet but forgot to run and modify EthernetTrackerTest.
Follow aosp/1307433 to add NET_CAPABILITY_NOT_ROAMING,
NET_CAPABILITY_NOT_CONGESTED and NET_CAPABILITY_NOT_SUSPENDED for
ethernet in test when verifying the network capabilities of
ethernet.

Bug: 177782157
Test: atest EthernetServiceTests
Change-Id: I32c596b1b7726c47818460ea646bf5e346825887
2021-01-26 07:12:28 +00:00
Sal Savage
ea26baf9ff Update comments and documentation in net type prop change
Bug: b/112588045
Test: atest EthernetServiceTests --verbose
Test: kitchensink, dumpsys ethernet, with RPi devices and USB to
      ethernet adapters.

Change-Id: Iaa260aabbbd7aa4b7864eba32ecff7e3f84123c3
2019-03-25 14:11:20 -07:00
Brett Chabot
e9eff7a450 Migrate frameworks/opt/net/ethernet to androidx.test
See go/jetpack-test-android-migration

Test: compile
Change-Id: I20fc49dd2487af2245f060454e7f32f5e9145a9c
2019-03-05 09:10:36 -08:00
Sal Savage
d3a5c0404c Allow network transport type override
Bug: b/112588045
Test: atest EthernetServiceTests --verbose
Test: kitchensink with RPi devices connected by USB -> Ethernet
      adapters. Edit config.xml to try different tranport
      overrides manually. Use dumpsys ethernet to show final
      final network scores.
Change-Id: I482e78a76d06c9c090aa6816db14bb346eb6528b
2019-01-15 11:56:50 -08:00
Colin Cross
4da7fda56b Convert frameworks/opt/net/ethernet to Android.bp
See build/soong/README.md for more information.

Test: m checkbuild
Test: atest EthernetServiceTests
Change-Id: Ic9243ae7719a25a8749d63a5dcac7ec5adffe303
2018-08-16 21:52:37 -07:00
Pavel Maltsev
8d5e3e989a Add missing features to static IP config
In addition to IP address, OEMs should be able to set gateway, DNS and
domains.

Bug: 80090920
Test: runtest -x frameworks/opt/net/ethernet/tests

Cherry picked without conflicts.

Merged-in: I4e3d51a6955d7bfe5ca4e8079936ea10c28832e4
(cherry picked from commit e28118d0c3)

Change-Id: Ia8f095fbbcd414c070be4d5ce79dbc70bb9b1937
2018-05-31 11:51:07 -07:00