From 2bdb206bc0de7a57eca97575bd763c4c01ed3f35 Mon Sep 17 00:00:00 2001 From: Chalard Jean Date: Mon, 11 May 2020 12:31:01 +0000 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 Original-Change: https://android-review.googlesource.com/1307433 Merged-In: I6f75e2b26eb9f554243bc418142a4dc18839aa79 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; }