Fix onBlockedStatusChanged does not work on multiple networks

There is a logic error in maybeNotifyNetworkBlockedForNewUidRules
that caused function to return if there is no status change in
the first network. This would cause CTS failed in devices which
has volte-enabled SIM inserted.

Bug: 129409153
Fix: 117969394
Test: 1. atest com.android.cts.net.HostsideNetworkCallbackTests \
         --generate-new-metrics 20
      2. atest FrameworksNetTests

Change-Id: I11168fd07a7c29e0605f2e874e9d9f41b5ad88b6
Merged-In: Ifd18d1c6ad708c1dbc793f03d8241f572af50317
(cherry picked from commit 6d3a92f7c2)
This commit is contained in:
Junyu Lai
2019-04-09 08:59:00 -07:00
parent 35d521ed42
commit 52e795deeb

View File

@@ -6543,7 +6543,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
uid, newRules, metered, mRestrictBackground);
}
if (oldBlocked == newBlocked) {
return;
continue;
}
final int arg = encodeBool(newBlocked);
for (int i = 0; i < nai.numNetworkRequests(); i++) {