Methods Summary |
---|
public void | checkForPermission(int permission, java.lang.String resource, java.lang.String extraValue)Checks for permission and throw an exception if not allowed.
May block to ask the user a question.
checkIfPermissionAllowed(permission);
|
public void | checkForPermission(int permission, java.lang.String resource)Check for permission and throw an exception if not allowed.
May block to ask the user a question.
checkForPermission(permission, resource, null);
|
public void | checkIfPermissionAllowed(int permission)Checks to see the suite has the ALLOW level for specific permission.
This is used for by internal APIs that only provide access to
trusted system applications.
if (checkPermission(permission) != 1) {
throw new SecurityException(SecurityToken.STD_EX_MSG);
}
|
public int | checkPermission(java.lang.String permission)Gets the status of the specified permission.
If no API on the device defines the specific permission
requested then it must be reported as denied.
If the status of the permission is not known because it might
require a user interaction then it should be reported as unknown.
for (int i = 0; i < Permissions.NUMBER_OF_PERMISSIONS; i++) {
if (Permissions.getName(i).equals(permission)) {
return checkPermission(i);
}
}
return 0;
|
private int | checkPermission(int permission)Check to see the suite has the ALLOW level for specific permission.
This is used for by internal APIs that only provide access to
trusted system applications.
if (permission < 0 || permission >= permissions.length) {
// report denied
return 0;
}
switch (permissions[permission]) {
case Permissions.ALLOW:
case Permissions.BLANKET_GRANTED:
// report allowed
return 1;
case Permissions.BLANKET:
case Permissions.SESSION:
case Permissions.ONESHOT:
// report unknown
return -1;
default:
break;
}
// report denied
return 0;
|
public void | close()Close the opened MIDletSuite
|
public static com.sun.midp.midlet.MIDletSuite | create(java.lang.String theDisplayName, int theId)Creates MIDletSuite for rommized MIDlet.
return new InternalMIDletSuiteImpl(theDisplayName, theId);
|
public int | getID()Gets the unique ID of the suite.
return id;
|
public java.lang.String | getMIDletName(java.lang.String className)Get the name of a MIDlet to display to the user.
/*
* Each internal MIDlet runs in it own suite,
* just return the suite name
*/
return displayName;
|
public int | getNumberOfMIDlets()Provides the number of MIDlets in this suite.
return numberOfMidlets;
|
public byte[] | getPermissions()Gets list of permissions for this suite.
return permissions;
|
public java.lang.String | getProperty(java.lang.String key)Gets a property of the suite. A property is an attribute from
either the application descriptor or JAR Manifest.
return properties.getProperty(key);
|
public byte | getPushInterruptSetting()Gets push setting for interrupting other MIDlets.
Reuses the Permissions.
// Rommized internal MIDlet can interrupt other MIDlets without asking.
return Permissions.ALLOW;
|
public int | getPushOptions()Gets push options for this suite.
// There are not push options for rommized suites.
return 0;
|
public boolean | isEnabled()Determine if the a MIDlet from this suite can be run. Note that
disable suites can still have their settings changed and their
install info displayed.
return true;
|
public boolean | isRegistered(java.lang.String midletClassName)Indicates if the named MIDlet is registered in the suite
with MIDlet-<n> record in the manifest or
application descriptor.
// Rommized MIDlets don't have JAD MIDlet-n entries.
return false;
|
public boolean | isTrusted()Indicates if this suite is trusted.
(not to be confused with a domain named "trusted",
this is used for extra checks beyond permission checking)
return trusted;
|
public boolean | isVerified()Get state of classes preverification within the suite.
return true;
|
public boolean | permissionToInterrupt(java.lang.String connection)Asks the user want to interrupt the current MIDlet with
a new MIDlet that has received network data.
// Rommized internal MIDlet can interrupt other MIDlets without asking.
return true;
|
public void | setTempProperty(com.sun.midp.security.SecurityToken token, java.lang.String key, java.lang.String value)Replace or add a property to the suite for this run only.
if (token != null) {
token.checkIfPermissionAllowed(Permissions.AMS);
} else {
MIDletSuite current = MIDletStateHandler.
getMidletStateHandler().getMIDletSuite();
current.checkIfPermissionAllowed(Permissions.AMS);
}
properties.setProperty(key, value);
|