From 4f316a4420da21791285c28122cdcb816f43aff9 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Tue, 16 Oct 2018 17:36:40 +0900 Subject: [PATCH] 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 --- .../com/android/server/ethernet/EthernetNetworkFactory.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java b/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java index dc94482bfd..54bcdc3b35 100644 --- a/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java +++ b/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java @@ -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 + ", "