FileDocCategorySizeDatePackage
TrustedMIDletIcon.javaAPI DocphoneME MR2 API (J2ME)3106Wed May 02 18:00:06 BST 2007com.sun.midp.main

TrustedMIDletIcon

public class TrustedMIDletIcon extends Object
This holds the trusted MIDlet icon.

Fields Summary
private static javax.microedition.lcdui.Image
trustedIcon
The trusted icon.
private static com.sun.midp.security.SecurityToken
classSecurityToken
Security token to allow access to implementation APIs
Constructors Summary
Methods Summary
public static javax.microedition.lcdui.ImagegetIcon()
Get the Image of the trusted icon for this Display. Only callers with the internal AMS permission can use this method.

return
an Image of the trusted icon.
exception
SecurityException if the suite calling does not have the the AMS permission


                                                  
        
        MIDletStateHandler midletStateHandler =
            MIDletStateHandler.getMidletStateHandler();

        MIDletSuite suite = midletStateHandler.getMIDletSuite();
        suite.checkIfPermissionAllowed(Permissions.AMS);

        if (trustedIcon == null) {
            byte[] imageData = ResourceHandler.getSystemImageResource(
                    classSecurityToken, "trustedmidlet_icon");
            if (imageData != null) {
                trustedIcon = Image.createImage(imageData, 0, imageData.length);
            } else {
                // Use a empty immutable image as placeholder
                trustedIcon = Image.createImage(Image.createImage(16, 16));
            }
        }

        return trustedIcon;