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 08:35:06 +0000 (17:35 +0900)
commit8fa085e76f1618b87e01e8c2b79fcb942056a119
treef3b7f2f322a4bb4071bd9da8aa1d96aa4b6303af
parente545f00e101d1306829e7949e02d1002e40ab66b
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.

(cherry picked from commit 7bbe3eee52c08ee92a81b7bed395ca5499554cc4)

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: I9b6db4edeaf966ee6715011dd92770b9d25dd938
Merged-In: I9b6db4edeaf966ee6715011dd92770b9d25dd938
services/core/java/com/android/server/ConnectivityService.java
tests/net/java/com/android/server/ConnectivityServiceTest.java