Improve code that decides whether Ethernet should be supported.
Currently, ConnectivityManagerTest checks whether the device
supports Ethernet by checking whether the OEM has configured it
in the networkAttributes array, or whether the Ethernet service
is running. It does this because devices that support USB host
mode enable Ethernet even if the OEM does not add Ethernet to
the networkAttributes array.
Unfortunately this does not work in instant mode because instant
apps cannot query the Ethernet service due to selinux policies.
In addition to querying whether the service is running (which
will continue to work in non-instant mode), also assume that
Ethernet is supported if the FEATURE_ETHERNET or FEATURE_USB_HOST
PackageManager flags are present.
This fixes various ConnectivityManagerTest testcases on devices
that support USB host mode but where the OEM has not added
Ethernet to the networkAttributes array.
Bug: 137630789
Bug: 143850345
Bug: 145482540
Test: atest android.net.cts.ConnectivityManagerTest#testIsNetworkSupported
Test: atest --instant android.net.cts.ConnectivityManagerTest#testIsNetworkSupported
Change-Id: Ie8a701f607967576a45c6b3c4f25c9c003aa3165
1 file changed
tree: 4123336401aea0e39d3610b5af419b131534f4b2
- tests/