|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.system.Device
public final class Device
Various utility methods affecting fundamental operation of the Device.
Field Summary | ||
---|---|---|
|
static long |
DEFAULT_DEVICE_TIME
The default device time to set, when the device has just been powered up, and the OS has no valid date set. |
Method Summary | ||
---|---|---|
|
static boolean |
requestPowerOff(boolean allowAutoOn)
Requests that the Device power down. |
|
static boolean |
requestStorageMode()
Requests that the Device go into storage mode. |
|
static boolean |
setDateTime(long dateTimeMillis)
Sets the Device's current date and time. |
|
static void |
setTimeZone(TimeZone timeZone)
Sets the device's current time zone. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_DEVICE_TIME
Method Detail |
---|
public static boolean requestPowerOff(boolean allowAutoOn)
This method may return false if power down is not possible as the serial port is owned by an application. This prevents events such as auto shut-off from shutting the handheld down while it is synchronizing with the desktop.
allowAutoOn
- If true, the device can be turned back on
automatically by a scheduled application (see
ApplicationManager.scheduleApplication(net.rim.device.api.system.ApplicationDescriptor, long, boolean)
).
ControlledAccessException
- if the calling application does not have permission to
change device settings.public static boolean requestStorageMode()
Currently, this method always returns true.
ControlledAccessException
- if the calling application does not have permission to
change device settings.public static boolean setDateTime(long dateTimeMillis)
The date cannot be earlier than January 1, 2002.
You can retrieve the current date and time
by invoking System.currentTimeMillis()
.
dateTimeMillis
- Ticks of desired date since origin time
(i.e. midnight UTC, January 1st, 1970).
ControlledAccessException
- if the calling application does not have permission to
change device settings.public static void setTimeZone(TimeZone timeZone)
TimeZoneUtilities.getAvailableTimeZones()
.
The device's current time zone can be retrieved by invoking TimeZone.getDefault()
.
timeZone
- The device's new time zone.
NullPointerException
- if timeZone is null.
IllegalArgumentException
- if timeZone is not a supported time zone.
ControlledAccessException
- if the calling application does not have permission to
change device settings.TimeZoneUtilities
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal