Methods Summary |
---|
public native int | createSuiteID()Returns a unique identifier of MIDlet suite.
Constructed from the combination
of the values of the MIDlet-Name and
MIDlet-Vendor attributes.
|
public native void | disable(int id)Disables a suite given its suite ID.
The method does not stop the suite if is in use. However any future
attepts to run a MIDlet from this suite while disabled should fail.
|
public native void | enable(int id)Enables a suite given its suite ID.
The method does update an suites that are currently loaded for
settings or of application management purposes.
|
InstallInfo | getInstallInfo(MIDletSuiteImpl midletSuite)Get the installation information of a suite.
return midletSuite.getInstallInfo();
|
public synchronized int[] | getListOfSuites()List all installed software packages by storage name.
int n = getNumberOfSuites();
if (n < 0) {
if (Logging.REPORT_LEVEL <= Logging.ERROR) {
Logging.report(Logging.ERROR, LogChannels.LC_AMS,
"Error in getNumberOfSuites0(): returned -1!");
}
n = 0;
}
int[] array = new int[n];
if (n > 0) {
getSuiteList(array);
}
return array;
|
public synchronized MIDletSuiteImpl | getMIDletSuite(int id, boolean update)Gets the MIDlet Suite from storage, and selects one midlet to be run.
if (!suiteExists(id)) {
return null;
}
MIDletSuiteImpl.lockMIDletSuite(id, update);
/*
* save on startup time, get the properties at first getProperty call
* and fill permissions on getPermission
*/
return new MIDletSuiteImpl(id);
|
public synchronized byte[] | getMIDletSuiteIcon(int suiteId, java.lang.String iconName)
byte[] iconBytes = null;
if (iconName == null) {
return null;
}
try {
iconBytes = getMIDletSuiteIcon0(suiteId, iconName);
if (iconBytes == null) {
/* Search for icon in the image cache */
iconBytes = loadCachedIcon0(suiteId, iconName);
}
if (iconBytes == null) {
/* Search for icon in the suite JAR */
iconBytes = JarReader.readJarEntry(
getMidletSuiteJarPath(suiteId), iconName);
}
} catch (Exception e) {
iconBytes = null;
}
return iconBytes;
|
private static native byte[] | getMIDletSuiteIcon0(int suiteId, java.lang.String iconName)Retrieves the cached icon from the icon cache.
|
public synchronized MIDletSuiteInfo | getMIDletSuiteInfo(int id)Reads the basic information about the midlet suite from the storage.
MIDletSuiteInfo msi = new MIDletSuiteInfo(id);
getMIDletSuiteInfoImpl0(id, msi);
return msi;
|
public native void | getMIDletSuiteInfoImpl0(int id, MIDletSuiteInfo msi)Reads the basic information about the midlet suite from the storage.
|
public static com.sun.midp.midletsuite.MIDletSuiteStorage | getMIDletSuiteStorage()Returns a reference to the singleton MIDlet suite storage object.
MIDletSuite midletSuite =
MIDletStateHandler.getMidletStateHandler().getMIDletSuite();
if (midletSuite == null) {
throw new
IllegalStateException("This method can't be called before " +
"a suite is started.");
}
midletSuite.checkIfPermissionAllowed(Permissions.AMS);
return getMasterStorage();
|
public static com.sun.midp.midletsuite.MIDletSuiteStorage | getMIDletSuiteStorage(com.sun.midp.security.SecurityToken securityToken)Returns a reference to the singleton MIDlet suite storage object.
securityToken.checkIfPermissionAllowed(Permissions.AMS);
return getMasterStorage();
|
private static com.sun.midp.midletsuite.MIDletSuiteStorage | getMasterStorage()Returns a reference to the singleton storage object.
if (masterStorage == null) {
masterStorage = new MIDletSuiteStorage();
int status = loadSuitesIcons0();
if (Logging.REPORT_LEVEL <= Logging.ERROR) {
if (status != 0) {
Logging.report(Logging.ERROR, LogChannels.LC_AMS,
"Can't load the cached icons, error code" + status);
}
}
}
return masterStorage;
|
public native synchronized java.lang.String | getMidletSuiteAppImagePath(int id)Get the path for the MONET image of the specified suite.
|
public synchronized java.lang.String[] | getMidletSuiteClassPath(int id)Get the midlet suite's class path including a path to the MONET
image of the specified suite and a path to the suite's jar file.
String jarFile = getMidletSuiteJarPath(id);
if (Constants.MONET_ENABLED && id != MIDletSuite.INTERNAL_SUITE_ID) {
String bunFile = getMidletSuiteAppImagePath(id);
return new String[]{bunFile, jarFile};
}
return new String[]{jarFile};
|
public native synchronized java.lang.String | getMidletSuiteJarPath(int id)Get the class path for a suite.
|
private native int | getNumberOfSuites()Get the number of installed of MIDlet suites.
|
static java.lang.String[] | getPropertiesStrings(com.sun.midp.util.Properties props)Fill plain array with properties key/value String pairs.
It's needed to simplify properties using in a native code.
if (props != null) {
int size = props.size();
String[] res = new String[size * 2];
for (int i = 0, j = 0; i < size; i++) {
res[j++] = props.getKeyAt(i);
res[j++] = props.getValueAt(i);
}
return res;
} else return null;
|
public native int | getStorageUsed(int id)Gets the amount of storage on the device that this suite is using.
This includes the JAD, JAR, management data, and RMS.
|
public static native int | getSuiteID(java.lang.String vendor, java.lang.String name)Gets the unique identifier of MIDlet suite.
|
private native void | getSuiteList(int[] suites)Retrieves the list of MIDlet suites and store them into a Vector
object. Each element in the Vector is the storage name
of an installed application.
|
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.
if (classSecurityToken != null) {
return;
}
classSecurityToken = token;
MIDletSuiteImpl.initSecurityToken(classSecurityToken);
|
public java.lang.String[] | listRecordStores(int suiteId)Returns an array of the names of record stores owned by the
MIDlet suite.
The order of RecordStore names returned is implementation
dependent.
return RecordStoreImpl.listRecordStores(classSecurityToken, suiteId);
|
private static native byte[] | loadCachedIcon0(int suiteId, java.lang.String iconName)Loads suite icon data from image cache.
|
public static native int | loadSuitesIcons0()Loads the cached icons from the permanent storage into memory.
|
private native void | nativeStoreSuite(InstallInfo installInfo, SuiteSettings suiteSettings, MIDletSuiteInfo msi, java.lang.String[] jadProps, java.lang.String[] jarProps)Stores or updates a midlet suite.
|
public void | remove(int id)Removes a software package given its suite ID.
The content handler manager is called to remove any registrations,
if any.
If the component is in use it must continue to be available
to the other components that are using it. The resources it
consumes must not be released until it is not in use.
remove0(id);
/*
* If no exception occurs,
* remove the content handler registrations, if any.
*/
CHManager.getManager(classSecurityToken).uninstall(id);
|
private native void | remove0(int id)Native remove of a software package given its suite ID.
If the component is in use it must continue to be available
to the other components that are using it. The resources it
consumes must not be released until it is not in use.
|
public void | saveSuiteSettings(int id, byte pushInterruptSetting, int pushOptions, byte[] permissions)Saves any of the settings (security or others) that the user may have
changed.
SuiteSettings settings = new SuiteSettings(id);
settings.setPushInterruptSetting(pushInterruptSetting);
settings.setPushOptions(pushOptions);
settings.setPermissions(permissions);
settings.save();
|
public synchronized void | storeSuite(InstallInfo installInfo, SuiteSettings suiteSettings, MIDletSuiteInfo msi, com.sun.midp.util.Properties jadProps, com.sun.midp.util.Properties jarProps)Stores or updates a midlet suite.
/*
* Convert the property args to String arrays to save
* creating the native KNI code to access the object.
*/
String[] strJadProperties = getPropertiesStrings(jadProps);
String[] strJarProperties = getPropertiesStrings(jarProps);
nativeStoreSuite(installInfo, suiteSettings, msi,
strJadProperties, strJarProperties);
|
public native void | storeSuiteVerifyHash(int id, byte[] verifyHash)Stores hash value of the suite with preverified classes
|
public native boolean | suiteExists(int id)Tells if a suite exists.
|
public static native java.lang.String | suiteIdToString(int suiteId)Java interface for midp_suiteid2pcsl_string().
|