diff options
| author | Chalard Jean <jchalard@google.com> | 2021-09-29 06:03:56 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-09-29 06:03:56 +0000 |
| commit | 9d31c63e039d01bc66d91aff0e8417cb1569369a (patch) | |
| tree | 612f8e2ac25757ad80bda772c4dc1091d507645a /service/src/com/android/server/ConnectivityService.java | |
| parent | 38f82199abbfaa84f08bd798f51da77540b9755b (diff) | |
| parent | 614b27badd29a2a77e120662f9e5bcf899e3393b (diff) | |
Merge "Check NetworkAgentInfo Map Before Destroying Network"
Diffstat (limited to 'service/src/com/android/server/ConnectivityService.java')
| -rw-r--r-- | service/src/com/android/server/ConnectivityService.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java index 0e05ef2914..7223c194b1 100644 --- a/service/src/com/android/server/ConnectivityService.java +++ b/service/src/com/android/server/ConnectivityService.java @@ -3848,9 +3848,7 @@ public class ConnectivityService extends IConnectivityManager.Stub private void handleNetworkAgentDisconnected(Message msg) { NetworkAgentInfo nai = (NetworkAgentInfo) msg.obj; - if (mNetworkAgentInfos.contains(nai)) { - disconnectAndDestroyNetwork(nai); - } + disconnectAndDestroyNetwork(nai); } // Destroys a network, remove references to it from the internal state managed by @@ -3858,6 +3856,9 @@ public class ConnectivityService extends IConnectivityManager.Stub // Must be called on the Handler thread. private void disconnectAndDestroyNetwork(NetworkAgentInfo nai) { ensureRunningOnConnectivityServiceThread(); + + if (!mNetworkAgentInfos.contains(nai)) return; + if (DBG) { log(nai.toShortString() + " disconnected, was satisfying " + nai.numNetworkRequests()); } @@ -3943,7 +3944,7 @@ public class ConnectivityService extends IConnectivityManager.Stub try { mNetd.networkSetPermissionForNetwork(nai.network.netId, INetd.PERMISSION_SYSTEM); } catch (RemoteException e) { - Log.d(TAG, "Error marking network restricted during teardown: " + e); + Log.d(TAG, "Error marking network restricted during teardown: ", e); } mHandler.postDelayed(() -> destroyNetwork(nai), nai.teardownDelayMs); } |
