SuspendResumeUIpublic class SuspendResumeUI extends Object User interface utilities for suspend/resume subsystem. |
Fields Summary |
---|
private static com.sun.midp.lcdui.SystemAlert | suspendAlertAlert notifying user of system suspension. It is null if the alert
is not being shown currently. |
Methods Summary |
---|
static synchronized void | dismissSuspendAlert()Dismisses alert notifying user of system suspend.
if (null != suspendAlert) {
suspendAlert.dismiss();
suspendAlert = null;
}
| private static com.sun.midp.lcdui.DisplayEventHandler | getDisp(com.sun.midp.security.SecurityToken token)Retrieves a display handler that guarantees exposition of a
system alert.
/* IMPL_NOTE: Due to current implementation of display preempting,
* alert is shown immediately only if launched from the isolate
* that has foreground. Moving AMS isolate to foreground to
* get display preemption.
*/
MIDletProxyList proxyList = MIDletProxyList.getMIDletProxyList(token);
proxyList.setForegroundMIDlet(proxyList.findAmsProxy());
return DisplayEventHandlerFactory.getDisplayEventHandler(token);
| static void | showAllKilledAlert(com.sun.midp.security.SecurityToken token)Shows alert notifying user that all MIDlets were killed during
preceding system suspension.
String title = Resource.getString(
ResourceConstants.SR_ALL_KILLED_ALERT_TITLE, null);
String message = Resource.getString(
ResourceConstants.SR_ALL_KILLED_ALERT_MSG, null);
SystemAlert alert = new SystemAlert(getDisp(token), title,
message, null, AlertType.WARNING);
alert.runInNewThread();
| static synchronized void | showSuspendAlert(com.sun.midp.security.SecurityToken token)Shows alert notifying user of system suspend.
if (null == suspendAlert && AlertTimer.shouldShow()) {
String title = Resource.getString(
ResourceConstants.SR_SUSPEND_ALERT_TITLE, null);
String message = Resource.getString(
ResourceConstants.SR_SUSPEND_ALERT_MSG, null);
AlertTimer.start();
CommandListener ignoring = new CommandListener() {
public void commandAction(Command c, Displayable d) {}
};
suspendAlert = new SystemAlert(getDisp(token), title,
message, null, AlertType.WARNING);
suspendAlert.setCommandListener(ignoring);
suspendAlert.runInNewThread();
}
|
|