dp->config = &display_conf;
init_display_states(dp);
setup_display_plugin_backlight_ops(dp);
- dp->lcd_on_procedure = NULL;
- dp->lcd_off_procedure = NULL;
- dp->custom_lcd_on = NULL;
- dp->custom_lcd_off = NULL;
- dp->display_on_by_reason = NULL;
- dp->display_off_by_reason = NULL;
dp->default_saving_mode = NULL;
dp->proc_change_state = default_proc_change_state;
dp->config = &display_conf;
init_display_states(dp);
setup_display_plugin_backlight_ops(dp);
- dp->lcd_on_procedure = NULL;
- dp->lcd_off_procedure = NULL;
- dp->custom_lcd_on = NULL;
- dp->custom_lcd_off = NULL;
- dp->display_on_by_reason = NULL;
- dp->display_off_by_reason = NULL;
dp->default_saving_mode = NULL;
dp->proc_change_state = NULL;
return &states[state];
}
+/* FIXME: register to plugin .lcd_on_procedure interface */
static void lcd_on_procedure(int state, enum deviced_event reason)
{
int ret;
display_misc_set_touch_event_blocked(false);
}
+/* FIXME: register to plugin .lcd_off_procedure interface */
static void lcd_off_procedure(enum deviced_event reason)
{
/*
return true;
}
+__attribute__((unused))
static gboolean timer_refresh_cb(gpointer data)
{
struct syscommon_deviced_display_state_info *st;
return 0;
}
-int custom_lcdon(int timeout)
+/* FIXME: register to plugin .custom_lcd_on interface */
+__attribute__((unused))
+static int custom_lcdon(int timeout)
{
struct syscommon_deviced_display_state_info *st;
int ret, update;
return 0;
}
-int custom_lcdoff(enum deviced_event reason)
+/* FIXME: register to plugin .custom_lcd_off interface */
+__attribute__((unused))
+static int custom_lcdoff(enum deviced_event reason)
{
struct syscommon_deviced_display_state_info *st;
return 0;
}
-int display_on_by_reason(const char *reason, int timeout)
+/* FIXME: register to plugin .on_by_reason interface */
+__attribute__((unused))
+static int display_on_by_reason(const char *reason, int timeout)
{
struct syscommon_deviced_display_state_info *st;
int _reason;
return 0;
}
-int display_off_by_reason(const char *reason)
+/* FIXME: register to plugin .off_by_reason interface */
+static int display_off_by_reason(const char *reason)
{
struct syscommon_deviced_display_state_info *st;
int _reason;
dp->config = &display_conf;
init_display_states(dp);
setup_display_plugin_backlight_ops(dp);
- dp->lcd_on_procedure = lcd_on_procedure;
- dp->lcd_off_procedure = lcd_off_procedure;
- dp->custom_lcd_on = custom_lcdon;
- dp->custom_lcd_off = custom_lcdoff;
- dp->display_on_by_reason = display_on_by_reason;
- dp->display_off_by_reason = display_off_by_reason;
+ /**
+ * FIXME: They should be connected via plugin interfaces
+ *
+ * dp->lcd_on_procedure = lcd_on_procedure;
+ * dp->lcd_off_procedure = lcd_off_procedure;
+ * dp->custom_lcd_on = custom_lcdon;
+ * dp->custom_lcd_off = custom_lcdoff;
+ * dp->display_on_by_reason = display_on_by_reason;
+ * dp->display_off_by_reason = display_off_by_reason;
+ */
dp->default_saving_mode = default_saving_mode;
dp->proc_change_state = default_proc_change_state;
/* core.c */
int delete_condition(enum syscommon_deviced_display_state state);
-int custom_lcdoff(enum deviced_event reason);
/* auto-brightness.c */
void set_brightness_changed_state(void);
void display_panel_lcd_on_procedure(int state, enum deviced_event reason)
{
- if (display_plugin_lcd_on_procedure(state, reason) == 0)
+ int ret;
+
+ ret = syscommon_plugin_deviced_display_lcd_on_procedure(state, reason);
+ if (ret == 0)
+ return;
+
+ if (ret != -EOPNOTSUPP)
return;
+
/*
* Display on procedure
* step 1. leave doze
void display_panel_lcd_off_procedure(enum deviced_event reason)
{
- if (display_plugin_lcd_off_procedure(reason) == 0)
+ int ret;
+
+ ret = syscommon_plugin_deviced_display_lcd_off_procedure(reason);
+ if (ret == 0)
+ return;
+
+ if (ret != -EOPNOTSUPP)
return;
/*
* Display off procedure
int display_panel_custom_lcd_on(int timeout)
{
- if (display_plugin_custom_lcd_on(timeout) == 0)
+ int ret;
+
+ ret = syscommon_plugin_deviced_display_custom_lcd_on(timeout);
+ if (ret == 0)
return 0;
+ if (ret != -EOPNOTSUPP)
+ return ret;
+
if (timeout <= 0)
return -EINVAL;
int display_panel_custom_lcd_off(enum deviced_event reason)
{
- if (display_plugin_custom_lcd_off(reason) == 0)
+ int ret;
+
+ ret = syscommon_plugin_deviced_display_custom_lcd_off(reason);
+ if (ret == 0)
return 0;
+ if (ret != -EOPNOTSUPP)
+ return ret;
+
/* check holdkey block flag in lock node */
if (display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_ON) || display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)) {
/*
{
int _reason;
int str_len;
+ int ret;
- if (display_plugin_display_on_by_reason(reason, timeout) == 0)
+ ret = syscommon_plugin_deviced_display_on_by_reason(reason, timeout);
+ if (ret == 0)
return 0;
+ if (ret != -EOPNOTSUPP)
+ return ret;
+
if (!reason)
return -EINVAL;
{
enum deviced_event _reason;
int str_len;
+ int ret;
- if (display_plugin_display_off_by_reason(reason) == 0)
+ ret = syscommon_plugin_deviced_display_off_by_reason(reason);
+ if (ret == 0)
return 0;
+ if (ret != -EOPNOTSUPP)
+ return ret;
+
if (!reason)
return -EINVAL;
return 0;
}
-int display_plugin_lcd_on_procedure(int state, enum deviced_event reason)
-{
- if (g_display_plugin.lcd_on_procedure) {
- g_display_plugin.lcd_on_procedure(state, reason);
- return 0;
- }
-
- return -EOPNOTSUPP;
-}
-
-int display_plugin_lcd_off_procedure(enum deviced_event reason)
-{
- if (g_display_plugin.lcd_off_procedure) {
- g_display_plugin.lcd_off_procedure(reason);
- return 0;
- }
-
- return -EOPNOTSUPP;
-}
-
-int display_plugin_custom_lcd_on(int timeout)
-{
- if (g_display_plugin.custom_lcd_on) {
- g_display_plugin.custom_lcd_on(timeout);
- return 0;
- }
-
- return -EOPNOTSUPP;
-}
-
-int display_plugin_custom_lcd_off(enum deviced_event reason)
-{
- if (g_display_plugin.custom_lcd_off) {
- g_display_plugin.custom_lcd_off(reason);
- return 0;
- }
-
- return -EOPNOTSUPP;
-}
-
-int display_plugin_display_on_by_reason(const char *reason, int timeout)
-{
- if (g_display_plugin.display_on_by_reason) {
- g_display_plugin.display_on_by_reason(reason, timeout);
- return 0;
- }
-
- return -EOPNOTSUPP;
-}
-
-int display_plugin_display_off_by_reason(const char *reason)
-{
- if (g_display_plugin.display_off_by_reason) {
- g_display_plugin.display_off_by_reason(reason);
- return 0;
- }
-
- return -EOPNOTSUPP;
-}
-
int display_plugin_set_power_save_mode_flag(int onoff)
{
if (g_display_plugin.default_saving_mode) {
struct display_plugin {
bool system_wakeup_flag;
int (*auto_brightness_control) (enum brightness_request_e request, int set_brightness);
- /* FIXME: function names will be redefined */
- void (*lcd_on_procedure) (int state, enum deviced_event reason);
- void (*lcd_off_procedure) (enum deviced_event reason);
- int (*custom_lcd_on) (int timeout);
- int (*custom_lcd_off) (enum deviced_event reason);
- int (*display_on_by_reason) (const char *reason, int timeout);
- int (*display_off_by_reason) (const char *reason);
void (*default_saving_mode) (int onoff);
int (*proc_change_state) (unsigned int cond, pid_t pid);
int (*set_autobrightness_min) (int val, char *name);
int display_plugin_get_system_wakeup_flag(bool *flag);
int display_plugin_set_system_wakeup_flag(bool flag);
int display_plugin_auto_brightness_control(enum brightness_request_e request, int set_brightness);
-int display_plugin_lcd_on_procedure(int state, enum deviced_event reason);
-int display_plugin_lcd_off_procedure(enum deviced_event reason);
-int display_plugin_custom_lcd_on(int timeout);
-int display_plugin_custom_lcd_off(enum deviced_event reason);
-int display_plugin_display_on_by_reason(const char *reason, int timeout);
-int display_plugin_display_off_by_reason(const char *reason);
int display_plugin_set_power_save_mode_flag(int onoff);
int display_plugin_backlight_set_brightness(int brightness);