OSDN Git Service

Declare support for Ethernet if the service is running.
authorLorenzo Colitti <lorenzo@google.com>
Thu, 24 Aug 2017 13:35:10 +0000 (22:35 +0900)
committerLorenzo Colitti <lorenzo@google.com>
Wed, 27 Sep 2017 04:03:10 +0000 (13:03 +0900)
commit7bbe3eee52c08ee92a81b7bed395ca5499554cc4
tree5a523013f10c2c419b3b50ac7ac4a97e7d11f43e
parenta7bf2a21d99b5044af3262d806509153899777e5
Declare support for Ethernet if the service is running.

On some devices, support for TYPE_ETHERNET is not specified in
the networkAttributes config resource, even though the device is
capable of supporting Ethernet (e.g., via USB host adapters).
This leads to Ethernet working but various connectivity APIs
behaving as if it was not - for example, no CONNECTIVITY_ACTION
broadcasts will be issues when it connects or disconnects.

Ensure that ConnectivityService always treats Ethernet as
available if the service is running. Currently the service is
started if the device supports FEATURE_ETHERNET or
FEATURE_USB_HOST.

Bug: 37359230
Test: bullhead builds, boots
Test: ConnectivityServiceTest passes
Test: Ethernet is available even if removed from networkAttributes resource
Test: ConnectivityManagerTest CTS test passes
Change-Id: I58801bf4f0bbdc3ff6345ec6bfdc911ce045c8ab
services/core/java/com/android/server/ConnectivityService.java
tests/net/java/com/android/server/ConnectivityServiceTest.java