OSDN Git Service

Really allow NetworkAgent immutable updates to NetworkCapabilities
authorHugo Benichi <hugobenichi@google.com>
Fri, 18 Aug 2017 05:41:22 +0000 (14:41 +0900)
committerHugo Benichi <hugobenichi@google.com>
Fri, 18 Aug 2017 05:51:03 +0000 (14:51 +0900)
This patch completes commit bae105a5ccd11430bab14721d1325e2303a673da to
really allow updates of immutable capabilities to NetworkCapabilities of
NetworkAgents by using satisfiedByImmutableNetworkCapabilities instead
satisfiedByNetworkCapabilities.

Bug: 64125969
Test: runtest frameworks-net
Change-Id: I9beeb623792f0ee31abcd4ba9d0ba2451304fb2e

services/core/java/com/android/server/ConnectivityService.java

index 0babbc8..33e4f5c 100644 (file)
@@ -4703,8 +4703,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
     private void updateCapabilities(
             int oldScore, NetworkAgentInfo nai, NetworkCapabilities networkCapabilities) {
         // Once a NetworkAgent is connected, complain if some immutable capabilities are removed.
-        if (nai.everConnected &&
-                !nai.networkCapabilities.satisfiedByNetworkCapabilities(networkCapabilities)) {
+        if (nai.everConnected && !nai.networkCapabilities.satisfiedByImmutableNetworkCapabilities(
+                networkCapabilities)) {
             // TODO: consider not complaining when a network agent degrade its capabilities if this
             // does not cause any request (that is not a listen) currently matching that agent to
             // stop being matched by the updated agent.