Return a reference to the singleton display manager object.
token.checkIfPermissionAllowed(Permissions.MIDP);
if (managerImpl != null) {
return managerImpl;
}
/**
* The display manager implementation is a private class of Display
* and is create in the class init of Display, we need to call a
* static method of display to get the class init to run, because
* some classes need to get the display manager to create a display
*/
try {
// this will yield a null pointer exception on purpose
Display.getDisplay(null);
} catch (NullPointerException npe) {
// this is normal for this case, do nothing
}
return managerImpl;