PebbleOS v4.47.0-512-g5285d4236
Loading...
Searching...
No Matches

Builds timeline items from ANCS notifications. More...

Functions

TimelineItem * ancs_item_create_and_populate (const struct pbl_bt_ancs_attr *const *notif_attributes, const struct pbl_bt_ancs_attr *const *app_attributes, const ANCSAppMetadata *app_metadata, iOSNotifPrefs *notif_prefs, time_t timestamp, const struct pbl_bt_ancs_notif *notif)
 Create a timeline item from ANCS data.
 
void ancs_item_update_dismiss_action (TimelineItem *item, uint32_t uid, const struct pbl_bt_ancs_attr *attr_action_neg)
 Replace the dismiss action of an item with an ANCS negative action.
 

Detailed Description

Builds timeline items from ANCS notifications.

Function Documentation

◆ ancs_item_create_and_populate()

TimelineItem * ancs_item_create_and_populate ( const struct pbl_bt_ancs_attr *const *  notif_attributes,
const struct pbl_bt_ancs_attr *const *  app_attributes,
const ANCSAppMetadata *  app_metadata,
iOSNotifPrefs *  notif_prefs,
time_t  timestamp,
const struct pbl_bt_ancs_notif *  notif 
)

Create a timeline item from ANCS data.

Strings that reach the ANCS length limit are ellipsized. Actions are, in order, the ANCS positive and negative actions followed by the actions from notif_prefs.

Parameters
notif_attributesNotification attributes, indexed by enum ancs_notif_attr.
app_attributesApp attributes (the display name), indexed by enum ancs_app_attr.
app_metadataIcon and color of the app.
notif_prefsiOS notification prefs of the app, may be NULL.
timestampTime the notification occurred.
notifThe notification, as the phone told of it.
Returns
New item allocated on the calling task's heap (free with timeline_item_destroy()), or NULL if out of memory. Header fields other than the timestamp are left for the caller.

◆ ancs_item_update_dismiss_action()

void ancs_item_update_dismiss_action ( TimelineItem *  item,
uint32_t  uid,
const struct pbl_bt_ancs_attr *  attr_action_neg 
)

Replace the dismiss action of an item with an ANCS negative action.

The item's buffer is reallocated; pointers into the old one become invalid.

Parameters
[in,out]itemItem to update. Nothing happens if it has no dismiss action.
uidANCS UID of the notification whose negative action is used.
attr_action_negNegative action label from that notification.