Per-app notification preferences for iOS (BlobDBIdiOSNotifPref).
More...
|
| 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.
|
| |
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.
◆ iOSNotifPrefs
Notification preferences of an iOS app.
◆ 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
-
| key | Key data. |
| key_len | Length 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()
◆ ios_notif_pref_db_get_dirty_list()
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
-
| key | Key data. |
| key_len | Length 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_id | iOS app identifier, e.g. com.apple.MobileSMS, not NUL-terminated. |
| length | Length 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
-
| key | Key data. |
| key_len | Length of key in bytes. |
| val | Value data. |
| val_len | Length 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_out | Set 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
-
| key | Key data. |
| key_len | Length 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
-
| key | Key data. |
| key_len | Length of key in bytes. |
| [out] | val_out | Buffer for the value. |
| val_out_len | Size of val_out in bytes. |
- Returns
S_SUCCESS on success, an error code otherwise.
◆ ios_notif_pref_db_store_prefs()
Add or update the preferences of an iOS app.
The record is marked dirty and synced to the phone.
- Parameters
-
| app_id | iOS app identifier, e.g. com.apple.MobileSMS, not NUL-terminated. |
| length | Length of app_id in bytes. |
| attr_list | Preference attributes. |
| action_group | Actions offered on the app's notifications. |
- Returns
S_SUCCESS on success, an error code otherwise.