PebbleOS
Loading...
Searching...
No Matches
Data Structures | Functions
iOS notification preferences

Per-app notification preferences for iOS (BlobDBIdiOSNotifPref). More...

Data Structures

struct  iOSNotifPrefs
 Notification preferences of an iOS app. More...
 

Functions

iOSNotifPrefs * ios_notif_pref_db_get_prefs (const uint8_t *app_id, int length)
 Get the preferences of an iOS app.
 
void ios_notif_pref_db_free_prefs (iOSNotifPrefs *prefs)
 Free preferences returned by ios_notif_pref_db_get_prefs().
 
status_t ios_notif_pref_db_store_prefs (const uint8_t *app_id, int length, AttributeList *attr_list, TimelineItemActionGroup *action_group)
 Add or update the preferences of an iOS app.
 
void ios_notif_pref_db_init (void)
 Initialize the iOS notification preferences database.
 
status_t ios_notif_pref_db_insert (const uint8_t *key, int key_len, const uint8_t *val, int val_len)
 Insert or replace a record in the iOS notification preferences database.
 
int ios_notif_pref_db_get_len (const uint8_t *key, int key_len)
 Get the length of a record in the iOS notification preferences database.
 
status_t ios_notif_pref_db_read (const uint8_t *key, int key_len, uint8_t *val_out, int val_out_len)
 Read a record from the iOS notification preferences database.
 
status_t ios_notif_pref_db_delete (const uint8_t *key, int key_len)
 Delete a record from the iOS notification preferences database.
 
status_t ios_notif_pref_db_flush (void)
 Delete all records of the iOS notification preferences database.
 
status_t ios_notif_pref_db_compact (void)
 Compact the settings file backing the iOS notification preferences database.
 
status_t ios_notif_pref_db_is_dirty (bool *is_dirty_out)
 Check whether the iOS notification preferences database holds unsynced records.
 
BlobDBDirtyItem * ios_notif_pref_db_get_dirty_list (void)
 Build the list of unsynced records of the iOS notification preferences database.
 
status_t ios_notif_pref_db_mark_synced (const uint8_t *key, int key_len)
 Mark a record of the iOS notification preferences database as synced.
 

Detailed Description

Per-app notification preferences for iOS (BlobDBIdiOSNotifPref).

On iOS the watch receives notifications directly from ANCS, so the phone app cannot process or filter them. This database stores per-app preferences so the firmware can do it.


Data Structure Documentation

◆ iOSNotifPrefs

struct iOSNotifPrefs

Notification preferences of an iOS app.

Data Fields
TimelineItemActionGroup action_group Actions offered on the app's notifications.
AttributeList attr_list Preference attributes.

Function Documentation

◆ ios_notif_pref_db_compact()

status_t ios_notif_pref_db_compact ( void  )

Compact the settings file backing the iOS notification preferences database.

Returns
S_SUCCESS on success, an error code otherwise.

◆ ios_notif_pref_db_delete()

status_t ios_notif_pref_db_delete ( const uint8_t *  key,
int  key_len 
)

Delete a record from the iOS notification preferences database.

The key is the iOS app identifier.

Parameters
keyKey data.
key_lenLength of key in bytes.
Returns
S_SUCCESS on success, an error code otherwise.

◆ ios_notif_pref_db_flush()

status_t ios_notif_pref_db_flush ( void  )

Delete all records of the iOS notification preferences database.

Returns
S_SUCCESS on success, an error code otherwise.

◆ ios_notif_pref_db_free_prefs()

void ios_notif_pref_db_free_prefs ( iOSNotifPrefs *  prefs)

Free preferences returned by ios_notif_pref_db_get_prefs().

Parameters
prefsPreferences to free.

◆ ios_notif_pref_db_get_dirty_list()

BlobDBDirtyItem * ios_notif_pref_db_get_dirty_list ( void  )

Build the list of unsynced records of the iOS notification preferences database.

Returns
Heap-allocated list (free with blob_db_util_free_dirty_list()), NULL if none.

◆ ios_notif_pref_db_get_len()

int ios_notif_pref_db_get_len ( const uint8_t *  key,
int  key_len 
)

Get the length of a record in the iOS notification preferences database.

The key is the iOS app identifier.

Parameters
keyKey data.
key_lenLength of key in bytes.
Returns
Length of the value in bytes, 0 if not found, or a negative error code.

◆ ios_notif_pref_db_get_prefs()

iOSNotifPrefs * ios_notif_pref_db_get_prefs ( const uint8_t *  app_id,
int  length 
)

Get the preferences of an iOS app.

Parameters
app_idiOS app identifier, e.g. com.apple.MobileSMS, not NUL-terminated.
lengthLength of app_id in bytes.
Returns
Kernel heap allocated preferences, NULL if none are stored. Free with ios_notif_pref_db_free_prefs().

◆ ios_notif_pref_db_init()

void ios_notif_pref_db_init ( void  )

Initialize the iOS notification preferences database.

◆ ios_notif_pref_db_insert()

status_t ios_notif_pref_db_insert ( const uint8_t *  key,
int  key_len,
const uint8_t *  val,
int  val_len 
)

Insert or replace a record in the iOS notification preferences database.

The key is the iOS app identifier.

Parameters
keyKey data.
key_lenLength of key in bytes.
valValue data.
val_lenLength of val in bytes.
Returns
S_SUCCESS on success, an error code otherwise.

◆ ios_notif_pref_db_is_dirty()

status_t ios_notif_pref_db_is_dirty ( bool *  is_dirty_out)

Check whether the iOS notification preferences database holds unsynced records.

Parameters
[out]is_dirty_outSet to true if at least one record is dirty.
Returns
S_SUCCESS on success, an error code otherwise.

◆ ios_notif_pref_db_mark_synced()

status_t ios_notif_pref_db_mark_synced ( const uint8_t *  key,
int  key_len 
)

Mark a record of the iOS notification preferences database as synced.

The key is the iOS app identifier.

Parameters
keyKey data.
key_lenLength of key in bytes.
Returns
S_SUCCESS on success, an error code otherwise.

◆ ios_notif_pref_db_read()

status_t ios_notif_pref_db_read ( const uint8_t *  key,
int  key_len,
uint8_t *  val_out,
int  val_out_len 
)

Read a record from the iOS notification preferences database.

The key is the iOS app identifier.

Parameters
keyKey data.
key_lenLength of key in bytes.
[out]val_outBuffer for the value.
val_out_lenSize of val_out in bytes.
Returns
S_SUCCESS on success, an error code otherwise.

◆ ios_notif_pref_db_store_prefs()

status_t ios_notif_pref_db_store_prefs ( const uint8_t *  app_id,
int  length,
AttributeList *  attr_list,
TimelineItemActionGroup *  action_group 
)

Add or update the preferences of an iOS app.

The record is marked dirty and synced to the phone.

Parameters
app_idiOS app identifier, e.g. com.apple.MobileSMS, not NUL-terminated.
lengthLength of app_id in bytes.
attr_listPreference attributes.
action_groupActions offered on the app's notifications.
Returns
S_SUCCESS on success, an error code otherwise.