From bddcfc0c48dd4902e11a92d38c80973f6bcd388a Mon Sep 17 00:00:00 2001 From: Chalard Jean Date: Mon, 11 May 2020 11:20:00 +0900 Subject: [PATCH] Add capability they should always have to eth networks. There is a stopgap hack in ConnectivityService doing this automatically, but individual agents should be doing this themselves. Test: FrameworksNetTests NetworkStackTests Bug: 150570873 Change-Id: I6f75e2b26eb9f554243bc418142a4dc18839aa79 --- .../src/com/android/server/ethernet/EthernetTracker.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/service-t/src/com/android/server/ethernet/EthernetTracker.java b/service-t/src/com/android/server/ethernet/EthernetTracker.java index c8c3bdfb59..d37e0c9c86 100644 --- a/service-t/src/com/android/server/ethernet/EthernetTracker.java +++ b/service-t/src/com/android/server/ethernet/EthernetTracker.java @@ -464,6 +464,7 @@ final class EthernetTracker { nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED); nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING); nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_CONGESTED); + nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_SUSPENDED); return nc; } @@ -542,6 +543,11 @@ final class EthernetTracker { } } } + // Ethernet networks have no way to update the following capabilities, so they always + // have them. + nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING); + nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_CONGESTED); + nc.addCapability(NetworkCapabilities.NET_CAPABILITY_NOT_SUSPENDED); return nc; }