The sleep object will allow you to suspend and enable the BlackBerry Tablet OS backlight by changing the system IdleMode property.
Authors: Jim Ing, Chris Del Col, Adam Stanley
- BlackBerry Tablet OS v 1.0.7.2670
Requires BlackBerry WebWorks SDK for Tablet OS v2.0 or higher
- PR 104184 defect logged: "Unable to change value of systemIdleMode to KEEP_AWAKE".
Have a problem with this extension? Log an Issue or contact the Author
-
Locate your BlackBerry WebWorks SDK for Tablet OS extensions directory using your File Explorer. Default path is C:\Program Files\Research In Motion\BlackBerry WebWorks SDK for TabletOS\bbwp\ext
-
Create a new blackberry.system.display directory in the ext directory
-
Download the source from this repository and unzip it to a location on your computer
-
Using File Explorer browse to this extension's downloaded source code Tablet\sleep\extension
-
Copy the library.xml file from the downloaded Tablet\sleep\extension directory to your new ext\blackberry.system.display directory
-
Copy the downloaded Tablet\sleep\extension\src directory to your new ext\blackberry.system.display\src directory
NOTE: Be sure to back-up this ext\blackberry.system.display directory in your WebWorks SDK extensions directory before performing a WebWorks SDK upgrade. Simply copy it back into the ext directory after you have completed your SDK upgrade.
Whenever you use the below feature id in any of your WebWorks applications this extension will be loaded for use.
<feature id="webworks.system.display" />
static boolean allowSleep
uri:
webworks://webworks/system/display/allowSleep/get
webworks://webworks/system/display/allowSleep/set
return:
{
"code" : "0",
"msg" : null,
"data" : {
"allowSleep" : "true"
}
}
function showStatus()
{
var status = webworks.system.display.allowSleep;
alert("Allow Sleep = " + status);
}
function preventSleep()
{
blackberry.system.display.allowSleep = false;
showStatus();
}
function allowSleep()
{
blackberry.system.display.allowSleep = true;
showStatus();
}