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
diff --git a/service-t/src/com/android/server/ethernet/EthernetTracker.java b/service-t/src/com/android/server/ethernet/EthernetTracker.java
index c8c3bdf..d37e0c9 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 @@
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 @@
}
}
}
+ // 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;
}