|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Register a single lockscreen quick-action for background plugins. More...
Functions | |
| int | host_lockscreen_register_action (const char *label_key, uint32_t action_id) |
| Publish (or replace) the plugin's lockscreen quick-action. | |
| int | host_lockscreen_unregister_action (void) |
| Remove the plugin's lockscreen quick-action. | |
| int | host_lockscreen_alert (const char *text, uint8_t icon, uint32_t action_id) |
| Raise a persistent Y/N alert over whatever is on screen, lock screen included, that stays until the user answers. | |
Register a single lockscreen quick-action for background plugins.
A plugin may register exactly one item that appears in the lockscreen context menu (opened by KEY_MENU). When the user selects it, the plugin's plugin_on_action(action_id, 0, 0) fires. The label is an i18n key resolved per-language via host_i18n_tr_key.
| int host_lockscreen_alert | ( | const char * | text, |
| uint8_t | icon, | ||
| uint32_t | action_id ) |
Raise a persistent Y/N alert over whatever is on screen, lock screen included, that stays until the user answers.
Intended for background plugins that need to reach the user while their view is not in front. The alert overlays the current screen as a modal and does not auto-dismiss. When the user answers, the originating plugin's plugin_on_action(action_id, 0, user_data) fires with user_data=1 for Y (confirm) or user_data=0 for N (cancel); the answer is routed to that plugin even while it is running in the background. Only one alert can be pending at a time.
| text | Message to display (UTF-8; HTML entities are decoded). |
| icon | One of UI_ICON_* (ERROR/ALERT pick a matching glyph). |
| action_id | Action id echoed back to the plugin with the answer. |
Definition at line 134 of file host_api_lockscreen.cpp.
References HOST_ERR_BUSY, HOST_ERR_INVALID_ARG, HOST_ERR_NO_CAPABILITY, HOST_OK, cdc::ui::ViewStack::instance(), plg_get_active_plugin(), and cdc::plugin_manager::toDisplay().
Referenced by cdc::plugin_manager::w_host_lockscreen_alert().
| int host_lockscreen_register_action | ( | const char * | label_key, |
| uint32_t | action_id ) |
Publish (or replace) the plugin's lockscreen quick-action.
Definition at line 101 of file host_api_lockscreen.cpp.
References HOST_ERR_INVALID_ARG, HOST_ERR_NO_CAPABILITY, HOST_ERR_NO_MEMORY, HOST_OK, plg_get_active_plugin(), and cdc::plugin_manager::LockscreenRegistration::plugin.
Referenced by cdc::plugin_manager::w_host_lockscreen_register_action().
| int host_lockscreen_unregister_action | ( | void | ) |
Remove the plugin's lockscreen quick-action.
Definition at line 126 of file host_api_lockscreen.cpp.
References cdc::plugin_manager::clearLockscreenRegistrationFor(), HOST_ERR_NO_CAPABILITY, HOST_OK, and plg_get_active_plugin().
Referenced by cdc::plugin_manager::w_host_lockscreen_unregister_action().