Constants | ||
---|---|---|
int | INVALID_ID | Invalid id |
Fields | ||
---|---|---|
public static final java.lang.String | EVENT_ID | Event Id to use in projection, selection and sortOrder when quering URI |
Public Methods | |
---|---|
static long |
getSourceId(Context context, java.lang.String extensionSpecificId)
Get source id associated with extension specific id of the source. |
static java.lang.String |
getExtensionSpecificId(Context context, long sourceId)
Get extension specific id. |
static int |
deleteAllEvents(Context context, java.lang.String extensionSpecificId)
Delete all events associated with a extension specific id |
static int |
deleteAllEvents(Context context)
Delete all events associated with this extension |
static int |
markAllEventsAsRead(Context context)
Mark all events as read |
static Uri |
addEvent(Context context, ContentValues eventValues)
Add new event to Event table |
static java.util.ArrayList<java.lang.Integer> |
getSourceIds(Context context, boolean enabled)
Get source ids associated with extension. |
static java.util.ArrayList<java.lang.String> |
getExtensionSpecificIds(Context context)
Get Extension Specific Ids associated with an extension. |
static java.util.ArrayList<java.lang.Long> |
getSourceIds(Context context)
Get all source ids associated with extension |
static java.lang.String |
getFriendKey(Context context, long eventId)
Get friend key associated with event id |
static Cursor |
queryEvents(Context context, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)
Query URI, limit query to affect events in this extension only. |
static Cursor |
queryEventsFromEnabledSources(Context context, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)
Query URI, limit query to affect events in this extension only and sources that are enabled. |
static int |
updateEvents(Context context, ContentValues values, java.lang.String where, java.lang.String[] selectionArgs)
Update events, limit update to affect events in this extension only. |
static int |
deleteEvents(Context context, java.lang.String where, java.lang.String[] selectionArgs)
Delete events, limit delete to affect events in this extension only. |
static java.lang.String |
getEventsWhere(Context context)
Get where string that limits a queries to URI to affect events that belongs to this extension only |
static Cursor |
querySources(Context context, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)
Query sources, limit scope to sources in this extension |
static int |
updateSources(Context context, ContentValues values, java.lang.String where, java.lang.String[] selectionArgs)
Update sources, limit scope to sources in this extension |
static int |
deleteSources(Context context, java.lang.String where, java.lang.String[] selectionArgs)
Delete sources, limit scope to sources in this extension |
static java.lang.String |
getSourcesWhere(Context context)
Get where string that limits a queries to URI and URI to affect sources and source events that belongs to this extension only |
Invalid id
Constant Value: -1 (0xffffffffffffffff)
Event Id to use in projection, selection and sortOrder when quering URI
Get source id associated with extension specific id of the source.
context | Context with permissions to access Notification db |
---|---|
extensionSpecificId | Extension specific identifier of the source. |
Source id, INVALID_ID if not found
Get extension specific id.
context | Context with permissions to access Notification db |
---|---|
sourceId | The source id. |
Extension specific id, null if not found
Delete all events associated with a extension specific id
context | The context. |
---|---|
extensionSpecificId | The extension specific id |
The number of events that was deleted or INVALID_ID on failure
Delete all events associated with this extension
context | The context. |
---|
The number of events that was deleted or INVALID_ID on failure
Mark all events as read
context |
---|
Number of updated rows in event table, INVALID_ID on failure
Add new event to Event table
context | Context with permissions to access Notification db |
---|---|
eventValues | A reference to the notification com.sonyericsson.extras .liveware.aef.notification.Notification. |
Uri to the created event
Get source ids associated with extension.
context | Context with permissions to access Notification db |
---|---|
enabled |
Source ids, empty array if not found
Get Extension Specific Ids associated with an extension.
context | Context with permissions to access Notification db |
---|
Extension Specific Ids ids for enabled sources, empty array if not found
Get all source ids associated with extension
context | Context with permissions to access Notification db |
---|
All source ids, empty array if not found
Get friend key associated with event id
context | Context with permissions to access Notification db |
---|---|
eventId | Id of event |
Event title or null if not found.
Query URI, limit query to affect events in this extension only. Returned cursor is a join between URI and URI. Queries executed on URI can also be executed by this method if all references to _ID are replaced with event._id
This method is mainly aimed for extensions that shares user id and process in which case they can access and modify data that belongs to other extensions.
Note that no runtime exceptions, such as SecurityException and SQLException, will be handled by this method. Exceptions shall instead be handled in the calling method if needed.
This method is also convenient when querying events that belongs to a specific EXTENSION_SPECIFIC_ID since no extra lookup of the source id is needed.
context | The context |
---|---|
projection | A list of which columns to return. Passing null will return all columns, which is inefficient. The projection can contain all columns in Notification.EventColumns and all columns in Notification.SourceColumns except for _ID |
selection | A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given URI. |
selectionArgs | Arguments to where String |
sortOrder | How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered. |
A Cursor object, which is positioned before the first entry, or null
Query URI, limit query to affect events in this extension only and sources that are enabled. Returned cursor is a join between URI and URI. Queries executed on URI can also be executed by this method if all references to _ID are replaced with event._id
This method is mainly aimed for extensions that shares user id and process in which case they can access and modify data that belongs to other extensions.
Note that no runtime exceptions, such as SecurityException and SQLException, will be handled by this method. Exceptions shall instead be handled in the calling method if needed.
This method is also convenient when querying events that belongs to a specific EXTENSION_SPECIFIC_ID since no extra lookup of the source id is needed.
context | The context |
---|---|
projection | A list of which columns to return. Passing null will return all columns, which is inefficient. The projection can contain all columns in Notification.EventColumns and all columns in Notification.SourceColumns except for _ID |
selection | A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given URI. |
selectionArgs | Arguments to where String |
sortOrder | How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered. |
A Cursor object, which is positioned before the first entry, or null
Update events, limit update to affect events in this extension only.
This method is mainly aimed for extensions that shares user id and process in which case they can access and modify data that belongs to other extensions.
Note that no runtime exceptions, such as SecurityException and SQLException, will be handled by this method. Exceptions shall instead be handled in the calling method if needed.
context | The context |
---|---|
values | The new field values. The key is the column name for the field. A null value will remove an existing field value. |
where | A filter to apply to rows before updating, formatted as an SQL WHERE clause (excluding the WHERE itself). |
selectionArgs | Arguments to where String |
The number of rows updated
Delete events, limit delete to affect events in this extension only.
This method is mainly aimed for extensions that shares user id and process in which case they can access and modify data that belongs to other extensions.
Note that no runtime exceptions, such as SecurityException and SQLException, will be handled by this method. Exceptions shall instead be handled in the calling method if needed.
context | The context |
---|---|
where | A filter to apply to rows before deleting, formatted as an SQL WHERE clause (excluding the WHERE itself). |
selectionArgs | Arguments to where String |
The number of rows deleted
Get where string that limits a queries to URI to affect events that belongs to this extension only
context | The context |
---|
The where string:
Template: sourceId IN ( sourceId1, sourceId2, ... )
Query sources, limit scope to sources in this extension
This method is mainly aimed for extensions that shares user id and process in which case they can access and modify data that belongs to other extensions.
Note that no runtime exceptions, such as SecurityException and SQLException, will be handled by this method. Exceptions shall instead be handled in the calling method if needed.
context | The context |
---|---|
projection | A list of which columns to return. Passing null will return all columns, which is inefficient. |
selection | A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given URI. |
selectionArgs | Arguments to where String |
sortOrder | How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered. |
A Cursor object, which is positioned before the first entry, or null
Update sources, limit scope to sources in this extension
This method is mainly aimed for extensions that shares user id and process in which case they can access and modify data that belongs to other extensions.
Note that no runtime exceptions, such as SecurityException and SQLException, will be handled by this method. Exceptions shall instead be handled in the calling method if needed.
context | The context |
---|---|
values | The new field values. The key is the column name for the field. A null value will remove an existing field value. |
where | A filter to apply to rows before updating, formatted as an SQL WHERE clause (excluding the WHERE itself). |
selectionArgs | Arguments to where String |
The number of rows updated
Delete sources, limit scope to sources in this extension
This method is mainly aimed for extensions that shares user id and process in which case they can access and modify data that belongs to other extensions.
Note that no runtime exceptions, such as SecurityException and SQLException, will be handled by this method. Exceptions shall instead be handled in the calling method if needed.
context | The context |
---|---|
where | A filter to apply to rows before deleting, formatted as an SQL WHERE clause (excluding the WHERE itself). |
selectionArgs | Arguments to where String |
The number of rows deleted
Get where string that limits a queries to URI and URI to affect sources and source events that belongs to this extension only
context | The context |
---|
The where string