17.5 Security of the Push Registry
The PushRegistry class is protected using the security framework and permissions. A MIDlet suite must have the javax.microedition.io.PushRegistry permission to register an alarm based launch and to statically or dynamically register for network notifications. Push registry permissions are also used to determine whether the user needs to be prompted before launching a MIDlet suite in response to a network or alarm-based notification. The security framework defines the general behavior for user permissions with the interaction modes of oneshot, session, and blanket. Their behavior is specialized for the PushRegistry and AMS, as described in the following list:
Oneshot:
prompt the user before launching a MIDlet suite in response to a network or alarm-based notification, and for each push registry request (such as registering an alarm or connection).
Session:
prompt the user before launching a MIDlet suite in response to a network or alarm-based notification, or before the first push registry request (such as registering an alarm or connection) after each launch. The user is not prompted on subsequent uses of the push registry by the MIDlet.
Blanket:
prompt the user once when the MIDlet is being installed, before the first time the MIDlet suite is launched in response to a network or alarm-based notification, and before it uses the push registry.
In addition to needing permission to use the push registry, the MIDlet must also have permission to use server protocols. That is, the push mechanism uses protocols in which the device is acting as the server; it can accept connections from other entities on the network. To use the push mechanisms and accept connections, the MIDlet suite needs permission to use the protocols that it will use when it acts as a server. For example, a chat program that can be started in response to a socket connection notification would need to have the javax.microedition.io.Connector.serversocket permission. The chat program might use the following attributes in the manifest to request the permissions and static registrations it requires:
MIDlet-Push-1: socket://:79, com.sun.example.SampleChat, *
MIDlet-Permissions: javax.microedition.io.PushRegistry, javax.microedition.io.Connector.
serversocket
 |