|
PebbleOS
|
Tracks the applications whose binaries are stored on the watch. More...
Functions | |
| void | app_cache_init (void) |
| Initialize the app cache. | |
| status_t | app_cache_add_entry (AppInstallId app_id, uint32_t total_size) |
| Add an entry for a newly installed app. | |
| status_t | app_cache_remove_entry (AppInstallId app_id) |
| Remove an app's entry and delete its binaries. | |
| bool | app_cache_entry_exists (AppInstallId app_id) |
| Check whether an app has an entry in the cache. | |
| status_t | app_cache_app_launched (AppInstallId app_id) |
| Record a launch of an app. | |
| status_t | app_cache_free_up_space (uint32_t bytes_needed) |
Evict apps until at least bytes_needed bytes of binaries are freed. | |
| void | app_cache_flush (void) |
| Clear the whole cache and delete all cached app binaries. | |
Tracks the applications whose binaries are stored on the watch.
Each entry records an app's size, install date, last launch and launch count, persisted in a settings file. When storage runs low, the entries with the lowest priority (least recently installed or launched) are evicted and their binaries deleted; the default watchface and worker and the quick launch apps are only evicted as a last resort. Removing an entry deletes the app's binaries and emits a PEBBLE_APP_CACHE_EVENT.
| status_t app_cache_add_entry | ( | AppInstallId | app_id, |
| uint32_t | total_size | ||
| ) |
Add an entry for a newly installed app.
Schedules an eviction on KernelBackground if free space is now too low.
| app_id | App to add. |
| total_size | Size of the app's binaries, in bytes. |
| status_t app_cache_app_launched | ( | AppInstallId | app_id | ) |
Record a launch of an app.
Updates the last launch time and launch count. If the app has no entry, its binaries are deleted.
| app_id | Launched app. |
| bool app_cache_entry_exists | ( | AppInstallId | app_id | ) |
Check whether an app has an entry in the cache.
An entry whose binaries are missing from storage is removed.
| app_id | App to look up. |
| void app_cache_flush | ( | void | ) |
Clear the whole cache and delete all cached app binaries.
Must be called from KernelBackground.
| status_t app_cache_free_up_space | ( | uint32_t | bytes_needed | ) |
Evict apps until at least bytes_needed bytes of binaries are freed.
| bytes_needed | Number of bytes to free. |
| S_SUCCESS | Success. |
| E_INVALID_ARGUMENT | bytes_needed is 0. |
| void app_cache_init | ( | void | ) |
Initialize the app cache.
Deletes leftover app binaries when no cache file exists and purges orphaned resource files.
| status_t app_cache_remove_entry | ( | AppInstallId | app_id | ) |
Remove an app's entry and delete its binaries.
| app_id | App to remove. |