|
PebbleOS
|
Preferences backing the alerts, Do Not Disturb and notification UI services. More...
Macros | |
| #define | NOTIF_WINDOW_TIMEOUT_INFINITE ((uint32_t)~0) |
| Notification window timeout meaning "never time out". | |
| #define | NOTIF_WINDOW_TIMEOUT_DEFAULT (3 * PBL_MSEC_PER_MIN) |
| Default notification window timeout, in milliseconds. | |
| #define | NOTIF_WINDOW_TIMEOUT_MIN (15 * PBL_MSEC_PER_SEC) |
| Shortest notification window timeout, in milliseconds. | |
| #define | NotificationContentSizeSystem ((PreferredContentSize)NumPreferredContentSizes) |
| Notification content size value meaning "follow the system content size". | |
Enumerations | |
| enum | NotificationGroupingRange { NotificationGroupingRange_Never = 0 , NotificationGroupingRange_OneDay , NotificationGroupingRange_OneWeek , NotificationGroupingRange_All , NotificationGroupingRangeCount } |
| Age range within which notifications from the same sender are grouped. More... | |
| enum | NotificationStatusBarStyle { NotificationStatusBarStyle_Default = 0 , NotificationStatusBarStyle_Bold = 1 , NotificationStatusBarStyle_LargeBold = 2 , NotificationStatusBarStyleCount } |
| Style of the clock in the notification window status bar. More... | |
Functions | |
| void | alerts_preferences_init (void) |
| Load all preferences from the settings file, migrating legacy keys. | |
| AlertMask | alerts_preferences_get_alert_mask (void) |
| Get the alert mask. | |
| void | alerts_preferences_set_alert_mask (AlertMask mask) |
| Set the alert mask. | |
| AlertMask | alerts_preferences_dnd_get_mask (void) |
| Get the Do Not Disturb mask. | |
| void | alerts_preferences_dnd_set_mask (AlertMask mask) |
| Set the Do Not Disturb mask. | |
| uint32_t | alerts_preferences_get_notification_window_timeout_ms (void) |
| Get the notification window timeout. | |
| void | alerts_preferences_set_notification_window_timeout_ms (uint32_t timeout_ms) |
| Set the notification window timeout. | |
| bool | alerts_preferences_get_notification_alternative_design (void) |
| Get whether notifications use the alternative design. | |
| void | alerts_preferences_set_notification_alternative_design (bool alternative) |
| Set whether notifications use the alternative design. | |
| bool | alerts_preferences_get_notification_vibe_delay (void) |
| Get whether the notification vibration is delayed. | |
| void | alerts_preferences_set_notification_vibe_delay (bool delay) |
| Set whether the notification vibration is delayed. | |
| bool | alerts_preferences_get_notification_backlight (void) |
| Get whether notifications turn on the backlight. | |
| void | alerts_preferences_set_notification_backlight (bool enable) |
| Set whether notifications turn on the backlight. | |
| NotificationGroupingRange | alerts_preferences_get_notification_grouping_range (void) |
| Get the notification grouping range. | |
| void | alerts_preferences_set_notification_grouping_range (NotificationGroupingRange range) |
| Set the notification grouping range. | |
| NotificationStatusBarStyle | alerts_preferences_get_notification_status_bar_style (void) |
| Get the notification status bar style. | |
| void | alerts_preferences_set_notification_status_bar_style (NotificationStatusBarStyle style) |
| Set the notification status bar style. | |
| PreferredContentSize | alerts_preferences_get_notification_content_size (void) |
| Get the notification content size. | |
| void | alerts_preferences_set_notification_content_size (PreferredContentSize size) |
| Set the notification content size. | |
| bool | alerts_preferences_get_vibrate (void) |
| Get whether notifications vibrate. | |
| void | alerts_preferences_set_vibrate (bool enable) |
| Set whether notifications vibrate. | |
| VibeIntensity | alerts_preferences_get_vibe_intensity (void) |
| Get the legacy vibration intensity. | |
| void | alerts_preferences_set_vibe_intensity (VibeIntensity intensity) |
| Set the legacy vibration intensity. | |
| VibeScoreId | alerts_preferences_get_vibe_score_for_client (VibeClient client) |
| Get the vibration pattern used for a vibe client. | |
| void | alerts_preferences_set_vibe_score_for_client (VibeClient client, VibeScoreId id) |
| Set the vibration pattern used for a vibe client. | |
| bool | alerts_preferences_dnd_is_manually_enabled (void) |
| Get the stored manual DND state. | |
| void | alerts_preferences_dnd_set_manually_enabled (bool enable) |
| Store the manual DND state. | |
| void | alerts_preferences_dnd_get_schedule (DoNotDisturbScheduleType type, DoNotDisturbSchedule *schedule_out) |
| Get a DND schedule. | |
| void | alerts_preferences_dnd_set_schedule (DoNotDisturbScheduleType type, const DoNotDisturbSchedule *schedule) |
| Store a DND schedule. | |
| bool | alerts_preferences_dnd_is_schedule_enabled (DoNotDisturbScheduleType type) |
| Get whether a DND schedule is enabled. | |
| void | alerts_preferences_dnd_set_schedule_enabled (DoNotDisturbScheduleType type, bool enable) |
| Store whether a DND schedule is enabled. | |
| bool | alerts_preferences_dnd_is_smart_enabled (void) |
| Get whether calendar-aware (smart) DND is enabled. | |
| void | alerts_preferences_dnd_set_smart_enabled (bool enable) |
| Store whether calendar-aware (smart) DND is enabled. | |
| void | alerts_preferences_lock (void) |
| Lock the alerts preferences mutex. | |
| void | alerts_preferences_unlock (void) |
| Unlock the alerts preferences mutex. | |
| void | alerts_preferences_handle_blob_db_event (PebbleBlobDBEvent *event) |
| Process a BlobDB event for notification preferences. | |
Preferences backing the alerts, Do Not Disturb and notification UI services.
Setters update the cached value and persist it in the notifpref settings file. Values written by the phone through BlobDB are reloaded by alerts_preferences_handle_blob_db_event().
| #define NOTIF_WINDOW_TIMEOUT_DEFAULT (3 * PBL_MSEC_PER_MIN) |
Default notification window timeout, in milliseconds.
| #define NOTIF_WINDOW_TIMEOUT_INFINITE ((uint32_t)~0) |
Notification window timeout meaning "never time out".
| #define NOTIF_WINDOW_TIMEOUT_MIN (15 * PBL_MSEC_PER_SEC) |
Shortest notification window timeout, in milliseconds.
| #define NotificationContentSizeSystem ((PreferredContentSize)NumPreferredContentSizes) |
Notification content size value meaning "follow the system content size".
Age range within which notifications from the same sender are grouped.
| AlertMask alerts_preferences_dnd_get_mask | ( | void | ) |
Get the Do Not Disturb mask.
| void alerts_preferences_dnd_get_schedule | ( | DoNotDisturbScheduleType | type, |
| DoNotDisturbSchedule * | schedule_out | ||
| ) |
Get a DND schedule.
| type | Schedule to get. | |
| [out] | schedule_out | Schedule. |
| bool alerts_preferences_dnd_is_manually_enabled | ( | void | ) |
Get the stored manual DND state.
| bool alerts_preferences_dnd_is_schedule_enabled | ( | DoNotDisturbScheduleType | type | ) |
Get whether a DND schedule is enabled.
| type | Schedule to check. |
| bool alerts_preferences_dnd_is_smart_enabled | ( | void | ) |
Get whether calendar-aware (smart) DND is enabled.
| void alerts_preferences_dnd_set_manually_enabled | ( | bool | enable | ) |
Store the manual DND state.
Use do_not_disturb_set_manually_enabled() to also update the DND state.
| enable | true to turn manual DND on. |
| void alerts_preferences_dnd_set_mask | ( | AlertMask | mask | ) |
Set the Do Not Disturb mask.
| mask | Alert types that may still vibrate or light the backlight while DND is active. |
| void alerts_preferences_dnd_set_schedule | ( | DoNotDisturbScheduleType | type, |
| const DoNotDisturbSchedule * | schedule | ||
| ) |
Store a DND schedule.
| type | Schedule to set. |
| schedule | New schedule. |
| void alerts_preferences_dnd_set_schedule_enabled | ( | DoNotDisturbScheduleType | type, |
| bool | enable | ||
| ) |
Store whether a DND schedule is enabled.
| type | Schedule to change. |
| enable | true to enable. |
| void alerts_preferences_dnd_set_smart_enabled | ( | bool | enable | ) |
Store whether calendar-aware (smart) DND is enabled.
| enable | true to enable. |
| AlertMask alerts_preferences_get_alert_mask | ( | void | ) |
Get the alert mask.
A legacy "all on" mask is migrated to AlertMaskAllOn.
| bool alerts_preferences_get_notification_alternative_design | ( | void | ) |
Get whether notifications use the alternative design.
| bool alerts_preferences_get_notification_backlight | ( | void | ) |
Get whether notifications turn on the backlight.
| PreferredContentSize alerts_preferences_get_notification_content_size | ( | void | ) |
Get the notification content size.
| NotificationGroupingRange alerts_preferences_get_notification_grouping_range | ( | void | ) |
Get the notification grouping range.
| NotificationStatusBarStyle alerts_preferences_get_notification_status_bar_style | ( | void | ) |
Get the notification status bar style.
| bool alerts_preferences_get_notification_vibe_delay | ( | void | ) |
Get whether the notification vibration is delayed.
| uint32_t alerts_preferences_get_notification_window_timeout_ms | ( | void | ) |
Get the notification window timeout.
| VibeIntensity alerts_preferences_get_vibe_intensity | ( | void | ) |
Get the legacy vibration intensity.
| VibeScoreId alerts_preferences_get_vibe_score_for_client | ( | VibeClient | client | ) |
Get the vibration pattern used for a vibe client.
| client | Vibe client. |
client. | bool alerts_preferences_get_vibrate | ( | void | ) |
Get whether notifications vibrate.
| void alerts_preferences_handle_blob_db_event | ( | PebbleBlobDBEvent * | event | ) |
Process a BlobDB event for notification preferences.
For BlobDBEventTypeInsert events, reloads the cached copy of the preference whose key was written. A change to a DND state preference also re-evaluates the DND state.
| event | BlobDB event. |
| void alerts_preferences_init | ( | void | ) |
Load all preferences from the settings file, migrating legacy keys.
| void alerts_preferences_lock | ( | void | ) |
Lock the alerts preferences mutex.
Must be paired with alerts_preferences_unlock().
| void alerts_preferences_set_alert_mask | ( | AlertMask | mask | ) |
Set the alert mask.
| mask | Alert types that may alert the user. |
| void alerts_preferences_set_notification_alternative_design | ( | bool | alternative | ) |
Set whether notifications use the alternative design.
| alternative | true for the alternative (black banner) design. |
| void alerts_preferences_set_notification_backlight | ( | bool | enable | ) |
Set whether notifications turn on the backlight.
| enable | true to enable. |
| void alerts_preferences_set_notification_content_size | ( | PreferredContentSize | size | ) |
Set the notification content size.
| size | Content size or NotificationContentSizeSystem; larger values are ignored. |
| void alerts_preferences_set_notification_grouping_range | ( | NotificationGroupingRange | range | ) |
Set the notification grouping range.
| range | Grouping range. |
| void alerts_preferences_set_notification_status_bar_style | ( | NotificationStatusBarStyle | style | ) |
Set the notification status bar style.
| style | Status bar style. |
| void alerts_preferences_set_notification_vibe_delay | ( | bool | delay | ) |
Set whether the notification vibration is delayed.
| delay | true to vibrate at the end of the notification animation. |
| void alerts_preferences_set_notification_window_timeout_ms | ( | uint32_t | timeout_ms | ) |
Set the notification window timeout.
| timeout_ms | Timeout in milliseconds, or NOTIF_WINDOW_TIMEOUT_INFINITE. |
| void alerts_preferences_set_vibe_intensity | ( | VibeIntensity | intensity | ) |
Set the legacy vibration intensity.
| intensity | Vibration intensity. |
| void alerts_preferences_set_vibe_score_for_client | ( | VibeClient | client, |
| VibeScoreId | id | ||
| ) |
Set the vibration pattern used for a vibe client.
| client | Vibe client. |
| id | Vibe score to use. |
| void alerts_preferences_set_vibrate | ( | bool | enable | ) |
Set whether notifications vibrate.
| enable | true to vibrate. |
| void alerts_preferences_unlock | ( | void | ) |
Unlock the alerts preferences mutex.
Must be paired with alerts_preferences_lock().