midletsuiteutils.java
来自「This is a resource based on j2me embedde」· Java 代码 · 共 832 行 · 第 1/3 页
JAVA
832 行
String arg0, String arg1, String arg2) { return executeWithArgs( null, suiteId, midlet, displayName, arg0, arg1, arg2, false); } /** * Starts a MIDlet in a new Isolate or * queues the execution of the named Application suite to run. * The current application suite should terminate itself normally * to make resources available to the new application suite. Only * one package and set of MIDlets can be queued in this manner. * If multiple calls to execute are made, the package and MIDlets * specified during the <em>last</em> invocation will be executed * when the current application is terminated. * * @param suiteId ID of an installed suite * @param midlet class name of MIDlet to invoke * @param displayName name to display to the user * @param arg0 if not null, this parameter will be available to the * MIDlet as application property arg-0 * @param arg1 if not null, this parameter will be available to the * MIDlet as application property arg-1 * @param arg2 if not null, this parameter will be available to the * MIDlet as application property arg-2 * @param isDebugMode true if the new midlet must be started in debug * mode, false otherwise * * @return true if the MIDlet suite MUST first exit before the * MIDlet is run * * @exception SecurityException if the caller does not have permission * to manage midlets */ public static boolean executeWithArgs( int suiteId, String midlet, String displayName, String arg0, String arg1, String arg2, boolean isDebugMode) { return executeWithArgs( null, suiteId, midlet, displayName, arg0, arg1, arg2, isDebugMode); } /** * Starts a MIDlet in a new Isolate or * queues the execution of the named Application suite to run. * The current application suite should terminate itself normally * to make resources available to the new application suite. Only * one package and set of MIDlets can be queued in this manner. * If multiple calls to execute are made, the package and MIDlets * specified during the <em>last</em> invocation will be executed * when the current application is terminated. * * @param securityToken security token of the calling class * @param suiteId ID of an installed suite * @param midlet class name of MIDlet to invoke * @param displayName name to display to the user * @param arg0 if not null, this parameter will be available to the * MIDlet as application property arg-0 * @param arg1 if not null, this parameter will be available to the * MIDlet as application property arg-1 * @param arg2 if not null, this parameter will be available to the * MIDlet as application property arg-2 * * @return true if the MIDlet suite MUST first exit before the * MIDlet is run * * @exception SecurityException if the caller does not have permission * to manage midlets */ public static boolean executeWithArgs( SecurityToken securityToken, int suiteId, String midlet, String displayName, String arg0, String arg1, String arg2) { return executeWithArgs( securityToken, 0, suiteId, midlet, displayName, arg0, arg1, arg2, false); } /** * Starts a MIDlet in a new Isolate or * queues the execution of the named Application suite to run. * The current application suite should terminate itself normally * to make resources available to the new application suite. Only * one package and set of MIDlets can be queued in this manner. * If multiple calls to execute are made, the package and MIDlets * specified during the <em>last</em> invocation will be executed * when the current application is terminated. * * @param securityToken security token of the calling class * @param suiteId ID of an installed suite * @param midlet class name of MIDlet to invoke * @param displayName name to display to the user * @param arg0 if not null, this parameter will be available to the * MIDlet as application property arg-0 * @param arg1 if not null, this parameter will be available to the * MIDlet as application property arg-1 * @param arg2 if not null, this parameter will be available to the * MIDlet as application property arg-2 * @param isDebugMode true if the new midlet must be started in debug * mode, false otherwise * * @return true if the MIDlet suite MUST first exit before the * MIDlet is run * * @exception SecurityException if the caller does not have permission * to manage midlets */ public static boolean executeWithArgs( SecurityToken securityToken, int suiteId, String midlet, String displayName, String arg0, String arg1, String arg2, boolean isDebugMode) { return executeWithArgs( securityToken, 0, suiteId, midlet, displayName, arg0, arg1, arg2, isDebugMode); } /** * Starts a MIDlet in a new Isolate or * queues the execution of the named Application suite to run. * The current application suite should terminate itself normally * to make resources available to the new application suite. Only * one package and set of MIDlets can be queued in this manner. * If multiple calls to execute are made, the package and MIDlets * specified during the <em>last</em> invocation will be executed * when the current application is terminated. * * @param securityToken security token of the calling class * @param externalAppId ID of MIDlet to invoke, given by an external * application manager * @param suiteId ID of an installed suite * @param midlet class name of MIDlet to invoke * @param displayName name to display to the user * @param arg0 if not null, this parameter will be available to the * MIDlet as application property arg-0 * @param arg1 if not null, this parameter will be available to the * MIDlet as application property arg-1 * @param arg2 if not null, this parameter will be available to the * MIDlet as application property arg-2 * @param isDebugMode true if the new midlet must be started in debug * mode, false otherwise * * @return true if the MIDlet suite MUST first exit before the * MIDlet is run * * @exception SecurityException if the caller does not have permission * to manage midlets */ public static boolean executeWithArgs( SecurityToken securityToken, int externalAppId, int suiteId, String midlet, String displayName, String arg0, String arg1, String arg2, boolean isDebugMode) { return executeWithArgs( securityToken, externalAppId, suiteId, midlet, displayName, arg0, arg1, arg2, -1, -1, -1, null, isDebugMode); } /** * Starts a MIDlet in a new Isolate or * queues the execution of the named Application suite to run. * The current application suite should terminate itself normally * to make resources available to the new application suite. Only * one package and set of MIDlets can be queued in this manner. * If multiple calls to execute are made, the package and MIDlets * specified during the <em>last</em> invocation will be executed * when the current application is terminated. * * @param securityToken security token of the calling class * @param externalAppId ID of MIDlet to invoke, given by an external * application manager * @param suiteId ID of an installed suite * @param midlet class name of MIDlet to invoke * @param displayName name to display to the user * @param arg0 if not null, this parameter will be available to the * MIDlet as application property arg-0 * @param arg1 if not null, this parameter will be available to the * MIDlet as application property arg-1 * @param arg2 if not null, this parameter will be available to the * MIDlet as application property arg-2 * @param memoryReserved the minimum amount of memory guaranteed to be * available to the isolate at any time; < 0 if not used * @param memoryTotal the total amount of memory that the isolate can reserve; < 0 if not used * @param priority priority to set for the new isolate; * <= 0 if not used * @param profileName name of the profile to set for the new isolate; * null if not used * @param isDebugMode true if the new midlet must be started in debug * mode, false otherwise * * @return true if the MIDlet suite MUST first exit before the * MIDlet is run * * @exception SecurityException if the caller does not have permission * to manage midlets */ public static boolean executeWithArgs( SecurityToken securityToken, int externalAppId, int suiteId, String midlet, String displayName, String arg0, String arg1, String arg2, int memoryReserved, int memoryTotal, int priority, String profileName, boolean isDebugMode) { MIDletSuiteStorage midletSuiteStorage; // Note: getMIDletSuiteStorage performs an AMS permission check. if (securityToken != null) { midletSuiteStorage = MIDletSuiteStorage.getMIDletSuiteStorage(securityToken); } else { midletSuiteStorage = MIDletSuiteStorage.getMIDletSuiteStorage(); } return AmsUtil.executeWithArgs( midletSuiteStorage, externalAppId, suiteId, midlet, displayName, arg0, arg1, arg2, memoryReserved, memoryTotal, priority, profileName, isDebugMode); } /** * Gets the unique storage name of the next MIDlet suite to run. * * @return storage name of a MIDlet suite */ public static int getNextMIDletSuiteToRun() { return nextMidletSuiteToRun; } /** * Gets the name of the next MIDlet to run. * * @return storage name of a MIDlet */ public static String getNextMIDletToRun() { return nextMidletToRun; } /** * Queues the last suite to run when there is not a next Suite * to run. This value will be persistent until it is used. * Not used in MVM mode. * <p> * Method requires com.sun.midp.ams permission. * * @param id ID of an installed suite * @param midlet class name of MIDlet to invoke * @param arg0 if not null, this parameter will be available to the * MIDlet as application property arg-0 * @param arg1 if not null, this parameter will be available to the * MIDlet as application property arg-1 * * @exception SecurityException if the caller does not have permission * to manage midlets */ public static void setLastSuiteToRun(int id, String midlet, String arg0, String arg1) { AccessController.checkPermission(Permissions.AMS_PERMISSION_NAME); lastMidletSuiteToRun = id; lastMidletToRun = midlet; arg0ForLastMidlet = arg0; arg1ForLastMidlet = arg1; } /** * Get the Isolate ID of the AMS Isolate. * * @return Isolate ID of AMS Isolate */ public static native int getAmsIsolateId(); /** * Get the current Isolate ID. *
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?