|
PebbleOS
|
Notification storage, alerting policy and Do Not Disturb. More...
Modules | |
| Action chaining window | |
| Menu window to pick a follow-up action of a chained action result. | |
| Alerts | |
| Decides whether and how the user is alerted for a call or notification. | |
| Alert preferences | |
| Persistent user preferences for alerts, Do Not Disturb and the speaker. | |
| Alert preferences (internal) | |
| Preferences backing the alerts, Do Not Disturb and notification UI services. | |
| Alerts settings | |
| Alert masks and settings accessors used by the settings UI. | |
| ANCS notifications | |
| Turns notifications received over the Apple Notification Center Service into items. | |
| Do Not Disturb | |
| Quiet Time state, combining manual, scheduled and calendar-aware activation. | |
| Do Not Disturb toggle | |
| Quiet Time toggle dialog. | |
| Notification constants | |
| Constants shared by the SMS reply and phone call UIs. | |
| Notification images | |
| Single slot holding the phone-supplied image of the notification on screen. | |
| Notification storage | |
| Flash storage for received notifications. | |
| Notification storage sizing | |
| Size of the notification storage file. | |
| Notification types | |
| Kinds of alerting items shared by notifications and reminders. | |
Data Structures | |
| struct | PebbleSysNotificationActionResult |
Result of an action, delivered in a PEBBLE_SYS_NOTIFICATION_EVENT. More... | |
Enumerations | |
| enum | ActionResultType { ActionResultTypeSuccess , ActionResultTypeFailure , ActionResultTypeChaining , ActionResultTypeDoResponse , ActionResultTypeSuccessANCSDismiss } |
| Outcome of an action invoked on a timeline item. More... | |
Functions | |
| void | notifications_init (void) |
| Initialize the notifications service. | |
| void | notifications_handle_notification_action_result (PebbleSysNotificationActionResult *action_result) |
| Post the result of an invoked action. | |
| void | notifications_handle_notification_added (Uuid *notification_id) |
| Announce that a notification was added to storage. | |
| void | notifications_handle_notification_acted_upon (Uuid *notification_id) |
| Announce that a stored notification was acted upon or updated on the phone. | |
| void | notifications_handle_notification_removed (Uuid *notification_id) |
| Announce that a notification was removed. | |
| void | notifications_migrate_timezone (const int new_tz_offset) |
| Shift the timestamps of all stored notifications after a timezone change. | |
| void | notifications_add_notification (TimelineItem *notification) |
| Store a notification and announce it to the system. | |
Notification storage, alerting policy and Do Not Disturb.
A notification is a TimelineItem of type TimelineItemTypeNotification (see Timeline items). Notifications arrive from the phone through the Notifs BlobDB, from ANCS on iOS (ANCS notifications) or are created on the watch. They are kept in a flash file (Notification storage) that is wiped at boot, and every change is announced to the UI with a PEBBLE_SYS_NOTIFICATION_EVENT.
Whether and how the user is alerted is decided by the alerts service (Alerts), which combines the user preferences (Alert preferences) with the Do Not Disturb state (Do Not Disturb).
Posting a notification created on the watch:
Removing it again:
| struct PebbleSysNotificationActionResult |
Result of an action, delivered in a PEBBLE_SYS_NOTIFICATION_EVENT.
Allocated on the kernel heap as a single block with the attributes and actions following the struct; the event loop frees it after dispatch.
| Data Fields | ||
|---|---|---|
| TimelineItemActionGroup | action_group | Follow-up actions, used with ActionResultTypeChaining. |
| AttributeList | attr_list | Result attributes, typically a message (title) and a large icon. |
| Uuid | id | Id of the item the action was invoked on. |
| ActionResultType | type | Outcome of the action. |
| enum ActionResultType |
Outcome of an action invoked on a timeline item.
| void notifications_add_notification | ( | TimelineItem * | notification | ) |
Store a notification and announce it to the system.
The item is serialized into storage, so the caller keeps ownership of notification.
| notification | Notification to add. |
| void notifications_handle_notification_acted_upon | ( | Uuid * | notification_id | ) |
Announce that a stored notification was acted upon or updated on the phone.
| notification_id | Id allocated on the kernel heap. Ownership passes to the event loop. |
| void notifications_handle_notification_action_result | ( | PebbleSysNotificationActionResult * | action_result | ) |
Post the result of an invoked action.
| action_result | Result allocated on the kernel heap, or NULL when there is no result to show. Ownership passes to the event loop. |
| void notifications_handle_notification_added | ( | Uuid * | notification_id | ) |
Announce that a notification was added to storage.
| notification_id | Id allocated on the kernel heap. Ownership passes to the event loop. |
| void notifications_handle_notification_removed | ( | Uuid * | notification_id | ) |
Announce that a notification was removed.
Only posts the event; remove the notification from storage with notification_storage_remove().
| notification_id | Id of the removed notification. It is copied. |
| void notifications_init | ( | void | ) |
Initialize the notifications service.
Initializes notification storage, which discards all stored notifications.
| void notifications_migrate_timezone | ( | const int | new_tz_offset | ) |
Shift the timestamps of all stored notifications after a timezone change.
| new_tz_offset | Offset in seconds subtracted from each stored timestamp. |