* @{
*/
-static struct syscommon_deviced_display_state_info states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
- { SYSCOMMON_DEVICED_DISPLAY_STATE_START, "SYSCOMMON_DEVICED_DISPLAY_STATE_START", NULL, NULL, NULL, NULL },
- { SYSCOMMON_DEVICED_DISPLAY_STATE_ON, "SYSCOMMON_DEVICED_DISPLAY_STATE_ON", NULL, NULL, NULL, NULL },
- { SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, "SYSCOMMON_DEVICED_DISPLAY_STATE_DIM", NULL, NULL, NULL, NULL },
- { SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, "SYSCOMMON_DEVICED_DISPLAY_STATE_OFF", NULL, NULL, NULL, NULL },
- { SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP, "SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP", NULL, NULL, NULL, NULL },
-};
-
#define LOCK_SCREEN_WATING_TIME 300 /* 0.3 second */
#define LONG_PRESS_INTERVAL 2 /* 2 seconds */
#define SAMPLING_INTERVAL 1 /* 1 sec */
return &display_conf;
}
-inline struct syscommon_deviced_display_state_info* state_st(enum syscommon_deviced_display_state state)
-{
- return &states[state];
-}
-
-static void init_display_states(void *data)
-{
- struct display_plugin *dp = (struct display_plugin *) data;
- for(int i = 0; i < SYSCOMMON_DEVICED_DISPLAY_STATE_END; i++)
- dp->display_states[i] = &states[i];
-}
/**
* Power manager Main
*
assert(dp);
dp->config = &display_conf;
- init_display_states(dp);
dp->set_dim_state = NULL;
dp->get_device_flags = NULL;
dp->lcd_on_procedure = NULL;
static bool g_display_hal_backend_available = false;
static GList *display_dependent_device_ops;
static enum device_ops_status display_ops_status = DEVICE_OPS_STATUS_UNINIT;
+static struct syscommon_deviced_display_state_info default_states[SYSCOMMON_DEVICED_DISPLAY_STATE_END] = {
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_START, "SYSCOMMON_DEVICED_DISPLAY_STATE_START", NULL, NULL, NULL, NULL },
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_ON, "SYSCOMMON_DEVICED_DISPLAY_STATE_ON", NULL, NULL, NULL, NULL },
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, "SYSCOMMON_DEVICED_DISPLAY_STATE_DIM", NULL, NULL, NULL, NULL },
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, "SYSCOMMON_DEVICED_DISPLAY_STATE_OFF", NULL, NULL, NULL, NULL },
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP, "SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP", NULL, NULL, NULL, NULL },
+};
extern void init_save_userlock(void);
if (ret < 0)
return ret;
+ for (int i = 0; i < SYSCOMMON_DEVICED_DISPLAY_STATE_END; ++i)
+ if (!g_display_plugin.display_states[i])
+ g_display_plugin.display_states[i] = &default_states[i];
+
if (!g_display_plugin.config) {
ret = syscommon_plugin_deviced_display_load_config(&g_display_plugin.config);
if (ret < 0)