Methods Summary |
---|
public static boolean | checkInConnectionInternal(com.sun.midp.security.SecurityToken token, java.lang.String connection)Check in a push connection into AMS so the owning MIDlet can get
launched next time data is pushed. This method is used when a MIDlet
will not be able to get the connection and close (check in) the
connection for some reason. (normally because the user denied a
permission)
For datagram connections this function will discard the cached message.
For server socket connections this function will close the
accepted connection.
if (token == null) {
throw new SecurityException("This API is for internal use only");
}
token.checkIfPermissionAllowed(Permissions.AMS);
return ConnectionRegistry.checkInConnectionInternal(connection);
|
private static void | checkInvocationAllowed()Validates that the method is invoked allowed party.
final MIDletSuite current =
MIDletStateHandler.getMidletStateHandler().getMIDletSuite();
if (current != null) {
current.checkIfPermissionAllowed(Permissions.AMS);
}
|
public static void | enablePushLaunch(boolean enable)Sets the flag which enables push launches to take place.
checkInvocationAllowed();
ConnectionRegistry.pushEnabled = enable;
|
public static void | initSecurityToken(com.sun.midp.security.SecurityToken token)Initializes the security token for this class, so it can
perform actions that a normal MIDlet Suite cannot.
checkInvocationAllowed();
ConnectionRegistry.initSecurityToken(token);
|
public static java.lang.String | listConnections(int id, boolean available)Return a list of registered connections for given
MIDlet suite.
checkInvocationAllowed();
return ConnectionRegistry.listConnections(id, available);
|
public static void | registerConnectionInternal(com.sun.midp.midlet.MIDletSuite midletSuite, java.lang.String connection, java.lang.String midlet, java.lang.String filter, boolean bypassChecks)Register a dynamic connection with the
application management software. Once registered,
the dynamic connection acts just like a
connection preallocated from the descriptor file.
The internal implementation includes the storage name
that uniquely identifies the MIDlet .
This method bypasses the class loader specific checks
needed by the Installer .
checkInvocationAllowed();
if (filter == null) {
throw new IllegalArgumentException("filter is null");
}
if (!bypassChecks) {
try {
midletSuite.checkForPermission(Permissions.PUSH, null);
} catch (InterruptedException ie) {
throw new InterruptedIOException(
"Interrupted while trying to ask the user permission");
}
PushRegistryImpl.checkMidletRegistered(midletSuite, midlet);
ConnectionRegistry.checkRegistration(Connection.parse(connection), midlet, filter);
}
ConnectionRegistry.registerConnectionInternal(
midletSuite,
connection, midlet, filter,
!bypassChecks);
|
public static void | setMvmSingleMidletMode()Sets the flag which indicates that the AMS is operating in MVM
single MIDlet mode.
checkInvocationAllowed();
ConnectionRegistry.mvmSingleMidletMode = true;
|
public static void | startListening()Start listening for push notifications. Will throw a security
exception if called by any thing other than the MIDletSuiteLoader.
checkInvocationAllowed();
ConnectionRegistry.startListening();
|
public static void | unregisterConnections(int id)Unregister all the connections for a MIDlet suite.
checkInvocationAllowed();
ConnectionRegistry.delAllForSuite0(id);
|