From 7844b81ae808867666a39507e7e0d4e1a17ebd4a Mon Sep 17 00:00:00 2001 From: Paul Jensen Date: Mon, 25 Aug 2014 22:45:39 -0400 Subject: [PATCH] Fix to allow removing sign-in notification when network removed. When the NetworkMonitor is told a network disconnected and a sign-in notification has been shown to the user, the NetworkMonitor requests the notification be removed. This request goes to the ConnectivityService who may have already removed the NetworkAgentInfo from mNetworkForNetId so we cannot look up the NetID in there. There is no harm in allowing notification hiding for networks that are disconnected as the notification logic does not effect the Network state (like the validation message that caused the addition of the Network liveness check). bug:17261757 Change-Id: Id0a299e230ae37e641ac2faeebc45550e27c1fa4 --- .../com/android/server/ConnectivityService.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index ad8f446f31..e9dc30b6ee 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -1898,17 +1898,17 @@ public class ConnectivityService extends IConnectivityManager.Stub { break; } case NetworkMonitor.EVENT_PROVISIONING_NOTIFICATION: { - NetworkAgentInfo nai = null; - synchronized (mNetworkForNetId) { - nai = mNetworkForNetId.get(msg.arg2); - } - if (nai == null) { - loge("EVENT_PROVISIONING_NOTIFICATION from unknown NetworkMonitor"); - break; - } if (msg.arg1 == 0) { setProvNotificationVisibleIntent(false, msg.arg2, 0, null, null); } else { + NetworkAgentInfo nai = null; + synchronized (mNetworkForNetId) { + nai = mNetworkForNetId.get(msg.arg2); + } + if (nai == null) { + loge("EVENT_PROVISIONING_NOTIFICATION from unknown NetworkMonitor"); + break; + } setProvNotificationVisibleIntent(true, msg.arg2, nai.networkInfo.getType(), nai.networkInfo.getExtraInfo(), (PendingIntent)msg.obj); }