CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
Lockscreen quick-action slot

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.

Detailed Description

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.

Function Documentation

◆ host_lockscreen_alert()

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.

Parameters
textMessage to display (UTF-8; HTML entities are decoded).
iconOne of UI_ICON_* (ERROR/ALERT pick a matching glyph).
action_idAction id echoed back to the plugin with the answer.
Returns
HOST_OK, HOST_ERR_INVALID_ARG for a NULL text, HOST_ERR_NO_CAPABILITY without an active plugin, or HOST_ERR_BUSY when another modal or an exclusive prompt is already on screen.

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().

◆ host_lockscreen_register_action()

int host_lockscreen_register_action ( const char * label_key,
uint32_t action_id )

◆ host_lockscreen_unregister_action()

int host_lockscreen_unregister_action ( void )