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
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
Code clean-up to use PermissionUtils for common networking
permissions. Should be a no-op.
Bug: 210485380
Test: make, flash and boot
Change-Id: I4be08243156e9d04f4b3b44ab7328d0f6f7fdda1
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
Updates to ethernet service code to validate calls to ethernet network
management APIs.
Bug: 210485380
Test: atest EthernetServiceTests
Change-Id: I66b91c6d12e6859de33760ab21bb00f1477720e8
Ethernet service related files are going to be moved into Connectivity
module. INetworkManagementService won't be visible to EthernetTracker
since it's a hidden class. Alternatively, use INetd APIs to replace
INetworkManagementService usages, including below API changes:
- mNMService.listInterfaces -> mNetd.interfaceGetList
- mNMService.getInterfaceConfig -> NetdUtils.getInterfaceConfigParcel
- remove InterfaceConfiguration usage, use NetdUtils APIs instead.
- mNMService.registerObserver -> mNetd.registerUnsolicitedEventListener
- for this API change, also replace the parameter BaseNetworkObserver
class with BaseNetdUnsolicitedEventListener class.
Bug: 210586283
Test: atest FrameworksNetTests
Test: atest EthernetServiceTests
Change-Id: Ic14c55a6a36b774006931a6fbcbfdec0c51a16e9
Stubbed API methods in EthernetServiceImpl to be used for network
management.
Bug: 210487086
Bug: 210485380
Test: make, flash and boot and atest EthernetServiceTests
Change-Id: I8bd5a6eca07d00e0f155b71e2960371989a13013
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
Ethernet service related files are going to be moved into Connectivity
mainline module. Replace the Preconditions.checkNotNull usage in
EthernetNetworkFactory with Objects.requireNonNull.
Bug: 210586283
Test: atest EthernetServiceTests
Change-Id: Ibeaf687f706e8400f825cb2ca97bb1341774a97d
Ethernet service related files are going to be moved into Connectivity
module. So, NetdService won't be visible to EthernetTracker since it's
a hidden class. Alternatively, get the INetd instance from system
service instead.
Bug: 210586283
Test: atest FrameworksNetTests
Test: atest EthernetServiceTests
Change-Id: Iea021ac25cbe4b8836fdab2cd6b4bd3ead5bf725
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
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
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
Replace them with PermissionUtils.enforceNetworkStackPermission*
since those methods are deprecated.
Bug: 177187957
Test: atest EthernetServiceTests
Change-Id: Ifde4a8898439b86e6cc49b7469787bc5e4a91835
When the EthernetNetworkAgent has already been stopped, a call to
unwanted will cause a crash due to a nullptr derefernce.
Bug: 197279734
Test: atest EthernetNetworkFactoryTest
Change-Id: Ice39c603bdd3e3139aa8ece7fb897bf7b567e74b
The requestTetheredInterface() and releaseTetheredInterface() in
EthernetManager is annotated as @NonNull. Basically, the taken
callback parameter to the service implementation should also be
@NonNull. However, it still possible to use native commands to
call the method in the aidl. If a null callback is taken, it may
cause unexpected results and cause crashes. Add a null check and
throw NPE as a warning.
Bug: 190058445
Test: adb commands
Change-Id: I18fd63aba3f7326597fc3a8c93ba8c9097bf7348
Update the naming and usgae according to API review feedback.
Bug: 184735772
Test: atest EthernetTrackerTest
Change-Id: Ie8dc0bcdf46ceebda5d6062231b48c1f63b250f6
Merged-In: Ie8dc0bcdf46ceebda5d6062231b48c1f63b250f6
Update the naming and usgae according to API review feedback.
Bug: 184735772
Test: atest EthernetTrackerTest
Change-Id: Ie8dc0bcdf46ceebda5d6062231b48c1f63b250f6
getAvailableInterfaces() will return available ethernet
interfaces which are the information about networks. So it should
enforce ACCESS_NETWORK_STATE permission check to ensure the
applications are allowed to access the information.
Bug: 174573778
Test: TetheringTests
Test: CtsTetheringTest
Change-Id: I7aaa5225d56f2feecc51ba263489ed0ce02fd651
- Use public API of StaticIpConfiguration.Builder to set
ipaddress, domains, gateway and dnsServers.
- Use public constructor to create an instance of IpConfiguration
and set IpAssignment, ProxySettings, StaticIpConfiguration and
HttpProxy by public API.
Bug: 182963415
Test: m ethernet-service
Change-Id: Idce8bfe7afc31baa644c816afa1f8004987e8c6e
Merged-In: Idce8bfe7afc31baa644c816afa1f8004987e8c6e
- Use public API of StaticIpConfiguration.Builder to set
ipaddress, domains, gateway and dnsServers.
- Use public constructor to create an instance of IpConfiguration
and set IpAssignment, ProxySettings, StaticIpConfiguration and
HttpProxy by public API.
Bug: 182963415
Test: m ethernet-service
Change-Id: Idce8bfe7afc31baa644c816afa1f8004987e8c6e
Replaced by request.canBesatisfiedBy() to avoid direct reference
of hidden member.
Bug: 182963415
Test: m ethernet-service
Test: atest EthernetServiceTests
Change-Id: I2a27410a6148c525e17a11cb1ba3570f04e60b5d
NetworkCapabilities#clearAll() is a hidden API, use clearAll()
of NetworkCapabilities.Builder instead.
Bug: 182963415
Test: m ethernet-service
Test: atest EthernetServiceTests
Change-Id: I87745b5f7a5817f95cdbc623b2313c181ff48f19
The connection service will become the mainline module.
So, need to remove the hidden API usage of NetworkRequest.
The NetworkRequest.type(TRACK_DEFAULT) is no longer sent
to the factories. So, remove the (TRACK_DEFAULT) check to
avoid using hidden API.
Bug: 170598012
Test: atest EthernetServiceTests
Change-Id: I5b5fed864318e9ac7e190c40d4f52076ab0eece8
The new specifier represents ethernet interfaces more
specifically and is part of the public API.
Bug: 179329291
Test: atest CtsNetTestCases
Merged-In: I6cba1709b3007a22d95849a1281237c77e1464a4
Change-Id: I6cba1709b3007a22d95849a1281237c77e1464a4
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
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: I31f12a39a924302beca980b8d920e3c5c18816d4