showNotification
public void showNotification(int id,
NetworkNotificationManager.NotificationType notifyType,
NetworkAgentInfo nai,
NetworkAgentInfo switchToNai,
PendingIntent intent,
boolean highPriority)
Show or hide network provisioning notifications.
We use notifications for two purposes: to notify that a network requires sign in
(NotificationType.SIGN_IN), or to notify that a network does not have Internet access
(NotificationType.NO_INTERNET). We display at most one notification per ID, so on a
particular network we can display the notification type that was most recently requested.
So for example if a captive portal fails to reply within a few seconds of connecting, we
might first display NO_INTERNET, and then when the captive portal check completes, display
SIGN_IN.
- Parameters:
id
- an identifier that uniquely identifies this notification. This must match
between show and hide calls. We use the NetID value but for legacy callers
we concatenate the range of types with the range of NetIDs.
nai
- the network with which the notification is associated. For a SIGN_IN, NO_INTERNET,
or LOST_INTERNET notification, this is the network we're connecting to. For a
NETWORK_SWITCH notification it's the network that we switched from. When this network
disconnects the notification is removed.
switchToNai
- for a NETWORK_SWITCH notification, the network we are switching to. Null
in all other cases. Only used to determine the text of the notification.