Beispiel #1
0
 /**
  * Turns the backlight on on a device until lightOff() is called
  *
  * @return true when backlight is supported on this device.
  * @see #lightOff()
  */
 public static boolean lightOn() {
   // #if polish.HasOptionalApis
   if (!controllerInitializationDone) {
     initController();
   }
   if (controller != null) {
     return controller.lightOn();
   } else {
     // # return false;
   }
   // #elif polish.android
   MidletBridge.instance.backlightOn();
   // # return true;
   // #else
   synchronized (lightsLock) {
     boolean success = false;
     // #if tmp.useNokiaUi
     com.nokia.mid.ui.DeviceControl.setLights(0, 100);
     success = true;
     // #elif tmp.useBlackBerry
     net.rim.device.api.system.Backlight.enable(true);
     success = true;
     // #elif tmp.useThread
     if (thread == null) {
       if (isLightSupported()) {
         DeviceControl dc = new DeviceControl();
         dc.start();
         success = true;
       }
     }
     // #endif
     return success;
   }
   // #endif
 }
Beispiel #2
0
 /**
  * Turns the backlight off
  *
  * @see #lightOn()
  */
 public static void lightOff() {
   // #if polish.HasOptionalApis
   if (!controllerInitializationDone) {
     initController();
   }
   if (controller != null) {
     controller.lightOn();
   }
   // #elif polish.android
   MidletBridge.instance.backlightRelease();
   // #else
   synchronized (lightsLock) {
     // #if tmp.useNokiaUi
     com.nokia.mid.ui.DeviceControl.setLights(0, 0);
     // #elif tmp.useBlackBerry
     net.rim.device.api.system.Backlight.enable(false);
     // #elif tmp.useThread
     DeviceControl dc = thread;
     if (dc != null) {
       dc.switchLightOff();
       thread = null;
     }
     // #endif
   }
   // #endif
 }
  public void showNotify() {
    super.showNotify();

    // #if polish.blackberry.isTouchBuild == true
    DeviceControl.hideSoftKeyboard();
    // #endif

    // #if !polish.blackberry
    // #if not using.native.textfield:defined
    TextUtilities.loadTextFieldCharacterset(
        "la"); // Defaulting to latin characters as we only allow latin characters in input fields
    // #endif
    // #endif

  }