Don't consider TRACK_DEFAULT requests in EthernetNetworkFactory.

These should not affect network refcount and thus should not be
passed to the network transport.

Bug: 116034205
Test: successfully established a VPN when connected to USB ethernet
Change-Id: I66517d86f35b8cfc1e211cb189127187d2744b60
This commit is contained in:
Lorenzo Colitti
2018-10-16 17:36:40 +09:00
parent 33893d68d4
commit 4f316a4420

View File

@@ -72,6 +72,10 @@ public class EthernetNetworkFactory extends NetworkFactory {
@Override
public boolean acceptRequest(NetworkRequest request, int score) {
if (request.type == NetworkRequest.Type.TRACK_DEFAULT) {
return false;
}
if (DBG) {
Log.d(TAG, "acceptRequest, request: " + request + ", score: " + score);
}
@@ -424,6 +428,7 @@ public class EthernetNetworkFactory extends NetworkFactory {
@Override
public String toString() {
return getClass().getSimpleName() + "{ "
+ "refCount: " + refCount + ", "
+ "iface: " + name + ", "
+ "up: " + mLinkUp + ", "
+ "hwAddress: " + mHwAddress + ", "