diff options
author | Paul Jensen <pauljensen@google.com> | 2014-07-15 12:07:36 -0400 |
---|---|---|
committer | Paul Jensen <pauljensen@google.com> | 2014-07-15 19:06:39 +0000 |
commit | fdc4e4af7305514359e041dbec742f4b6561e393 (patch) | |
tree | 8a2a50be878a0c4abf9ee9d0732157020c80c6b3 /services/core/java/com/android/server/connectivity/NetworkMonitor.java | |
parent | cdf2564debba7b3f3f666a7fc60361fa8c781418 (diff) | |
download | frameworks_base-fdc4e4af7305514359e041dbec742f4b6561e393.zip frameworks_base-fdc4e4af7305514359e041dbec742f4b6561e393.tar.gz frameworks_base-fdc4e4af7305514359e041dbec742f4b6561e393.tar.bz2 |
Fix hiding of sign-in to network notification.
Don't rely on the NetworkAgent still being connected when we go to
hide the notification. The notification is hidden when the
NetworkAgent is disconnected so that wasn't a safe assumption.
By using the NetID as the notification identifier we also fix the
issue of multiple notifications of the same network type inadvertently
hiding the incorrect notification with the same network type.
bug:16317917
Change-Id: I01fdc466a0f430af9fc378445586ec7b83b3ac83
Diffstat (limited to 'services/core/java/com/android/server/connectivity/NetworkMonitor.java')
-rw-r--r-- | services/core/java/com/android/server/connectivity/NetworkMonitor.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/connectivity/NetworkMonitor.java b/services/core/java/com/android/server/connectivity/NetworkMonitor.java index 8289f5a..545723a 100644 --- a/services/core/java/com/android/server/connectivity/NetworkMonitor.java +++ b/services/core/java/com/android/server/connectivity/NetworkMonitor.java @@ -148,8 +148,8 @@ public class NetworkMonitor extends StateMachine { /** * Request ConnectivityService display provisioning notification. * arg1 = Whether to make the notification visible. - * obj = Intent to be launched when notification selected by user. - * replyTo = NetworkAgentInfo.messenger so ConnectivityService can identify sender. + * arg2 = NetID. + * obj = Intent to be launched when notification selected by user, null if !arg1. */ public static final int EVENT_PROVISIONING_NOTIFICATION = BASE + 12; @@ -447,9 +447,9 @@ public class NetworkMonitor extends StateMachine { // Initiate notification to sign-in. Intent intent = new Intent(ACTION_SIGN_IN_REQUESTED); intent.putExtra(Intent.EXTRA_TEXT, String.valueOf(mNetworkAgentInfo.network.netId)); - Message message = obtainMessage(EVENT_PROVISIONING_NOTIFICATION, 1, 0, + Message message = obtainMessage(EVENT_PROVISIONING_NOTIFICATION, 1, + mNetworkAgentInfo.network.netId, PendingIntent.getBroadcast(mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)); - message.replyTo = mNetworkAgentInfo.messenger; mConnectivityServiceHandler.sendMessage(message); } @@ -470,8 +470,8 @@ public class NetworkMonitor extends StateMachine { @Override public void exit() { - Message message = obtainMessage(EVENT_PROVISIONING_NOTIFICATION, 0, 0, null); - message.replyTo = mNetworkAgentInfo.messenger; + Message message = obtainMessage(EVENT_PROVISIONING_NOTIFICATION, 0, + mNetworkAgentInfo.network.netId, null); mConnectivityServiceHandler.sendMessage(message); mContext.unregisterReceiver(mUserRespondedBroadcastReceiver); mUserRespondedBroadcastReceiver = null; |