net.rim.device.api.notification
Class NotificationsManager
java.lang.Object
net.rim.device.api.notification.NotificationsManager
- All Implemented Interfaces:
- NotificationsConstants
public final class NotificationsManager
- extends Object
- implements NotificationsConstants
Manages the handling of events between applications and the notification
engine. Keeps track of registered engine listeners as well as known
consequence implementors.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
Fields inherited from interface net.rim.device.api.notification.NotificationsConstants |
CALLERID_ADDRESSCARD_UID, CASUAL, CONTINUOUS_REPEAT, CRITICAL, CUSTOM_TUNE_NAME, DEFAULT_LEVEL, FORCED, FORCE_NO_REPEAT_NOTIFICATIONS_FLAG, IGNORE_SENSOR_UPDATES, IMPORTANT, IN_HOLSTER_ENGINE_STATE, MANUAL_TRIGGER, NOTIFICATION_LEVEL_KEY, NOTIFICATION_PRIVATE_FLAG_KEY, NOTIFICATION_REPEAT_COUNT, NOTIFICATION_REPEAT_DELAY, NO_RELATED_SOURCE, NO_SOURCE, OUT_OF_HOLSTER_ENGINE_STATE, OUT_OF_HOLSTER_TRIGGER, SENSITIVE, STOP_CONDITIONS |
Method Summary |
|
static void |
cancelAllDeferredEvents(long sourceID,
int triggerIndex,
Object context)
Cancels all events matching the source, level and trigger. |
|
static void |
cancelDeferredEvent(long sourceID,
long eventID,
Object eventReference,
int triggerIndex,
Object context)
Cancels the event. |
|
static void |
cancelImmediateEvent(long sourceID,
long eventID,
Object eventReference,
Object context)
Cancels any current immediate events. |
|
static void |
deregisterConsequence(long consequenceID)
Removes the consequence from the list of known consequences. |
|
static void |
deregisterNotificationsEngineListener(long sourceID,
NotificationsEngineListener listener)
Removes the listener from the list of known listeneres. |
|
static void |
deregisterSource(long sourceID)
Removes the application from the list of known event sources. |
|
static int |
getDeferredEventCount(long sourceID)
Returns the count of all events matching the source currently in the queue. |
|
static long[] |
getDeferredEventIds(long sourceID)
Returns the count of all events matching the source currently in the queue. |
|
static Object[] |
getDeferredEvents(long sourceID)
Returns the count of all events matching the source currently in the queue. |
|
static long |
getLastEventDate()
Method returns time stamp when the latest even either immediate or deferred happened |
|
static int |
getMasterNotificationVolume()
Returns the master volume setting for notifications. |
|
static void |
hideSource(long sourceID)
Hide the application from the list of known event sources. |
|
static boolean |
isHidden(long sourceID)
Returns true if this source is marked as hidden. |
|
static boolean |
isImmediateEventOccuring(long sourceIdLong)
Tests whether a particular event is playing or led blinking for an profile |
|
static boolean |
isVibrateOnly()
Returns whether the device is in a Vibrate-Only mode. |
|
static void |
moveSource(long srcSourceID,
long destSourceID)
Changes the value of the source identifier specified by srcSourceID to destSourceID . |
|
static void |
negotiateDeferredEvent(long sourceID,
long eventID,
Object eventReference,
long eventDate,
int triggerIndex,
Object context)
Adds the specified event to the event queue. |
|
static void |
registerConsequence(long consequenceID,
Consequence consequence)
Adds a new consequence to the list of known event consequences. |
|
static void |
registerNotificationsEngineListener(long sourceID,
NotificationsEngineListener listener)
Adds a listener to the list of known engine listeners. |
|
static void |
registerSource(long sourceID,
Object source,
int level)
Adds the application to the list of known event sources. |
|
static void |
registerSource(long sourceID,
Object source,
int level,
long relatedSourceID)
Adds the application to the list of known event sources, inheriting defaults from another application. |
|
static void |
setPhoneRingTone(String ringtone)
Sets the ringtone for all profiles. |
|
static void |
triggerImmediateEvent(long sourceID,
long eventID,
Object eventReference,
Object context)
Triggers an immediate event. |
|
static void |
triggerImmediateEvent(long sourceID,
long eventID,
Object eventReference,
Object context,
int notificationCategory)
Triggers an immediate event. |
|
static void |
unHideSource(long sourceID)
Reveal a hidden the application from the list of known event sources. |
triggerImmediateEvent
public static void triggerImmediateEvent(long sourceID,
long eventID,
Object eventReference,
Object context)
- Triggers an immediate event. This is intended to support consequences such as tone,
vibration or the LED. In other words, things that do not require user interaction.
- Parameters:
sourceID
- Identifier of the application triggering the event.eventID
- Application-specific event identifier.eventReference
- Application-specific event cookie.context
- Optional context object.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
triggerImmediateEvent
public static void triggerImmediateEvent(long sourceID,
long eventID,
Object eventReference,
Object context,
int notificationCategory)
- Triggers an immediate event. This is intended to support consequences such as tone,
vibration or the LED. In other words, things that do not require user interaction.
- Parameters:
sourceID
- Identifier of the application triggering the event.eventID
- Application-specific event identifier.eventReference
- Application-specific event cookie.context
- Optional context object.notificationCategory
- identifies a category of notifications
one of NotificationsConstants.CATEGORY_PHONE
NotificationsConstants.CATEGORY_MESSAGES
NotificationsConstants.CATEGORY_REMINDERS
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.7.0
cancelImmediateEvent
public static void cancelImmediateEvent(long sourceID,
long eventID,
Object eventReference,
Object context)
- Cancels any current immediate events.
- Parameters:
sourceID
- Identifier of the application that triggered the event.eventID
- Application-specific event identifier.eventReference
- Application-specific event cookie.context
- Optional context object.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
negotiateDeferredEvent
public static void negotiateDeferredEvent(long sourceID,
long eventID,
Object eventReference,
long eventDate,
int triggerIndex,
Object context)
Adds the specified event to the event queue. Exactly where in the queue
the event is inserted is engine-specific, i.e., neither the event nor the application can decide it.
The triggerIndex parameter specifies further criteria for determining the event. Currently only two values
are defined:
- NotificationsConstants.OUT_OF_HOLSTER_TRIGGER
- NotificationsConstants.MANUAl_TRIGGER
If OUT_OF_HOLSTER_TRIGGER is specified, the event will occur when the device is next removed from the holster.
Furthermore, the event will expire on it's own if the eventDate time is reached.
Finally, the current implementation will drop this event if the device is NOT in the holster when this call is made.
If the value MANUAL_TRIGGER is specified as the triggerIndex, the eventDate expiry parameter is ignored.
An event can be cancelled via the cancelDeferredEvent
method. Furthermore, this call must be made to cancel an event that has no timeout.
- Parameters:
sourceID
- Identifier of the application that is queuing the event.eventID
- Application-specific event identifier.eventReference
- Application-specific event cookie.eventDate
- Event expiry time in absolute time in ms. This parameter is currently ignored
UNLESS the triggerIndex is NotificationsConstants.OUT_OF_HOLSTER_TRIGGERtriggerIndex
- Identifier of the way in which the event will be triggered.context
- Optional context object.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
cancelDeferredEvent
public static void cancelDeferredEvent(long sourceID,
long eventID,
Object eventReference,
int triggerIndex,
Object context)
- Cancels the event. This could be the current event being negotiated or a future
event still in the event queue.
- Parameters:
sourceID
- Identifier of the application that queued the event.eventID
- Application-specific event identifier.eventReference
- Application-specific event cookie.triggerIndex
- Identifier of the way in which the event was to be triggered.context
- Optional context object.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
cancelAllDeferredEvents
public static void cancelAllDeferredEvents(long sourceID,
int triggerIndex,
Object context)
- Cancels all events matching the source, level and trigger.
- Parameters:
sourceID
- Identifier of the application that queued the events.triggerIndex
- Identifier of the way in which the events were to be triggered.context
- Optional context object.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
getDeferredEventCount
public static int getDeferredEventCount(long sourceID)
- Returns the count of all events matching the source currently in the queue.
- Parameters:
sourceID
- GUID of the source object.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.0.2
getDeferredEvents
public static Object[] getDeferredEvents(long sourceID)
- Returns the count of all events matching the source currently in the queue.
- Parameters:
sourceID
- GUID of the source object.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.1.0
getDeferredEventIds
public static long[] getDeferredEventIds(long sourceID)
- Returns the count of all events matching the source currently in the queue.
- Parameters:
sourceID
- GUID of the source object.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.1.0
registerSource
public static void registerSource(long sourceID,
Object source,
int level,
long relatedSourceID)
- Adds the application to the list of known event sources, inheriting defaults from another application.
This allows appications to register sub types
(ie different settings for different email addresses, different
calendar sources etc (ie personal vs corprorate calendar reminders)
- Parameters:
sourceID
- Identifier of the application to register.source
- Source application object.level
- Level at which the application is to be registered.relatedSourceID
- Identifier of the application that this source will inherit from
- Throws:
NullPointerException
- if source
is null.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.0
moveSource
public static void moveSource(long srcSourceID,
long destSourceID)
- Changes the value of the source identifier specified by
srcSourceID
to destSourceID
.
If destSourceID
is already registered to another source, it will be overwritten by the
source identifier srcSourceID
and it will no longer be accessible.
- Parameters:
srcSourceID
- Old Identifier of the source.destSourceID
- New Identifier of the source.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.0
registerSource
public static void registerSource(long sourceID,
Object source,
int level)
- Adds the application to the list of known event sources.
- Parameters:
sourceID
- Identifier of the application to register.source
- Source application object.level
- Level at which the application is to be registered.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
deregisterSource
public static void deregisterSource(long sourceID)
- Removes the application from the list of known event sources.
- Parameters:
sourceID
- Identifier of the application to deregister.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
hideSource
public static void hideSource(long sourceID)
- Hide the application from the list of known event sources.
- Parameters:
sourceID
- Identifier of the application to hide.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.0
unHideSource
public static void unHideSource(long sourceID)
- Reveal a hidden the application from the list of known event sources.
- Parameters:
sourceID
- Identifier of the application to un hide.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.0
isHidden
public static boolean isHidden(long sourceID)
- Returns true if this source is marked as hidden.
- Returns:
- boolean true if this source is marked as hidden, false otherwise.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.2.0
registerNotificationsEngineListener
public static void registerNotificationsEngineListener(long sourceID,
NotificationsEngineListener listener)
- Adds a listener to the list of known engine listeners.
- Parameters:
sourceID
- GUID of the listener object to register.listener
- Listener object.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
deregisterNotificationsEngineListener
public static void deregisterNotificationsEngineListener(long sourceID,
NotificationsEngineListener listener)
- Removes the listener from the list of known listeneres.
- Parameters:
sourceID
- GUID of the listener object to deregister.listener
- Listener object.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
registerConsequence
public static void registerConsequence(long consequenceID,
Consequence consequence)
- Adds a new consequence to the list of known event consequences.
- Parameters:
consequenceID
- GUID of the consequence object to register.consequence
- Consequence object itself.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
deregisterConsequence
public static void deregisterConsequence(long consequenceID)
- Removes the consequence from the list of known consequences.
- Parameters:
consequenceID
- GUID of the consequence object to deregister.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 3.6.0
getLastEventDate
public static long getLastEventDate()
- Method returns time stamp when the latest even either immediate or deferred happened
- Returns:
- Time stamp when the latest even either immediate or deferred happened.
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.0.0
isImmediateEventOccuring
public static boolean isImmediateEventOccuring(long sourceIdLong)
- Tests whether a particular event is playing or led blinking for an profile
- Returns:
- True if it an immediate event is occuring
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.1.0
getMasterNotificationVolume
public static int getMasterNotificationVolume()
- Returns the master volume setting for notifications.
- Returns:
- the master volume setting as an integer from 0 (silent) to 100 (max)
- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.7.0
isVibrateOnly
public static boolean isVibrateOnly()
- Returns whether the device is in a Vibrate-Only mode.
- Returns:
true
if the device is in a Vibrate-Only mode, false
otherwise.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.7.0
setPhoneRingTone
public static void setPhoneRingTone(String ringtone)
- Sets the ringtone for all profiles.
- Parameters:
ringtone
- Filename of the ringtone to be set.- Category:
- Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
- Since:
- BlackBerry API 4.7.0
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