static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
-static struct state states[DEVICED_DISPLAY_STATE_END] = {
- { DEVICED_DISPLAY_STATE_START, "DEVICED_DISPLAY_STATE_START", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_ON, "DEVICED_DISPLAY_STATE_ON", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_DIM, "DEVICED_DISPLAY_STATE_DIM", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_OFF, "DEVICED_DISPLAY_STATE_OFF", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_SLEEP, "DEVICED_DISPLAY_STATE_SLEEP", NULL, NULL, NULL, NULL },
+static struct state 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 CONTINUOUS_SAMPLING 1
#define LCDOFF_TIMEOUT 300 /* milli second */
-static struct deviced_display_config display_conf = {
+static struct syscommon_deviced_display_config display_conf = {
.lock_wait_time = LOCK_SCREEN_WATING_TIME,
.longpress_interval = LONG_PRESS_INTERVAL,
.lightsensor_interval = SAMPLING_INTERVAL,
.continuous_sampling = CONTINUOUS_SAMPLING,
.timeout_enable = true,
.input_support = true,
- .display_init_direction = DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
+ .display_init_direction = SYSCOMMON_DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
.aod_enter_level = 40,
.aod_tsp = true,
.touch_wakeup = false,
.display_on_usb_conn_changed = true,
- .display_dpms_type = DEVICED_DPMS_TYPE_WINDOW_MANAGER,
+ .display_dpms_type = SYSCOMMON_DEVICED_DPMS_TYPE_WINDOW_MANAGER,
};
-inline const struct deviced_display_config* get_var_display_config()
+inline const struct syscommon_deviced_display_config* get_var_display_config()
{
return &display_conf;
}
-inline struct state* state_st(enum deviced_display_state state)
+inline struct state* 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 < DEVICED_DISPLAY_STATE_END; i++)
+ for(int i = 0; i < SYSCOMMON_DEVICED_DISPLAY_STATE_END; i++)
dp->display_states[i] = &states[i];
}
/**
if (flags & LCD_PANEL_OFF_MODE)
/* standby on */
syscommon_resman_set_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, DEVICED_DPMS_STANDBY);
+ DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, SYSCOMMON_DEVICED_DPMS_STANDBY);
else
/* normal lcd on */
syscommon_resman_set_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, DEVICED_DPMS_ON);
+ DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, SYSCOMMON_DEVICED_DPMS_ON);
return 0;
}
/* NORMAL MODE */
if (flags & NORMAL_MODE) {
syscommon_resman_set_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, DEVICED_DPMS_OFF);
+ DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, SYSCOMMON_DEVICED_DPMS_OFF);
return 0;
} else if (flags & FORCE_OFF_MODE) {
syscommon_resman_set_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, DEVICED_DPMS_FORCE_OFF);
+ DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, SYSCOMMON_DEVICED_DPMS_FORCE_OFF);
return 0;
}
#include "device-interface.h"
static struct display_backlight_ops backlight_ops;
-static const struct deviced_display_config *display_conf;
+static const struct syscommon_deviced_display_config *display_conf;
inline struct display_backlight_ops *get_var_backlight_ops(void)
{
static inline int current_state_in_on(void)
{
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
ret = syscommon_resman_get_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_INT_GET_CURRENT_STATE, (int32_t *) ¤t);
if (ret < 0)
return 0;
- return ((current == DEVICED_DISPLAY_STATE_DIM) || (current == DEVICED_DISPLAY_STATE_ON));
+ return ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) || (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON));
}
static inline void restore_custom_brightness(void)
{
bool custom_status;
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
ret = syscommon_resman_get_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_INT_GET_CURRENT_STATE, (int32_t *) ¤t);
return;
display_backlight_get_custom_status(&custom_status);
- if (current == DEVICED_DISPLAY_STATE_DIM && custom_status)
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM && custom_status)
display_backlight_update_by_custom_brightness();
}
/* change state - LCD on */
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT_POWERKEY);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT_POWERKEY);
}
if (!display_has_caps(caps, DISPLAY_CAPA_LCDOFF)) {
ret = syscommon_resman_get_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, &dpms_state);
- if (ret == 0 && dpms_state == DEVICED_DPMS_ON)
+ if (ret == 0 && dpms_state == SYSCOMMON_DEVICED_DPMS_ON)
return false;
if (flags & LCD_ON_BY_POWER_KEY) {
}
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_TUPLE2_SET_DISPLAY_DIRECT, DEVICED_DPMS_ON, reason);
+ DEVICED_DISPLAY_ATTR_TUPLE2_SET_DISPLAY_DIRECT, SYSCOMMON_DEVICED_DPMS_ON, reason);
return true;
}
ret = syscommon_resman_get_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_INT_DPMS_STATE, &dpms_state);
- if (ret == 0 && dpms_state == DEVICED_DPMS_OFF)
+ if (ret == 0 && dpms_state == SYSCOMMON_DEVICED_DPMS_OFF)
return;
broadcast_lcdoff_by_powerkey();
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
- DEVICED_DISPLAY_ATTR_TUPLE2_SET_DISPLAY_DIRECT, DEVICED_DPMS_OFF, DEVICED_EVENT_INPUT_POWERKEY);
+ DEVICED_DISPLAY_ATTR_TUPLE2_SET_DISPLAY_DIRECT, SYSCOMMON_DEVICED_DPMS_OFF, DEVICED_EVENT_INPUT_POWERKEY);
}
static void check_key_combination(struct input_event *pinput)
return false;
/* It's not needed if it's already LCD off state */
- if (!current_state_in_on() && dpms_state != DPMS_ON)
+ if (!current_state_in_on() && dpms_state != SYSCOMMON_DEVICED_DPMS_ON)
return false;
/*
if (decide_lcdoff() == true) {
switch_off_lcd();
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
display_state_transition_update_lcdoff_reason(VCONFKEY_PM_LCDOFF_BY_POWERKEY);
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
} else {
ignore = false;
skip_combination = false;
int ignore = true;
static int value = KEY_RELEASED;
unsigned int caps;
- const struct deviced_display_config *display_conf = get_var_display_config();
+ const struct syscommon_deviced_display_config *display_conf = get_var_display_config();
if (!display_conf) {
_E("Failed to get display configuration variable.");
return ignore;
if (!current_state_in_on())
return false;
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
display_state_transition_update_lcdoff_reason(VCONFKEY_PM_LCDOFF_BY_POWERKEY);
/* LCD off forcly */
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
return true;
}
int ignore = true;
static int code, value;
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
assert(pinput);
if (ret < 0)
break;
- if (current == DEVICED_DISPLAY_STATE_OFF && bezel_wakeup) {
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF && bezel_wakeup) {
switch_on_lcd(LCD_ON_BY_BEZEL);
ignore = false;
- } else if (current != DEVICED_DISPLAY_STATE_OFF)
+ } else if (current != SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
ignore = false;
break;
case EV_ABS:
/* lcd on or update lcd timeout */
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT);
}
static int delayed_init_done(void *data)
noti_type = METHOD_LOW_NOTI_ON;
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_BATTERY_CAPACITY_LOW);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_BATTERY_CAPACITY_LOW);
}
prev_level = battery_info.warning;
if (battery->charge_now)
noti_type = METHOD_CRITICAL_NOTI_ON;
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_BATTERY_CAPACITY_LOW);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_BATTERY_CAPACITY_LOW);
}
prev_level = battery_info.critical;
if (battery->charge_now)
static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
-static struct state states[DEVICED_DISPLAY_STATE_END] = {
- { DEVICED_DISPLAY_STATE_START, "DEVICED_DISPLAY_STATE_START", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_ON, "DEVICED_DISPLAY_STATE_ON", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_DIM, "DEVICED_DISPLAY_STATE_DIM", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_OFF, "DEVICED_DISPLAY_STATE_OFF", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_SLEEP, "DEVICED_DISPLAY_STATE_SLEEP", NULL, NULL, NULL, NULL },
+static struct state 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 CONTINUOUS_SAMPLING 1
#define LCDOFF_TIMEOUT 300 /* milli second */
-static struct deviced_display_config display_conf = {
+static struct syscommon_deviced_display_config display_conf = {
.lock_wait_time = LOCK_SCREEN_WATING_TIME,
.longpress_interval = LONG_PRESS_INTERVAL,
.lightsensor_interval = SAMPLING_INTERVAL,
.continuous_sampling = CONTINUOUS_SAMPLING,
.timeout_enable = true,
.input_support = true,
- .display_init_direction = DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
+ .display_init_direction = SYSCOMMON_DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
.aod_enter_level = 40,
.aod_tsp = true,
.touch_wakeup = false,
.display_on_usb_conn_changed = true,
- .display_dpms_type = DEVICED_DPMS_TYPE_WINDOW_MANAGER,
+ .display_dpms_type = SYSCOMMON_DEVICED_DPMS_TYPE_WINDOW_MANAGER,
};
-inline const struct deviced_display_config* get_var_display_config()
+inline const struct syscommon_deviced_display_config* get_var_display_config()
{
return &display_conf;
}
-inline struct state* state_st(enum deviced_display_state state)
+inline struct state* state_st(enum syscommon_deviced_display_state state)
{
return &states[state];
}
static int default_proc_change_state(unsigned int cond, pid_t pid)
{
- enum deviced_display_state next;
+ enum syscommon_deviced_display_state next;
next = GET_COND_STATE(cond);
_I("Change process(%d) state to %s.", pid, states[next].name);
switch (next) {
- case DEVICED_DISPLAY_STATE_ON:
- if (display_panel_get_dpms_cached_state() != DPMS_ON)
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_on_direct(LCD_ON_BY_EVENT);
display_state_transition_update_lock_screen_timeout(LOCK_SCREEN_CONTROL_TIMEOUT);
display_state_transition_do_proc_change_state_action(next, -1);
break;
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
display_state_transition_do_proc_change_state_action(next, -1);
break;
- case DEVICED_DISPLAY_STATE_OFF:
- if (display_panel_get_dpms_cached_state() == DPMS_ON) {
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON) {
if (get_proximity_state() == SENSOR_PROXIMITY_NEAR)
display_panel_lcd_off_procedure(LCD_OFF_BY_PROXIMITY);
else
display_state_transition_update_display_state_timeout_by_priority();
display_state_transition_do_proc_change_state_action(next, -1);
break;
- case DEVICED_DISPLAY_STATE_SLEEP:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP:
_I("Dangerous requests.");
/* at first LCD_OFF and then goto sleep */
/* state transition */
- display_state_transition_do_proc_change_state_action(DEVICED_DISPLAY_STATE_OFF, TIMEOUT_NONE);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_OFF);
+ display_state_transition_do_proc_change_state_action(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, TIMEOUT_NONE);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
if (display_panel_is_lcd_on_state_broadcasted()) {
_I("broadcast lcd off signal at non-lcd device");
broadcast_lcd_off(SIGNAL_PRE, 0);
broadcast_lcd_off(SIGNAL_POST, 0);
}
- display_state_transition_do_proc_change_state_action(DEVICED_DISPLAY_STATE_SLEEP, TIMEOUT_NONE);
+ display_state_transition_do_proc_change_state_action(SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP, TIMEOUT_NONE);
break;
default:
static void init_display_states(void *data)
{
struct display_plugin *dp = (struct display_plugin *) data;
- for(int i = 0; i < DEVICED_DISPLAY_STATE_END; i++)
+ for(int i = 0; i < SYSCOMMON_DEVICED_DISPLAY_STATE_END; i++)
dp->display_states[i] = &states[i];
}
/**
#include "power/power-suspend.h"
static struct display_backlight_ops backlight_ops;
-static const struct deviced_display_config *display_conf;
+static const struct syscommon_deviced_display_config *display_conf;
inline struct display_backlight_ops *get_var_backlight_ops(void)
{
static inline int current_state_in_on(void)
{
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
ret = syscommon_resman_get_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_INT_GET_CURRENT_STATE, (int32_t *) ¤t);
if (ret < 0)
return 0;
- return ((current == DEVICED_DISPLAY_STATE_DIM) || (current == DEVICED_DISPLAY_STATE_ON));
+ return ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) || (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON));
}
static inline void restore_custom_brightness(void)
{
bool custom_status;
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
ret = syscommon_resman_get_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_INT_GET_CURRENT_STATE, (int32_t *) ¤t);
return;
display_backlight_get_custom_status(&custom_status);
- if (current == DEVICED_DISPLAY_STATE_DIM && custom_status)
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM && custom_status)
display_backlight_update_by_custom_brightness();
}
/* change state - LCD on */
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT_POWERKEY);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT_POWERKEY);
}
if (!display_has_caps(caps, DISPLAY_CAPA_LCDOFF)) {
if (current_state_in_on())
return false;
- if (display_panel_get_dpms_cached_state() == DPMS_ON) {
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON) {
if (ambient_get_state() == false)
return false;
}
if (!current_state_in_on())
return;
- if (display_panel_get_dpms_cached_state() == DPMS_OFF)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_OFF)
return;
broadcast_lcdoff_by_powerkey();
{
/* It's not needed if it's already LCD off state */
if (!current_state_in_on() &&
- display_panel_get_dpms_cached_state() != DPMS_ON)
+ display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
return false;
/*
if (decide_lcdoff() == true) {
switch_off_lcd();
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
display_state_transition_update_lcdoff_reason(VCONFKEY_PM_LCDOFF_BY_POWERKEY);
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
} else {
ignore = false;
skip_combination = false;
if (current_state_in_on())
return false;
- if (display_panel_get_dpms_cached_state() == DPMS_ON) {
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON) {
_W("display power was on");
return false;
}
return G_SOURCE_REMOVE;
displayon_by_powerkey_timeout_id = 0;
- if (display_panel_get_dpms_cached_state() != DPMS_ON ||
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON ||
current_state_in_on() == false) {
broadcast_lcdon_by_powerkey();
display_panel_lcd_on_direct(LCD_ON_BY_POWER_KEY);
int ignore = true;
static int value = KEY_RELEASED;
unsigned int caps;
- const struct deviced_display_config *display_conf = get_var_display_config();
+ const struct syscommon_deviced_display_config *display_conf = get_var_display_config();
if (!display_conf) {
_E("Failed to get display configuration variable.");
return ignore;
ignore = true;
if (!displayon_by_powerkey_timeout_id &&
- display_panel_get_dpms_cached_state() != DPMS_ON &&
+ display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON &&
key_combination != COMBINATION_TORCH) {
displayon_by_powerkey_timeout_id = g_timeout_add(
100,
if (!current_state_in_on())
return false;
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
display_state_transition_update_lcdoff_reason(VCONFKEY_PM_LCDOFF_BY_POWERKEY);
/* LCD off forcly */
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
return true;
}
int ignore = true;
static int code, value;
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
assert(pinput);
if (ret < 0)
break;
- if (current == DEVICED_DISPLAY_STATE_OFF && bezel_wakeup) {
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF && bezel_wakeup) {
switch_on_lcd(LCD_ON_BY_BEZEL);
ignore = false;
- } else if (current != DEVICED_DISPLAY_STATE_OFF)
+ } else if (current != SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
ignore = false;
break;
case EV_ABS:
static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
-static struct state states[DEVICED_DISPLAY_STATE_END] = {
- { DEVICED_DISPLAY_STATE_START, "DEVICED_DISPLAY_STATE_START", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_ON, "DEVICED_DISPLAY_STATE_ON", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_DIM, "DEVICED_DISPLAY_STATE_DIM", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_OFF, "DEVICED_DISPLAY_STATE_OFF", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_SLEEP, "DEVICED_DISPLAY_STATE_SLEEP", NULL, NULL, NULL, NULL },
+static struct state 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 CONTINUOUS_SAMPLING 1
#define LCDOFF_TIMEOUT 300 /* milli second */
-static struct deviced_display_config display_conf = {
+static struct syscommon_deviced_display_config display_conf = {
.lock_wait_time = LOCK_SCREEN_WATING_TIME,
.longpress_interval = LONG_PRESS_INTERVAL,
.lightsensor_interval = SAMPLING_INTERVAL,
.continuous_sampling = CONTINUOUS_SAMPLING,
.timeout_enable = true,
.input_support = true,
- .display_init_direction = DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
+ .display_init_direction = SYSCOMMON_DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
.aod_enter_level = 40,
.aod_tsp = true,
.touch_wakeup = false,
.display_on_usb_conn_changed = true,
- .display_dpms_type = DEVICED_DPMS_TYPE_WINDOW_MANAGER,
+ .display_dpms_type = SYSCOMMON_DEVICED_DPMS_TYPE_WINDOW_MANAGER,
};
-inline const struct deviced_display_config* get_var_display_config()
+inline const struct syscommon_deviced_display_config* get_var_display_config()
{
return &display_conf;
}
-inline struct state* state_st(enum deviced_display_state state)
+inline struct state* 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 < DEVICED_DISPLAY_STATE_END; i++)
+ for(int i = 0; i < SYSCOMMON_DEVICED_DISPLAY_STATE_END; i++)
dp->display_states[i] = &states[i];
}
/**
#include "display-lock.h"
static struct display_backlight_ops backlight_ops;
-static const struct deviced_display_config *display_conf;
+static const struct syscommon_deviced_display_config *display_conf;
inline struct display_backlight_ops *get_var_backlight_ops(void)
{
static inline int current_state_in_on(void)
{
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
ret = syscommon_resman_get_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_INT_GET_CURRENT_STATE, (int32_t *) ¤t);
if (ret < 0)
return 0;
- return ((current == DEVICED_DISPLAY_STATE_DIM) || (current == DEVICED_DISPLAY_STATE_ON));
+ return ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) || (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON));
}
static inline void restore_custom_brightness(void)
{
bool custom_status;
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
ret = syscommon_resman_get_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_INT_GET_CURRENT_STATE, (int32_t *) ¤t);
return;
display_backlight_get_custom_status(&custom_status);
- if (current == DEVICED_DISPLAY_STATE_DIM && custom_status)
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM && custom_status)
display_backlight_update_by_custom_brightness();
}
/* change state - LCD on */
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT_POWERKEY);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT_POWERKEY);
}
if (!display_has_caps(caps, DISPLAY_CAPA_LCDOFF)) {
if (current_state_in_on())
return false;
- if (display_panel_get_dpms_cached_state() == DPMS_ON) {
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON) {
if (ambient_get_state() == false)
return false;
}
if (!current_state_in_on())
return;
- if (display_panel_get_dpms_cached_state() == DPMS_OFF)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_OFF)
return;
broadcast_lcdoff_by_powerkey();
{
/* It's not needed if it's already LCD off state */
if (!current_state_in_on() &&
- display_panel_get_dpms_cached_state() != DPMS_ON)
+ display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
return false;
/*
if (decide_lcdoff() == true) {
switch_off_lcd();
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
display_state_transition_update_lcdoff_reason(VCONFKEY_PM_LCDOFF_BY_POWERKEY);
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
} else {
ignore = false;
skip_combination = false;
int ignore = true;
static int value = KEY_RELEASED;
unsigned int caps;
- const struct deviced_display_config *display_conf = get_var_display_config();
+ const struct syscommon_deviced_display_config *display_conf = get_var_display_config();
if(!display_conf) {
_E("Failed to get display configuration variable.");
return ignore;
if (!current_state_in_on())
return false;
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
display_state_transition_update_lcdoff_reason(VCONFKEY_PM_LCDOFF_BY_POWERKEY);
/* LCD off forcly */
syscommon_resman_set_resource_attr_uint64_2(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_DISPLAY),
DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE,
- DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
+ SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT_POWERKEY);
return true;
}
int ignore = true;
static int code, value;
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
assert(pinput);
if (ret < 0)
break;
- if (current == DEVICED_DISPLAY_STATE_OFF && bezel_wakeup) {
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF && bezel_wakeup) {
switch_on_lcd(LCD_ON_BY_BEZEL);
ignore = false;
- } else if (current != DEVICED_DISPLAY_STATE_OFF)
+ } else if (current != SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
ignore = false;
break;
case EV_ABS:
static void launch_health_popup_by_display_state(int display_state)
{
- static enum deviced_display_state old = DEVICED_DISPLAY_STATE_START;
+ static enum syscommon_deviced_display_state old = SYSCOMMON_DEVICED_DISPLAY_STATE_START;
if (battery->health != HEALTH_LOW && battery->health != HEALTH_HIGH) {
old = display_state;
}
/* relaunch health popup on LCDON */
- if ((old == DEVICED_DISPLAY_STATE_SLEEP || old == DEVICED_DISPLAY_STATE_OFF || old == DEVICED_DISPLAY_STATE_START)
- && (display_state == DEVICED_DISPLAY_STATE_DIM || display_state == DEVICED_DISPLAY_STATE_ON))
+ if ((old == SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP || old == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF || old == SYSCOMMON_DEVICED_DISPLAY_STATE_START)
+ && (display_state == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM || display_state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON))
relaunch_health_popup();
old = display_state;
}
static void change_brightness_transit(int start, int end)
{
- const struct deviced_display_config *display_conf = get_var_display_config();
+ const struct syscommon_deviced_display_config *display_conf = get_var_display_config();
if(!display_conf) {
_E("Failed to get display configuration variable.");
return ;
int default_brightness;
int current_brightness;
- if (get_pm_cur_state() != DEVICED_DISPLAY_STATE_ON)
+ if (get_pm_cur_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
return;
/*
if (battery.capacity <= LOWBATCAPACITY && battery.charge_now != CHARGER_CHARGING)
change_flag(&hold_brt, 1);
} else if (request == BR_LOWDIM_ON) {
if (!lowdim) {
- if (!hbm && !hold_brt && (get_pm_cur_state() == DEVICED_DISPLAY_STATE_ON))
+ if (!hbm && !hold_brt && (get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON))
display_backlight_set_brightness_by_dim_brightness();
change_flag(&lowdim, 1);
}
change_flag(&lbm, 0);
/* called by DEVICED_NOTIFIER_LCD_OFF_COMPLETE, no need to change brightness */
- if (get_pm_cur_state() != DEVICED_DISPLAY_STATE_ON)
+ if (get_pm_cur_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
return 0;
if (!lowdim) {
change_flag(&hold_brt, 0);
/* called by DEVICED_NOTIFIER_LCD_OFF_COMPLETE, no need to change brightness */
- if (get_pm_cur_state() != DEVICED_DISPLAY_STATE_ON)
+ if (get_pm_cur_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
return 0;
if (!lowdim)
}
} else if (request == BR_LOWDIM_OFF) {
if (lowdim) {
- if (!hbm && !hold_brt && (get_pm_cur_state() == DEVICED_DISPLAY_STATE_ON))
+ if (!hbm && !hold_brt && (get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON))
display_backlight_update_by_default_brightness();
change_flag(&lowdim, 0);
}
static gboolean alc_handler(void *data)
{
- if (get_pm_cur_state() != DEVICED_DISPLAY_STATE_ON) {
+ if (get_pm_cur_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_ON) {
if (alc_timeout_id > 0)
g_source_remove(alc_timeout_id);
alc_timeout_id = 0;
}
if (_default_action != NULL) {
- state_st(DEVICED_DISPLAY_STATE_ON)->action = _default_action;
+ state_st(SYSCOMMON_DEVICED_DISPLAY_STATE_ON)->action = _default_action;
_default_action = NULL;
}
if (alc_timeout_id > 0) {
/* change alc action func */
if (_default_action == NULL)
- _default_action = state_st(DEVICED_DISPLAY_STATE_ON)->action;
- state_st(DEVICED_DISPLAY_STATE_ON)->action = alc_action;
+ _default_action = state_st(SYSCOMMON_DEVICED_DISPLAY_STATE_ON)->action;
+ state_st(SYSCOMMON_DEVICED_DISPLAY_STATE_ON)->action = alc_action;
update_auto_brightness(true);
update_timeout = 0;
- if (get_pm_cur_state() != DEVICED_DISPLAY_STATE_ON)
+ if (get_pm_cur_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
return G_SOURCE_REMOVE;
ret = vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &on);
if (!data)
return 0;
lcd_state = *(int *)data;
- if (lcd_state == DEVICED_DISPLAY_STATE_OFF && alc_timeout_id > 0) {
+ if (lcd_state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF && alc_timeout_id > 0) {
g_source_remove(alc_timeout_id);
alc_timeout_id = 0;
}
static int default_trans(int evt);
static int default_action(int timeout);
-static struct state states[DEVICED_DISPLAY_STATE_END] = {
- { DEVICED_DISPLAY_STATE_START, "DEVICED_DISPLAY_STATE_START", NULL, NULL, NULL, NULL },
- { DEVICED_DISPLAY_STATE_ON, "DEVICED_DISPLAY_STATE_ON", default_trans, default_action, NULL, NULL },
- { DEVICED_DISPLAY_STATE_DIM, "DEVICED_DISPLAY_STATE_DIM", default_trans, default_action, NULL, NULL },
- { DEVICED_DISPLAY_STATE_OFF, "DEVICED_DISPLAY_STATE_OFF", default_trans, default_action, NULL, NULL },
- { DEVICED_DISPLAY_STATE_SLEEP, "DEVICED_DISPLAY_STATE_SLEEP", default_trans, default_action, NULL, NULL },
+static struct state 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", default_trans, default_action, NULL, NULL },
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, "SYSCOMMON_DEVICED_DISPLAY_STATE_DIM", default_trans, default_action, NULL, NULL },
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, "SYSCOMMON_DEVICED_DISPLAY_STATE_OFF", default_trans, default_action, NULL, NULL },
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP, "SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP", default_trans, default_action, NULL, NULL },
};
#define LOCK_SCREEN_WATING_TIME 300 /* 0.3 second */
#define FORCE_RELEASE_LOCK_INTERVAL 5 /* seconds */
-static struct deviced_display_config display_conf = {
+static struct syscommon_deviced_display_config display_conf = {
.lock_wait_time = LOCK_SCREEN_WATING_TIME,
.longpress_interval = LONG_PRESS_INTERVAL,
.lightsensor_interval = SAMPLING_INTERVAL,
.continuous_sampling = CONTINUOUS_SAMPLING,
.timeout_enable = true,
.input_support = true,
- .display_init_direction = DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
+ .display_init_direction = SYSCOMMON_DEVICED_DISPLAY_ORIENTATION_HORIZONTAL,
.aod_enter_level = 40,
.aod_tsp = true,
.touch_wakeup = false,
.display_on_usb_conn_changed = true,
- .display_dpms_type = DEVICED_DPMS_TYPE_WINDOW_MANAGER,
+ .display_dpms_type = SYSCOMMON_DEVICED_DPMS_TYPE_WINDOW_MANAGER,
};
-inline const struct deviced_display_config *get_var_display_config()
+inline const struct syscommon_deviced_display_config *get_var_display_config()
{
return &display_conf;
}
-inline struct state *state_st(enum deviced_display_state state)
+inline struct state *state_st(enum syscommon_deviced_display_state state)
{
return &states[state];
}
g_source_remove(transit_timer);
transit_timer = 0;
- display_backlight_change_brightness_by_dpms_state(DPMS_ON);
+ display_backlight_change_brightness_by_dpms_state(SYSCOMMON_DEVICED_DPMS_ON);
return G_SOURCE_REMOVE;
}
_I("[lcdstep] 0x%lx", flags);
if (flags & AMBIENT_MODE) {
- if (ambient_get_state() == false && display_panel_get_dpms_cached_state() == DPMS_ON)
+ if (ambient_get_state() == false && display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
return;
ambient_set_state(false);
}
}
if (state == LCD_NORMAL)
- set_setting_pmstate(DEVICED_DISPLAY_STATE_ON);
+ set_setting_pmstate(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
else if (state == LCD_DIM)
- set_setting_pmstate(DEVICED_DISPLAY_STATE_DIM);
+ set_setting_pmstate(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
display_start_dependent_device(flags);
ambient_set_state(true);
}
- set_setting_pmstate(DEVICED_DISPLAY_STATE_OFF);
+ set_setting_pmstate(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
if (transit_timer) {
g_source_remove(transit_timer);
}
if (flags & LCD_PHASED_TRANSIT_MODE)
- display_backlight_change_brightness_by_dpms_state(DPMS_OFF);
+ display_backlight_change_brightness_by_dpms_state(SYSCOMMON_DEVICED_DPMS_OFF);
display_stop_dependent_device(flags);
static inline bool check_lcd_is_on(void)
{
- if (display_panel_get_dpms_cached_state() != DPMS_ON)
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
return false;
return true;
/* state transition */
set_pm_old_state(get_pm_cur_state());
- set_pm_cur_state(DEVICED_DISPLAY_STATE_ON);
+ set_pm_cur_state(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
st = &states[get_pm_cur_state()];
if (st->action)
/* state transition */
set_pm_old_state(get_pm_cur_state());
- set_pm_cur_state(DEVICED_DISPLAY_STATE_ON);
+ set_pm_cur_state(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
st = &states[get_pm_cur_state()];
/* enter action */
{
struct state *st;
- if (display_lock_is_state_locked(DEVICED_DISPLAY_STATE_ON) || display_lock_is_state_locked(DEVICED_DISPLAY_STATE_DIM)) {
+ if (display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_ON) || display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)) {
/*
* When another proccess is normal lock, device is received call then,
* call app can be changed to lcd state by proximity.
*/
if (flag & LCD_OFF_BY_PROXIMITY) {
_I("custom lcd off by proximity, delete normal lock");
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
} else {
_I("skip custom lcd off");
return -ECANCELED;
}
_I("custom lcd off by flag(%d)", flag);
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
lcd_off_procedure(flag);
if (set_custom_lcdon_timeout(0) == true)
/* state transition */
set_pm_old_state(get_pm_cur_state());
- set_pm_cur_state(DEVICED_DISPLAY_STATE_OFF);
+ set_pm_cur_state(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
st = &states[get_pm_cur_state()];
/* enter action */
/* state transition */
set_pm_old_state(get_pm_cur_state());
- set_pm_cur_state(DEVICED_DISPLAY_STATE_ON);
+ set_pm_cur_state(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
st = &states[get_pm_cur_state()];
/* enter action */
str_len = strlen(reason);
if (!strncmp(reason, GESTURE_STR, str_len)) {
- if (display_lock_is_state_locked(DEVICED_DISPLAY_STATE_ON) || display_lock_is_state_locked(DEVICED_DISPLAY_STATE_DIM)) {
+ if (display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_ON) || display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)) {
_I("skip platform lcd off by gesture");
return -ECANCELED;
}
flag = LCD_OFF_BY_GESTURE;
} else if (!strncmp(reason, PALM_STR, str_len)) {
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
flag = LCD_OFF_BY_PALM;
} else if (!strncmp(reason, DISPLAY_DETACH_STR, str_len)) {
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
flag = LCD_OFF_BY_DISPLAY_DETACH;
} else {
}
_I("platform lcd off by %s", reason);
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
lcd_off_procedure(flag);
/* state transition */
set_pm_old_state(get_pm_cur_state());
- set_pm_cur_state(DEVICED_DISPLAY_STATE_OFF);
+ set_pm_cur_state(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
st = &states[get_pm_cur_state()];
/* enter action */
static int default_proc_change_state(unsigned int cond, pid_t pid)
{
- enum deviced_display_state next;
+ enum syscommon_deviced_display_state next;
next = GET_COND_STATE(cond);
_I("Change process(%d) state to %s.", pid, states[next].name);
switch (next) {
- case DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
if (check_lcd_is_on() == false)
display_panel_lcd_on_direct(LCD_ON_BY_EVENT);
display_state_transition_update_lock_screen_timeout(LOCK_SCREEN_CONTROL_TIMEOUT);
display_state_transition_do_proc_change_state_action(next, -1);
break;
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
display_state_transition_do_proc_change_state_action(next, -1);
break;
- case DEVICED_DISPLAY_STATE_OFF:
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
lcd_off_procedure(LCD_OFF_BY_EVENT);
if (set_custom_lcdon_timeout(0))
display_state_transition_update_display_state_timeout_by_priority();
display_state_transition_do_proc_change_state_action(next, -1);
break;
- case DEVICED_DISPLAY_STATE_SLEEP:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP:
_I("Dangerous requests.");
/* at first LCD_OFF and then goto sleep */
/* state transition */
- display_state_transition_do_proc_change_state_action(DEVICED_DISPLAY_STATE_OFF, TIMEOUT_NONE);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_OFF);
+ display_state_transition_do_proc_change_state_action(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, TIMEOUT_NONE);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
if (lcdon_broadcast) {
_I("broadcast lcd off signal at non-lcd device");
broadcast_lcd_off(SIGNAL_PRE, 0);
broadcast_lcd_off(SIGNAL_POST, 0);
}
- display_state_transition_do_proc_change_state_action(DEVICED_DISPLAY_STATE_SLEEP, TIMEOUT_NONE);
+ display_state_transition_do_proc_change_state_action(SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP, TIMEOUT_NONE);
break;
default:
{
struct state *st = &states[get_pm_cur_state()];
int ret;
- enum deviced_display_state next_state;
+ enum syscommon_deviced_display_state next_state;
display_state_transition_get_next_transition_display_state(get_pm_cur_state(), &next_state, evt);
ret = is_lcdon_blocked();
if (ret != LCDON_BLOCK_NONE) {
- if (next_state == DEVICED_DISPLAY_STATE_ON || next_state == DEVICED_DISPLAY_STATE_DIM) {
+ if (next_state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON || next_state == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) {
_W("LCDON is blocked, %d.", ret);
return -1;
}
/* enter action */
if (st->action) {
- if (get_pm_cur_state() == DEVICED_DISPLAY_STATE_OFF)
+ if (get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
display_state_transition_update_lcdoff_reason(VCONFKEY_PM_LCDOFF_BY_TIMEOUT);
- if ((get_pm_cur_state() == DEVICED_DISPLAY_STATE_ON) || (get_pm_cur_state() == DEVICED_DISPLAY_STATE_OFF))
+ if ((get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) || (get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF))
if (set_custom_lcdon_timeout(0) == true)
display_state_transition_update_display_state_timeout_by_priority();
/* enter next state directly */
states[get_pm_cur_state()].trans(EVENT_TIMEOUT);
} else {
- if ((get_pm_cur_state() == DEVICED_DISPLAY_STATE_SLEEP)
+ if ((get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP)
&& (syscommon_is_emulator() == true || timeout_sleep_support == false))
return 0;
ret = is_lcdon_blocked();
if (ret != LCDON_BLOCK_NONE) {
- if ((get_pm_cur_state() == DEVICED_DISPLAY_STATE_ON) || (get_pm_cur_state() == DEVICED_DISPLAY_STATE_DIM)) {
+ if ((get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) || (get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)) {
_W("LCDON is blocked, %d.", ret);
return -ENOTSUP;
}
}
- if (get_pm_cur_state() != DEVICED_DISPLAY_STATE_SLEEP) {
- if ((get_pm_cur_state() == DEVICED_DISPLAY_STATE_ON)) {
+ if (get_pm_cur_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP) {
+ if ((get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)) {
if (display_panel_calculate_diff_time_between_lcd_on_direct_and_state_action(&diff_time) == 0) {
timeout -= diff_time;
}
/* set timer with current state timeout */
display_state_transition_reset_state_transition_timeout(timeout);
- if (get_pm_cur_state() == DEVICED_DISPLAY_STATE_ON) {
+ if (get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) {
time(&last_update_time);
last_timeout = timeout;
} else {
}
}
- if ((get_pm_cur_state() != get_pm_old_state()) && (get_pm_cur_state() != DEVICED_DISPLAY_STATE_SLEEP)) {
+ if ((get_pm_cur_state() != get_pm_old_state()) && (get_pm_cur_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP)) {
power_request_change_state_strict(DEVICED_POWER_STATE_SLEEP, DEVICED_POWER_STATE_NORMAL,
power_get_wakeup_reason(), NULL);
set_setting_pmstate(get_pm_cur_state());
syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LCD, (void *)&pm_cur_state);
}
- if ((get_pm_old_state() == DEVICED_DISPLAY_STATE_ON) && (get_pm_cur_state() != DEVICED_DISPLAY_STATE_ON)) {
+ if ((get_pm_old_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) && (get_pm_cur_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_ON)) {
time(&now);
diff = difftime(now, last_update_time);
- _I("DEVICED_DISPLAY_STATE_ON is changed to %s (timeout=%d ms diff=%.0f s).",
+ _I("SYSCOMMON_DEVICED_DISPLAY_STATE_ON is changed to %s (timeout=%d ms diff=%.0f s).",
states[get_pm_cur_state()].name, last_timeout, diff);
}
update_bds_record(get_pm_cur_state());
switch (get_pm_cur_state()) {
- case DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
/*
* normal state : backlight on and restore
* the previous brightness
*/
- if (get_pm_old_state() == DEVICED_DISPLAY_STATE_DIM)
+ if (get_pm_old_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)
display_backlight_update_by_default_brightness();
if (check_lcd_is_on() == false)
lcd_on_procedure(LCD_NORMAL, NORMAL_MODE);
break;
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
display_backlight_get_custom_status(&custom_status);
- if ((get_pm_old_state() == DEVICED_DISPLAY_STATE_ON) && custom_status) {
+ if ((get_pm_old_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) && custom_status) {
display_backlight_get_brightness(&brightness);
display_backlight_set_custom_brightness(brightness);
}
/* lcd dim state : dim the brightness */
display_backlight_set_brightness_by_dim_brightness();
- if ((get_pm_old_state() == DEVICED_DISPLAY_STATE_OFF) || (get_pm_old_state() == DEVICED_DISPLAY_STATE_SLEEP))
+ if ((get_pm_old_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF) || (get_pm_old_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP))
lcd_on_procedure(LCD_DIM, NORMAL_MODE);
break;
- case DEVICED_DISPLAY_STATE_OFF:
- if ((get_pm_old_state() != DEVICED_DISPLAY_STATE_SLEEP) && (get_pm_old_state() != DEVICED_DISPLAY_STATE_OFF)) {
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
+ if ((get_pm_old_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP) && (get_pm_old_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)) {
/* lcd off state : turn off the backlight */
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
}
display_panel_get_lcd_paneloff_mode(&lcd_paneloff_mode);
- if (display_panel_get_dpms_cached_state() == DPMS_ON
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON
|| lcd_paneloff_mode)
lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
break;
- case DEVICED_DISPLAY_STATE_SLEEP:
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP:
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
if (!pm_get_power_lock_support()) {
set_lock_screen_state(val);
/* LCD on if lock screen show before waiting time */
- if ((get_pm_cur_state() == DEVICED_DISPLAY_STATE_ON) &&
+ if ((get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) &&
val == VCONFKEY_IDLE_LOCK &&
- display_panel_get_dpms_cached_state() != DPMS_ON &&
+ display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON &&
is_lcdon_blocked() == LCDON_BLOCK_NONE)
lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
display_state_transition_update_display_state_timeout_by_priority();
- if (get_pm_cur_state() == DEVICED_DISPLAY_STATE_ON)
+ if (get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
states[get_pm_cur_state()].trans(EVENT_INPUT);
break;
case SETTING_LOCK_SCREEN_BG:
set_lock_screen_bg_state(val);
display_state_transition_update_display_state_timeout_by_priority();
- if (get_pm_cur_state() == DEVICED_DISPLAY_STATE_ON)
+ if (get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
states[get_pm_cur_state()].trans(EVENT_INPUT);
break;
case SETTING_POWER_CUSTOM_BRIGHTNESS:
static void init_display_states(void *data)
{
struct display_plugin *dp = (struct display_plugin *) data;
- for(int i = 0; i < DEVICED_DISPLAY_STATE_END; i++)
+ for(int i = 0; i < SYSCOMMON_DEVICED_DISPLAY_STATE_END; i++)
dp->display_states[i] = &states[i];
}
/**
static int aod_normal_level = -1;
static int aod_min_level = -1;
static int aod_charging_level = -1;
-static const struct deviced_display_config *display_conf;
+static const struct syscommon_deviced_display_config *display_conf;
static struct battery_status *battery = NULL;
static struct battery_status* (*fp_get_var_battery_status)(void);
display_backlight_get_brightness(&brt);
- if (state == DPMS_OFF) {
+ if (state == SYSCOMMON_DEVICED_DPMS_OFF) {
start = brt;
/*
{
int state = display_panel_get_dpms_cached_state();
- if ((state == DPMS_DETACH) || (state == -EINVAL))
+ if ((state == SYSCOMMON_DEVICED_DPMS_DETACH) || (state == -EINVAL))
return LCDON_BLOCK_WHEN_DISPLAY_DETACHED;
return LCDON_BLOCK_NONE;
autobrt_timer = 0;
/* If it is still not turned on, do not apply auto brightness */
- if (display_panel_get_dpms_cached_state() != DPMS_ON)
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
return G_SOURCE_REMOVE;
- display_backlight_change_brightness_by_dpms_state(DPMS_ON);
+ display_backlight_change_brightness_by_dpms_state(SYSCOMMON_DEVICED_DPMS_ON);
set_brightness_level(level);
/* lcdon is completed, aod disappered */
if (aod_clock_displayed) {
autobrtlevel = level; /* reserve the level, defer applying */
autobrt_timer = g_timeout_add(200, lcdon_from_aod_cb, (gpointer)(intptr_t) level);
- } else { /* DEVICED_DISPLAY_STATE_ON state or LCDON from usual OFF state, not from AOD */
+ } else { /* SYSCOMMON_DEVICED_DISPLAY_STATE_ON state or LCDON from usual OFF state, not from AOD */
set_brightness_level(level);
}
if (!aod_clock_displayed)
return;
- display_backlight_change_brightness_by_dpms_state(DPMS_ON);
+ display_backlight_change_brightness_by_dpms_state(SYSCOMMON_DEVICED_DPMS_ON);
if (autobrt_timer) { /* if there is reserved level, apply it */
g_source_remove(autobrt_timer);
autobrt_timer = 0;
static int display_state_changed(void *data)
{
- enum deviced_display_state state;
+ enum syscommon_deviced_display_state state;
int ret = 0;
state = DATA_VALUE_INT(data);
- if (state == DEVICED_DISPLAY_STATE_ON)
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
ret = sys_set_int(CHARGER_LCD_NODE, CHARGING_LCD_ON);
else
ret = sys_set_int(CHARGER_LCD_NODE, CHARGING_LCD_OFF);
state = DATA_VALUE_INT(data);
- if (state == DEVICED_DISPLAY_STATE_ON)
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
enhance_update_state();
return 0;
{
timer = 0;
- if (get_pm_cur_state() != DEVICED_DISPLAY_STATE_ON) {
+ if (get_pm_cur_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_ON) {
_D("Hbm timeout, but it's not display normal.");
return G_SOURCE_REMOVE;
}
return 0;
switch (state) {
- case DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
/*
* outdoor-enhance-mode not supported
* : check & restore hbm always.
* outdoor-enhance-mode supported
* : check & restore hbm when old state is dim only.
*/
- if (!get_outdoor_setting || (get_pm_old_state() == DEVICED_DISPLAY_STATE_DIM))
+ if (!get_outdoor_setting || (get_pm_old_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM))
hbm_check_timeout();
break;
- case DEVICED_DISPLAY_STATE_DIM:
- case DEVICED_DISPLAY_STATE_OFF:
- case DEVICED_DISPLAY_STATE_SLEEP:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP:
ret = auto_brightness_control(BR_HBM_OFF, BR_IMPLICIT);
if (ret < 0)
_E("Failed to off hbm.");
syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD, display_state_changed);
/* double check to guarantee HBMOFF before DPMS OFF */
- display_panel_register_dpms_checklist(DPMS_OFF, dpms_check_hbm_off);
+ display_panel_register_dpms_checklist(SYSCOMMON_DEVICED_DPMS_OFF, dpms_check_hbm_off);
}
static void hbm_exit(void *data)
static inline int current_state_in_on(void)
{
- return ((get_pm_cur_state() == DEVICED_DISPLAY_STATE_DIM) || (get_pm_cur_state() == DEVICED_DISPLAY_STATE_ON));
+ return ((get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) || (get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_ON));
}
static inline void restore_custom_brightness(void)
bool custom_status;
display_backlight_get_custom_status(&custom_status);
- if ((get_pm_cur_state() == DEVICED_DISPLAY_STATE_DIM) && custom_status)
+ if ((get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) && custom_status)
display_backlight_update_by_custom_brightness();
}
if (current_state_in_on())
return false;
- if (display_panel_get_dpms_cached_state() == DPMS_ON) {
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON) {
if (ambient_get_state() == false)
return false;
}
if (!current_state_in_on())
return;
- if (display_panel_get_dpms_cached_state() == DPMS_OFF)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_OFF)
return;
broadcast_lcdoff_by_powerkey();
{
/* It's not needed if it's already LCD off state */
if (!current_state_in_on() &&
- display_panel_get_dpms_cached_state() != DPMS_ON)
+ display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
return false;
/*
if (decide_lcdoff() == true) {
update_auto_brightness(false);
switch_off_lcd();
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
display_state_transition_update_lcdoff_reason(VCONFKEY_PM_LCDOFF_BY_POWERKEY);
display_state_transition_request_state_transition_with_option(DEVICED_EVENT_INPUT_POWERKEY, LCD_OFF);
} else {
int ignore = true;
static int value = KEY_RELEASED;
unsigned int caps;
- const struct deviced_display_config *display_conf = get_var_display_config();
+ const struct syscommon_deviced_display_config *display_conf = get_var_display_config();
if (!display_conf) {
_E("Failed to get display configuration variable.");
return ignore;
if (!current_state_in_on())
return false;
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
display_state_transition_update_lcdoff_reason(VCONFKEY_PM_LCDOFF_BY_POWERKEY);
/* LCD off forcly */
break;
case EV_REL:
- if ((get_pm_cur_state() == DEVICED_DISPLAY_STATE_OFF) && bezel_wakeup) {
+ if ((get_pm_cur_state() == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF) && bezel_wakeup) {
switch_on_lcd(LCD_ON_BY_BEZEL);
ignore = false;
- } else if (get_pm_cur_state() != DEVICED_DISPLAY_STATE_OFF)
+ } else if (get_pm_cur_state() != SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
ignore = false;
break;
case EV_ABS:
display_backlight_update_by_default_brightness();
get_run_timeout(&timeout);
- display_plugin_state_set_timeout(DEVICED_DISPLAY_STATE_ON, timeout);
+ display_plugin_state_set_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, timeout);
display_plugin_state_do_default_trans(get_pm_cur_state(), EVENT_INPUT);
return 0;
_I("Request swim mode state %d by %d", val, pid);
- if (display_panel_get_dpms_cached_state() != DPMS_ON) {
- display_state_transition_request_state_transition_with_option(DEVICED_EVENT_MISC_SWIMMODE, DEVICED_DISPLAY_STATE_ON);
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON) {
+ display_state_transition_request_state_transition_with_option(DEVICED_EVENT_MISC_SWIMMODE, SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
lcd_state = true;
}
swim_execute((void *)((intptr_t)val));
if (lcd_state) {
- display_state_transition_request_state_transition_with_option(DEVICED_EVENT_MISC_SWIMMODE, DEVICED_DISPLAY_STATE_OFF);
+ display_state_transition_request_state_transition_with_option(DEVICED_EVENT_MISC_SWIMMODE, SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
}
}
static char *prev_appid;
static char *cur_appid;
-static enum deviced_display_state prev_lcd_state = DEVICED_DISPLAY_STATE_OFF;
+static enum syscommon_deviced_display_state prev_lcd_state = SYSCOMMON_DEVICED_DISPLAY_STATE_OFF;
/*
* hash map for app_time_map_st1
prev_appid = g_strdup(cur_appid);
}
-int update_bds_record(enum deviced_display_state cur_lcd_state)
+int update_bds_record(enum syscommon_deviced_display_state cur_lcd_state)
{
unsigned long elapsed = 0;
}
/* no effect : prev state(lcd off) -> on or off */
- if (prev_lcd_state >= DEVICED_DISPLAY_STATE_OFF) {
+ if (prev_lcd_state >= SYSCOMMON_DEVICED_DISPLAY_STATE_OFF) {
/* reset start time and timer if off -> on */
- if (cur_lcd_state <= DEVICED_DISPLAY_STATE_DIM) {
+ if (cur_lcd_state <= SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) {
bds_set_start_time();
bds_timer_start();
init_bds_brightness_time();
update_appid();
/* bds session end : lcd on -> off */
- if (prev_lcd_state <= DEVICED_DISPLAY_STATE_DIM && cur_lcd_state >= DEVICED_DISPLAY_STATE_OFF)
+ if (prev_lcd_state <= SYSCOMMON_DEVICED_DISPLAY_STATE_DIM && cur_lcd_state >= SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
bds_builder_update_bds_data();
prev_lcd_state = cur_lcd_state;
update_bds_record(prev_lcd_state);
/* pass. lcd on->off already handled */
- if (prev_lcd_state <= DEVICED_DISPLAY_STATE_DIM)
+ if (prev_lcd_state <= SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)
bds_builder_update_bds_data();
reply = bds_builder_get_gvariant();
init_bds_brightness_time();
- if (prev_lcd_state <= DEVICED_DISPLAY_STATE_DIM) {
+ if (prev_lcd_state <= SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) {
bds_set_start_time();
bds_timer_start();
}
#include "core.h"
typedef struct {
- int (*update_bds_record)(enum deviced_display_state lcd_state);
+ int (*update_bds_record)(enum syscommon_deviced_display_state lcd_state);
int (*update_bds_brightness_record)(unsigned int val);
} _battery_monitor_ops;
-int update_bds_record(enum deviced_display_state lcd_state);
+int update_bds_record(enum syscommon_deviced_display_state lcd_state);
int update_bds_brightness_record(unsigned int val);
#endif /* __BATTERY_MONITOR_H__ */
\ No newline at end of file
static guint power_timer;
static device_notifier_state_e old_state = -1;
-static enum deviced_display_state g_display_state = DEVICED_DISPLAY_STATE_ON;
+static enum syscommon_deviced_display_state g_display_state = SYSCOMMON_DEVICED_DISPLAY_STATE_ON;
static struct battery_config_info g_battery_info;
int block = 0, theater = 0, night = 0;
int r;
- if (g_display_state == DEVICED_DISPLAY_STATE_OFF) {
+ if (g_display_state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF) {
r = vconf_get_bool(VCONFKEY_SETAPPL_BLOCKMODE_WEARABLE_BOOL, &block);
if (r < 0)
_E("Failed to set vconf value for blockmode wearable: %d", vconf_get_ext_errno());
val = vconf_keynode_get_bool(key_nodes);
if (val != ambient_condition) {
- if (display_panel_get_dpms_cached_state() != DPMS_ON)
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
display_state_transition_request_state_transition_with_option(DEVICED_EVENT_DISPLAY_AMBIENT, LCD_NORMAL);
}
if (syscommon_is_emulator()) {
/* In emulator, deviced does not turn off the display. */
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
return;
}
*/
display_state_transition_reset_state_transition_timeout(TIMEOUT_NONE);
- lcd_direct_control(DPMS_OFF, NORMAL_MODE);
+ lcd_direct_control(SYSCOMMON_DEVICED_DPMS_OFF, NORMAL_MODE);
broadcast_lcd_off_late(LCD_OFF_LATE_MODE);
}
static void ambient_start_clock(void)
{
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
ret = display_state_get_current(¤t);
if (ret < 0)
return;
- if ((current == DEVICED_DISPLAY_STATE_ON) ||
- (current == DEVICED_DISPLAY_STATE_DIM) ||
+ if ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) ||
+ (current == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) ||
(ambient_state == false))
return;
static void ambient_end_clock(pid_t pid)
{
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
ret = display_state_get_current(¤t);
if (ret < 0)
return;
- if ((current == DEVICED_DISPLAY_STATE_ON) ||
- (current == DEVICED_DISPLAY_STATE_DIM) ||
+ if ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) ||
+ (current == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) ||
(ambient_state == false))
return;
_I("Display off in suspend state.");
ambient_set_state(false);
- lcd_direct_control(DPMS_OFF, NORMAL_MODE);
+ lcd_direct_control(SYSCOMMON_DEVICED_DPMS_OFF, NORMAL_MODE);
broadcast_lcd_off_late(LCD_OFF_LATE_MODE);
display_lock_request_unlock_with_option(DEVICED_EVENT_DISPLAY_AMBIENT, LCD_OFF, PM_SLEEP_MARGIN);
* @brief State structure
*/
struct state {
- enum deviced_display_state state; /**< state number */
+ enum syscommon_deviced_display_state state; /**< state number */
const char *name; /**< state name (string) */
int (*trans) (int evt); /**< transition function pointer */
int (*action) (int timeout); /**< enter action */
int timeout;
};
-struct state *state_st(enum deviced_display_state state);
+struct state *state_st(enum syscommon_deviced_display_state state);
/*
* Global variables
* display_conf : configuration of display
*/
-const struct deviced_display_config* get_var_display_config();
+const struct syscommon_deviced_display_config* get_var_display_config();
typedef struct {
pid_t pid;
unsigned int timeout2;
} PMMsg;
-extern struct state state[DEVICED_DISPLAY_STATE_END];
+extern struct state state[SYSCOMMON_DEVICED_DISPLAY_STATE_END];
/* setting.c */
int get_lock_screen_bg_state(void);
void set_lock_screen_bg_state(bool state);
/* core.c */
-int delete_condition(enum deviced_display_state state);
+int delete_condition(enum syscommon_deviced_display_state state);
int custom_lcdoff(enum device_flags flag);
void broadcast_lcd_off_late(enum device_flags flags);
int init_pm_dbus(void);
/* slave-logging.c */
-int save_pmlock(enum deviced_display_state state, bool on, pid_t pid);
+int save_pmlock(enum syscommon_deviced_display_state state, bool on, pid_t pid);
/**
* @}
/* FIXME: display_backlight_get_brightness is duplicated, this code structure should be changed */
/* It was operated only AOD enter & leave. */
-int display_backlight_change_brightness_by_dpms_state(enum dpms_state state)
+int display_backlight_change_brightness_by_dpms_state(enum syscommon_deviced_dpms_state state)
{
int brt, val;
int start, end;
display_backlight_get_brightness(&brt);
- if (state == DPMS_OFF) {
+ if (state == SYSCOMMON_DEVICED_DPMS_OFF) {
start = brt;
end = g_display_plugin.config->aod_enter_level;
ret = display_backlight_set_brightness(PM_DIM_BRIGHTNESS);
#ifdef ENABLE_PM_LOG
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
if (display_state_get_current(¤t) < 0)
return ret;
#ifndef __DISPLAY_BACKLIGHT_H__
#define __DISPLAY_BACKLIGHT_H__
+#include <system/syscommon-plugin-deviced-display-interface.h>
#include "display-panel.h"
struct display_backlight_ops {
int display_backlight_set_brightness(int brightness);
int display_backlight_get_brightness(int *brightness);
void display_backlight_change_brightness(int start, int end, int step);
-int display_backlight_change_brightness_by_dpms_state(enum dpms_state state);
+int display_backlight_change_brightness_by_dpms_state(enum syscommon_deviced_dpms_state state);
int display_backlight_set_default_brightness(int brightness);
int display_backlight_get_default_brightness(int *brightness);
int display_backlight_update_by_default_brightness(void);
static int display_config_parse(struct parse_result *result, void *user_data)
{
- struct deviced_display_config *c = user_data;
+ struct syscommon_deviced_display_config *c = user_data;
_D("display_load_config: section=%s name=%s value=%s", result->section, result->name, result->value);
c->display_on_usb_conn_changed = (MATCH(result->value, "yes") ? true : false);
} else if (MATCH(result->name, "DisplayInitDirection")) {
c->display_init_direction = (MATCH(result->value, "vertical") ? \
- DEVICED_DISPLAY_ORIENTATION_VERTICAL : DEVICED_DISPLAY_ORIENTATION_HORIZONTAL);
+ SYSCOMMON_DEVICED_DISPLAY_ORIENTATION_VERTICAL : SYSCOMMON_DEVICED_DISPLAY_ORIENTATION_HORIZONTAL);
} else if (MATCH(result->name, "DisplayDPMSType")) {
c->display_dpms_type = (MATCH(result->value, "none") ? \
- DEVICED_DPMS_TYPE_NONE : DEVICED_DPMS_TYPE_WINDOW_MANAGER);
+ SYSCOMMON_DEVICED_DPMS_TYPE_NONE : SYSCOMMON_DEVICED_DPMS_TYPE_WINDOW_MANAGER);
}
return 0;
}
-int display_load_config(struct deviced_display_config *config)
+int display_load_config(struct syscommon_deviced_display_config *config)
{
return config_parse(DISPLAY_CONF_FILE, display_config_parse, config);
}
#define DISPLAY_CONF_FILE "/etc/deviced/display.conf"
-int display_load_config(struct deviced_display_config *config);
+int display_load_config(struct syscommon_deviced_display_config *config);
#endif //__DISPLAY_CONFIG_H__
const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
{
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
int brt = -1, ret, result;
if (display_state_get_current(¤t) < 0) {
goto out;
}
- if (current == DEVICED_DISPLAY_STATE_ON) {
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) {
ret = display_backlight_get_brightness(&brt);
if (ret < 0)
result = 0;
else
result = brt;
- } else if (current == DEVICED_DISPLAY_STATE_DIM) {
+ } else if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) {
ret = vconf_get_int(VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS, &brt);
if (ret < 0) {
_E("Failed to get vconf value for lcd dim brightness: %d", vconf_get_ext_errno());
_E("Failed to set vconf value for lcd brightness: %d", vconf_get_ext_errno());
}
} else if (state == DISPLAY_STATE_SCREEN_DIM) {
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
ret = display_state_get_current(¤t);
if (ret < 0)
goto error;
- if (current == DEVICED_DISPLAY_STATE_DIM) {
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM) {
ret = display_backlight_set_brightness(brt);
if (ret < 0)
goto error;
unsigned int custom_normal_timeout = 0;
unsigned int custom_dim_timeout = 0;
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
if (on == 0 && dim == 0) {
_I("LCD timeout changed: default setting");
- display_state_transition_set_custom_timeout(DEVICED_DISPLAY_STATE_ON, 0);
- display_state_transition_set_custom_timeout(DEVICED_DISPLAY_STATE_DIM, 0);
+ display_state_transition_set_custom_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, 0);
+ display_state_transition_set_custom_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, 0);
} else if (on < 0 || dim < 0) {
_E("Failed to set value(on=%d dim=%d).", on, dim);
return -EINVAL;
} else {
_I("LCD timeout changed: on=%ds dim=%ds", on, dim);
- display_state_transition_set_custom_timeout(DEVICED_DISPLAY_STATE_ON, SEC_TO_MSEC(on));
- display_state_transition_set_custom_timeout(DEVICED_DISPLAY_STATE_DIM, SEC_TO_MSEC(dim));
+ display_state_transition_set_custom_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, SEC_TO_MSEC(on));
+ display_state_transition_set_custom_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, SEC_TO_MSEC(dim));
}
ret = display_state_get_current(¤t);
/* Apply new backlight time */
display_state_transition_update_display_state_timeout_by_priority();
- if (current == DEVICED_DISPLAY_STATE_ON)
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
display_state_transition_do_state_transition(current, EVENT_INPUT);
if (custom_change_name) {
custom_change_name = 0;
}
- display_state_transition_get_custom_timeout(DEVICED_DISPLAY_STATE_ON, &custom_normal_timeout);
- display_state_transition_get_custom_timeout(DEVICED_DISPLAY_STATE_DIM, &custom_dim_timeout);
+ display_state_transition_get_custom_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, &custom_normal_timeout);
+ display_state_transition_get_custom_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, &custom_dim_timeout);
if (custom_normal_timeout == 0 && custom_dim_timeout == 0)
return 0;
custom_change_name = strndup(name, strlen(name));
if (!custom_change_name) {
_E("Failed to malloc.");
- display_state_transition_set_custom_timeout(DEVICED_DISPLAY_STATE_ON, 0);
- display_state_transition_set_custom_timeout(DEVICED_DISPLAY_STATE_DIM, 0);
+ display_state_transition_set_custom_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, 0);
+ display_state_transition_set_custom_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, 0);
return -ENOMEM;
}
const gchar *unique_name,
gpointer data)
{
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
int ret;
if (!sender)
free(custom_change_name);
custom_change_name = 0;
- display_state_transition_set_custom_timeout(DEVICED_DISPLAY_STATE_ON, 0);
- display_state_transition_set_custom_timeout(DEVICED_DISPLAY_STATE_DIM, 0);
+ display_state_transition_set_custom_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, 0);
+ display_state_transition_set_custom_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, 0);
ret = display_state_get_current(¤t);
if (ret < 0)
return;
display_state_transition_update_display_state_timeout_by_priority();
- if (current == DEVICED_DISPLAY_STATE_ON)
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
display_state_transition_do_state_transition(current, EVENT_INPUT);
}
pid_t pid;
pid = gdbus_connection_get_sender_pid(conn, sender);
- _I("Change state to DEVICED_DISPLAY_STATE_ON pid=%d", pid);
+ _I("Change state to SYSCOMMON_DEVICED_DISPLAY_STATE_ON pid=%d", pid);
g_variant_get(param, "(i)", &timeout);
pid_t pid;
pid = gdbus_connection_get_sender_pid(conn, sender);
- _I("Change state to DEVICED_DISPLAY_STATE_OFF pid=%d", pid);
+ _I("Change state to SYSCOMMON_DEVICED_DISPLAY_STATE_OFF pid=%d", pid);
g_variant_get(param, "(s)", &reason_str);
g_variant_get(param, "(isi)", &next_state, &reason, &timeout);
if (next_state == DISPLAY_STATE_NORMAL) {
- state = "DEVICED_DISPLAY_STATE_ON";
+ state = "SYSCOMMON_DEVICED_DISPLAY_STATE_ON";
ret = display_panel_display_turn_on_by_reason(reason, timeout);
} else if (next_state == DISPLAY_STATE_SCREEN_OFF) {
- state = "DEVICED_DISPLAY_STATE_OFF";
+ state = "SYSCOMMON_DEVICED_DISPLAY_STATE_OFF";
ret = display_panel_display_turn_off_by_reason(reason);
} else if (next_state == DISPLAY_STATE_SCREEN_DIM) {
- state = "DEVICED_DISPLAY_STATE_DIM";
+ state = "SYSCOMMON_DEVICED_DISPLAY_STATE_DIM";
ret = -EINVAL;
} else {
state = "unknown";
GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
{
int dimstay, ret = 0;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
pid_t pid;
g_variant_get(param, "(i)", &dimstay);
if (ret < 0)
goto out;
- if (current == DEVICED_DISPLAY_STATE_ON)
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
display_backlight_update_by_default_brightness();
out:
int ret;
int display_index;
enum hal_device_display_rotation_angle angle;
- enum deviced_display_orientation init_direction;
+ enum syscommon_deviced_display_orientation init_direction;
g_variant_get(param, "(i)", &display_index);
ret = hal_device_display_get_rotation_angle(display_index, &angle);
{
power_lock_e power_lock_type;
bool pmlock_state = false;
- enum deviced_display_state pmlock_type;
+ enum syscommon_deviced_display_state pmlock_type;
pid_t pid;
g_variant_get(param, "(i)", &power_lock_type);
GList *elem;
void (*checker)(void);
- if (mode == DPMS_ON)
+ if (mode == SYSCOMMON_DEVICED_DPMS_ON)
SYS_G_LIST_FOREACH(dpms_on_checklist, elem, checker)
checker();
- else if (mode == DPMS_OFF || mode == DPMS_FORCE_OFF)
+ else if (mode == SYSCOMMON_DEVICED_DPMS_OFF || mode == SYSCOMMON_DEVICED_DPMS_FORCE_OFF)
SYS_G_LIST_FOREACH(dpms_off_checklist, elem, checker)
checker();
}
return;
CRITICAL_LOG("%s registered dpms(%s) checklist, %p.", caller,
- mode == DPMS_ON ? "DPMS_ON" :
- mode == DPMS_OFF ? "DPMS_OFF" :
- mode == DPMS_FORCE_OFF ? "DPMS_FORCE_OFF" : "Unknown",
+ mode == SYSCOMMON_DEVICED_DPMS_ON ? "SYSCOMMON_DEVICED_DPMS_ON" :
+ mode == SYSCOMMON_DEVICED_DPMS_OFF ? "SYSCOMMON_DEVICED_DPMS_OFF" :
+ mode == SYSCOMMON_DEVICED_DPMS_FORCE_OFF ? "SYSCOMMON_DEVICED_DPMS_FORCE_OFF" : "Unknown",
checker);
- if (mode == DPMS_ON)
+ if (mode == SYSCOMMON_DEVICED_DPMS_ON)
SYS_G_LIST_APPEND(dpms_on_checklist, checker);
- else if (mode == DPMS_OFF || mode == DPMS_FORCE_OFF)
+ else if (mode == SYSCOMMON_DEVICED_DPMS_OFF || mode == SYSCOMMON_DEVICED_DPMS_FORCE_OFF)
SYS_G_LIST_APPEND(dpms_off_checklist, checker);
}
}
switch (g_display_plugin.config->display_dpms_type) {
- case DEVICED_DPMS_TYPE_WINDOW_MANAGER:
+ case SYSCOMMON_DEVICED_DPMS_TYPE_WINDOW_MANAGER:
g_dpms_ops.set_state = wm_dpms_set_state;
g_dpms_ops.get_state = wm_dpms_get_state;
g_dpms_ops.get_cached_state = wm_dpms_get_cached_state;
g_dpms_ops.init = wm_dpms_init;
g_dpms_ops.exit = wm_dpms_exit;
break;
- case DEVICED_DPMS_TYPE_NONE:
+ case SYSCOMMON_DEVICED_DPMS_TYPE_NONE:
g_dpms_ops.set_state = none_dpms_set_state;
g_dpms_ops.get_state = none_dpms_get_state;
g_dpms_ops.get_cached_state = none_dpms_get_cached_state;
#ifndef __DISPLAY_DPMS_H__
#define __DISPLAY_DPMS_H__
-/**
- * FIXME: Need to replace it with libsyscommon one, enum deviced_dpms_state.
- */
-enum dpms_state {
- DPMS_ON, /* In use */
- DPMS_STANDBY, /* Blanked, low power */
- DPMS_SUSPEND, /* Blanked, lower power */
- DPMS_OFF, /* Shut off, awaiting activity */
- DPMS_FORCE_OFF,/* Force Shut off */
- DPMS_DETACH, /* Display detached */
-};
-
void dpms_set_state(int on);
int dpms_get_state(void);
int dpms_get_cached_state(void);
#define LOCK_WATCHDOG_PERIOD_SEC 600
struct display_lock {
- enum deviced_display_state state;
+ enum syscommon_deviced_display_state state;
pid_t pid;
guint timeout_id;
guint warning_id;
GList *l;
};
-static GList *g_display_fglock_list[DEVICED_DISPLAY_STATE_END]; /* lock requested by foreground app */
-static GList *g_display_bglock_list[DEVICED_DISPLAY_STATE_END]; /* lock requested by background app */
+static GList *g_display_fglock_list[SYSCOMMON_DEVICED_DISPLAY_STATE_END]; /* lock requested by foreground app */
+static GList *g_display_bglock_list[SYSCOMMON_DEVICED_DISPLAY_STATE_END]; /* lock requested by background app */
-static void broadcast_lock_changed(enum deviced_display_state state);
+static void broadcast_lock_changed(enum syscommon_deviced_display_state state);
static gboolean __find_lock(gconstpointer data, gconstpointer udata)
{
return -1;
}
-static struct display_lock* find_lock(enum deviced_display_state state, pid_t pid)
+static struct display_lock* find_lock(enum syscommon_deviced_display_state state, pid_t pid)
{
GList *l;
/* Add lock to list */
static void add_lock(struct display_lock *dl)
{
- enum deviced_display_state state;
+ enum syscommon_deviced_display_state state;
if (!dl)
return;
*/
static void remove_lock(struct display_lock *dl)
{
- enum deviced_display_state state;
+ enum syscommon_deviced_display_state state;
if (!dl)
return;
static void free_lock(struct display_lock *dl)
{
- enum deviced_display_state state;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state state;
+ enum syscommon_deviced_display_state current;
int ret;
if (!dl)
add_lock(dl);
}
-int display_lock_is_state_locked(enum deviced_display_state state)
+int display_lock_is_state_locked(enum syscommon_deviced_display_state state)
{
return (g_display_fglock_list[state] != NULL);
}
-enum deviced_display_state power_lock_type_to_pmlock(power_lock_e power_lock_type)
+enum syscommon_deviced_display_state power_lock_type_to_pmlock(power_lock_e power_lock_type)
{
switch(power_lock_type) {
case POWER_LOCK_CPU:
- return DEVICED_DISPLAY_STATE_OFF;
+ return SYSCOMMON_DEVICED_DISPLAY_STATE_OFF;
case POWER_LOCK_DISPLAY:
- return DEVICED_DISPLAY_STATE_ON;
+ return SYSCOMMON_DEVICED_DISPLAY_STATE_ON;
case POWER_LOCK_DISPLAY_DIM:
- return DEVICED_DISPLAY_STATE_DIM;
+ return SYSCOMMON_DEVICED_DISPLAY_STATE_DIM;
default:
- return DEVICED_DISPLAY_STATE_END;
+ return SYSCOMMON_DEVICED_DISPLAY_STATE_END;
}
}
-static void broadcast_lock_changed(enum deviced_display_state state)
+static void broadcast_lock_changed(enum syscommon_deviced_display_state state)
{
int nlock = 0;
switch(state) {
- case DEVICED_DISPLAY_STATE_ON:
- case DEVICED_DISPLAY_STATE_DIM:
- case DEVICED_DISPLAY_STATE_OFF:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
break;
default:
return;
g_variant_new("(ii)", state, nlock));
}
-static void broadcast_lock_watchdog_expired(pid_t pid, enum deviced_display_state state, const char* appid, time_t locktime)
+static void broadcast_lock_watchdog_expired(pid_t pid, enum syscommon_deviced_display_state state, const char* appid, time_t locktime)
{
time_t now;
double diff;
pid_t pid = 0;
int detected = 0;
char *app_id = NULL;
- enum deviced_display_state state = (enum deviced_display_state) user_data;
+ enum syscommon_deviced_display_state state = (enum syscommon_deviced_display_state) user_data;
struct display_lock *dl;
if (!var)
dl = (struct display_lock *) data;
- if (dl->state == DEVICED_DISPLAY_STATE_OFF && display_panel_get_dpms_cached_state() == DPMS_ON) {
+ if (dl->state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF && display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON) {
_D("Lcd state is PM_LCD_POWER_ON");
return G_SOURCE_CONTINUE;
}
}
switch (dl->state) {
- case DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
str = "normal";
break;
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
str = "lcddim";
break;
- case DEVICED_DISPLAY_STATE_OFF:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
str = "lcdoff";
break;
default:
if (dl->pid == DEVICED_EVENT_DISPLAY_AMBIENT)
ambient_check_invalid_state(dl->pid);
- if (dl->state == DEVICED_DISPLAY_STATE_OFF)
+ if (dl->state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
set_process_active(false, dl->pid);
set_unlock_time(dl->pid, dl->state);
* Return 0 on success.
* negative on error.
*/
-int display_lock_request_lock(enum deviced_display_state state, pid_t pid, unsigned int timeout)
+int display_lock_request_lock(enum syscommon_deviced_display_state state, pid_t pid, unsigned int timeout)
{
struct display_lock *dl;
- if (state < DEVICED_DISPLAY_STATE_ON || state > DEVICED_DISPLAY_STATE_OFF)
+ if (state < SYSCOMMON_DEVICED_DISPLAY_STATE_ON || state > SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
return -EINVAL;
dl = find_lock(state, pid);
dl->timeout_id = g_timeout_add(timeout, lock_expired_callback, dl);
dl->time = time(NULL);
dl->broadcast_warning = true;
- if (state == DEVICED_DISPLAY_STATE_ON || state == DEVICED_DISPLAY_STATE_DIM)
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON || state == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)
dl->background = is_app_background(pid);
if (pid < DEVICED_EVENT_BASE)
dl->warning_id = g_timeout_add_seconds(LOCK_WATCHDOG_PERIOD_SEC, lock_watchdog_callback, dl);
return 0;
}
-int display_lock_update_lock(enum deviced_display_state state, pid_t pid, unsigned int timeout)
+int display_lock_update_lock(enum syscommon_deviced_display_state state, pid_t pid, unsigned int timeout)
{
struct display_lock *dl;
- if (state < DEVICED_DISPLAY_STATE_ON || state > DEVICED_DISPLAY_STATE_OFF)
+ if (state < SYSCOMMON_DEVICED_DISPLAY_STATE_ON || state > SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
return -EINVAL;
dl = find_lock(state, pid);
return 0;
}
-void display_lock_release_lock(enum deviced_display_state state, pid_t pid)
+void display_lock_release_lock(enum syscommon_deviced_display_state state, pid_t pid)
{
struct display_lock *dl = find_lock(state, pid);
{
struct display_lock *dl = (struct display_lock *) data;
- if (dl->state == DEVICED_DISPLAY_STATE_OFF)
+ if (dl->state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
set_process_active(false, dl->pid);
remove_lock(dl);
free_lock(dl);
}
-void display_lock_release_lock_all(enum deviced_display_state state)
+void display_lock_release_lock_all(enum syscommon_deviced_display_state state)
{
g_list_foreach(g_display_fglock_list[state], free_lock_all, NULL);
g_display_fglock_list[state] = NULL;
}
-void display_lock_print_lock(enum deviced_display_state state)
+void display_lock_print_lock(enum syscommon_deviced_display_state state)
{
g_list_foreach(g_display_fglock_list[state], print_display_lock, NULL);
g_list_foreach(g_display_bglock_list[state], print_display_lock, NULL);
struct display_lock *dl;
pid_t pid = *(pid_t *) data;
- dl = find_lock(DEVICED_DISPLAY_STATE_ON, pid);
+ dl = find_lock(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, pid);
if (dl)
set_lock_background(dl);
- dl = find_lock(DEVICED_DISPLAY_STATE_DIM, pid);
+ dl = find_lock(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, pid);
if (dl)
set_lock_background(dl);
struct display_lock *dl;
pid_t pid = *(pid_t *) data;
- dl = find_lock(DEVICED_DISPLAY_STATE_ON, pid);
+ dl = find_lock(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, pid);
if (dl)
set_lock_foreground(dl);
- dl = find_lock(DEVICED_DISPLAY_STATE_DIM, pid);
+ dl = find_lock(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, pid);
if (dl)
set_lock_foreground(dl);
{
pid_t pid = *(pid_t *) data;
- display_lock_release_lock(DEVICED_DISPLAY_STATE_ON, pid);
- display_lock_release_lock(DEVICED_DISPLAY_STATE_DIM, pid);
- display_lock_release_lock(DEVICED_DISPLAY_STATE_OFF, pid);
+ display_lock_release_lock(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, pid);
+ display_lock_release_lock(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, pid);
+ display_lock_release_lock(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, pid);
return 0;
}
int display_lock_print_lock_info(int fd)
{
- enum deviced_display_state s;
+ enum syscommon_deviced_display_state s;
int index = 1;
int *param[2] = { &index, &fd };
if (fd < 0)
return -EINVAL;
- for (s = DEVICED_DISPLAY_STATE_ON; s < DEVICED_DISPLAY_STATE_END; ++s) {
+ for (s = SYSCOMMON_DEVICED_DISPLAY_STATE_ON; s < SYSCOMMON_DEVICED_DISPLAY_STATE_END; ++s) {
g_list_foreach(g_display_fglock_list[s], print_lock_info, param);
g_list_foreach(g_display_bglock_list[s], print_lock_info, param);
}
{
char pname[PATH_MAX];
pid_t pid = data->pid;
- enum deviced_display_state state;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state state;
+ enum syscommon_deviced_display_state current;
int ret;
bool value = true;
unsigned int flags;
return;
state = GET_COND_STATE(data->cond);
- if (state == DEVICED_DISPLAY_STATE_START)
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_START)
return;
flags = GET_COND_FLAG(data->cond);
display_misc_get_process_name(pid, pname);
- if ((state == DEVICED_DISPLAY_STATE_OFF) && (current == DEVICED_DISPLAY_STATE_SLEEP) &&
+ if ((state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF) && (current == SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP) &&
(pm_get_power_lock() == POWER_UNLOCK))
display_state_transition_do_proc_change_state(data->cond, DEVICED_EVENT_DISPLAY_LOCK);
return;
}
- if (state == DEVICED_DISPLAY_STATE_OFF)
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
set_process_active(true, pid);
display_plugin_state_get_name(state, &state_name);
if (pid < DEVICED_EVENT_BASE) {
/* for debug */
- if (state == DEVICED_DISPLAY_STATE_OFF)
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
lock_type = PM_LCDOFF_STR;
- else if (state == DEVICED_DISPLAY_STATE_DIM)
+ else if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)
lock_type = PM_LCDDIM_STR;
- else if (state == DEVICED_DISPLAY_STATE_ON)
+ else if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
lock_type = PM_LCDON_STR;
if (lock_type) {
static void proc_condition_unlock(PMMsg *data)
{
pid_t pid = data->pid;
- enum deviced_display_state state;
+ enum syscommon_deviced_display_state state;
char pname[PATH_MAX];
bool value = false;
unsigned int flags;
display_lock_release_lock(state, pid);
- if (state == DEVICED_DISPLAY_STATE_OFF)
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
set_process_active(false, pid);
display_plugin_state_get_name(state, &state_name);
if (pid < DEVICED_EVENT_BASE) {
/* for debug */
- if (state == DEVICED_DISPLAY_STATE_OFF)
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
lock_type = PM_LCDOFF_STR;
- else if (state == DEVICED_DISPLAY_STATE_DIM)
+ else if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)
lock_type = PM_LCDDIM_STR;
- else if (state == DEVICED_DISPLAY_STATE_ON)
+ else if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
lock_type = PM_LCDON_STR;
if (lock_type) {
int timeout = 0;
bool timeout_enable = false;
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
if (IS_COND_REQUEST_LOCK(data->cond))
proc_condition_lock(data);
flags = GET_COND_FLAG(data->cond);
if (flags == 0) {
/* guard time for suspend */
- if (current == DEVICED_DISPLAY_STATE_OFF) {
- display_plugin_state_get_timeout(DEVICED_DISPLAY_STATE_OFF, &timeout);
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF) {
+ display_plugin_state_get_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, &timeout);
display_state_transition_reset_state_transition_timeout(timeout);
}
} else {
#include <device/power.h>
#include "core.h"
-enum deviced_display_state power_lock_type_to_pmlock(power_lock_e power_lock_type);
-void display_lock_print_lock(enum deviced_display_state state);
+enum syscommon_deviced_display_state power_lock_type_to_pmlock(power_lock_e power_lock_type);
+void display_lock_print_lock(enum syscommon_deviced_display_state state);
int display_app_background(void *data);
int display_app_foreground(void *data);
int display_app_terminated(void *data);
-int display_lock_request_lock(enum deviced_display_state state, pid_t pid, unsigned int timeout);
-int display_lock_update_lock(enum deviced_display_state state, pid_t pid, unsigned int timeout);
-void display_lock_release_lock(enum deviced_display_state state, pid_t pid);
-void display_lock_release_lock_all(enum deviced_display_state state);
-int display_lock_is_state_locked(enum deviced_display_state state);
+int display_lock_request_lock(enum syscommon_deviced_display_state state, pid_t pid, unsigned int timeout);
+int display_lock_update_lock(enum syscommon_deviced_display_state state, pid_t pid, unsigned int timeout);
+void display_lock_release_lock(enum syscommon_deviced_display_state state, pid_t pid);
+void display_lock_release_lock_all(enum syscommon_deviced_display_state state);
+int display_lock_is_state_locked(enum syscommon_deviced_display_state state);
int display_lock_print_lock_info(int fd);
int display_lock_proc_condition(PMMsg *data);
set_pm_status_flag(DIMSTAY_FLAG);
}
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
display_backlight_update_by_default_brightness();
return 0;
const char *dim_state_name;
const char *off_state_name;
const char *current_state_name;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
- display_plugin_state_get_timeout(DEVICED_DISPLAY_STATE_ON, &normal_state_timeout);
- display_plugin_state_get_timeout(DEVICED_DISPLAY_STATE_DIM, &dim_state_timeout);
- display_plugin_state_get_timeout(DEVICED_DISPLAY_STATE_OFF, &off_stata_timeout);
+ display_plugin_state_get_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, &normal_state_timeout);
+ display_plugin_state_get_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, &dim_state_timeout);
+ display_plugin_state_get_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, &off_stata_timeout);
if (fd < 0)
return;
if (ret < 0)
_E("Write() failed: %d", errno);
- display_plugin_state_get_name(DEVICED_DISPLAY_STATE_ON, &normal_state_name);
- display_plugin_state_get_name(DEVICED_DISPLAY_STATE_DIM, &dim_state_name);
- display_plugin_state_get_name(DEVICED_DISPLAY_STATE_OFF, &off_state_name);
+ display_plugin_state_get_name(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, &normal_state_name);
+ display_plugin_state_get_name(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, &dim_state_name);
+ display_plugin_state_get_name(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, &off_state_name);
snprintf(buf, sizeof(buf), "Tran. Locked : %s %s %s\n",
- (display_lock_is_state_locked(DEVICED_DISPLAY_STATE_ON)) ? normal_state_name : "-",
- (display_lock_is_state_locked(DEVICED_DISPLAY_STATE_DIM)) ? dim_state_name : "-",
- (display_lock_is_state_locked(DEVICED_DISPLAY_STATE_OFF)) ? off_state_name : "-");
+ (display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_ON)) ? normal_state_name : "-",
+ (display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)) ? dim_state_name : "-",
+ (display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)) ? off_state_name : "-");
ret = write(fd, buf, strlen(buf));
if (ret < 0)
_E("Write() failed: %d", errno);
dpms_set_state(dpms_on);
#ifdef ENABLE_PM_LOG
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
if (display_state_get_current(¤t) < 0)
return 0;
- if (dpms_on == DPMS_ON)
+ if (dpms_on == SYSCOMMON_DEVICED_DPMS_ON)
pm_history_save(PM_LOG_LCD_ON_COMPLETE, current);
- else if (dpms_on == DPMS_OFF || dpms_on == DPMS_FORCE_OFF)
+ else if (dpms_on == SYSCOMMON_DEVICED_DPMS_OFF || dpms_on == SYSCOMMON_DEVICED_DPMS_FORCE_OFF)
pm_history_save(PM_LOG_LCD_OFF_COMPLETE, current);
else
pm_history_save(PM_LOG_LCD_CONTROL_FAIL, dpms_on);
_I("[DPMS XLIB Backlight] LCD on %#x cnt:%d", flags, cnt);
cnt++;
- ret = display_panel_set_dpms_state(DPMS_ON, flags);
+ ret = display_panel_set_dpms_state(SYSCOMMON_DEVICED_DPMS_ON, flags);
#ifdef ENABLE_PM_LOG
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
if (display_state_get_current(¤t) < 0)
return 0;
LCD_PHASED_MIN_BRIGHTNESS, LCD_PHASED_CHANGE_STEP);
if (flags & FORCE_OFF_MODE)
- ret = display_panel_set_dpms_state(DPMS_FORCE_OFF, flags);
+ ret = display_panel_set_dpms_state(SYSCOMMON_DEVICED_DPMS_FORCE_OFF, flags);
else
- ret = display_panel_set_dpms_state(DPMS_OFF, flags);
+ ret = display_panel_set_dpms_state(SYSCOMMON_DEVICED_DPMS_OFF, flags);
#ifdef ENABLE_PM_LOG
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
if (display_state_get_current(¤t) < 0)
return ret;
{
int ret = -1;
- if ((dpms_get_cached_state() == DPMS_ON) || standby_on) {
+ if ((dpms_get_cached_state() == SYSCOMMON_DEVICED_DPMS_ON) || standby_on) {
_I("LCD standby");
- ret = display_panel_set_dpms_state(DPMS_STANDBY, 0);
+ ret = display_panel_set_dpms_state(SYSCOMMON_DEVICED_DPMS_STANDBY, 0);
}
return ret;
display_backlight_update_by_default_brightness();
if (state == LCD_NORMAL)
- set_setting_pmstate(DEVICED_DISPLAY_STATE_ON);
+ set_setting_pmstate(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
else if (state == LCD_DIM)
- set_setting_pmstate(DEVICED_DISPLAY_STATE_DIM);
+ set_setting_pmstate(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
display_start_dependent_device(flags);
display_misc_set_touch_event_blocked(true);
- set_setting_pmstate(DEVICED_DISPLAY_STATE_OFF);
+ set_setting_pmstate(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
touchled_control_backlight(TOUCHLED_DIRECT_OFF);
DEVICED_POWER_ATTR_SET_UINT64_4_CURRENT_STATE,
DEVICED_POWER_STATE_SLEEP, DEVICED_POWER_STATE_NORMAL, reason, 0);
- set_pm_cur_state(DEVICED_DISPLAY_STATE_ON);
+ set_pm_cur_state(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
_D("lcd is on directly");
display_panel_update_lcd_on_timeval();
/* FIXME: timer_refresh_cb seems legacy code, it can be removed after discussion */
static gboolean timer_refresh_cb(gpointer data)
{
- display_state_set_current(DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT);
+ display_state_set_current(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT);
return 0;
}
if (timeout <= 0)
return -EINVAL;
- if (display_panel_get_dpms_cached_state() != DPMS_ON)
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_on_direct(LCD_ON_BY_GESTURE);
_I("Custom lcd on timeout(%d ms).", timeout);
if (set_custom_lcdon_timeout(timeout))
display_state_transition_update_display_state_timeout_by_priority();
- display_state_set_current(DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT);
+ display_state_set_current(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT);
g_idle_add(timer_refresh_cb, NULL);
return 0;
/* check holdkey block flag in lock node */
- if (display_lock_is_state_locked(DEVICED_DISPLAY_STATE_ON) || display_lock_is_state_locked(DEVICED_DISPLAY_STATE_DIM)) {
+ if (display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_ON) || display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)) {
/*
* When another proccess is normal lock, device is received call then,
* call app can be changed to lcd state by proximity.
*/
if (flag & LCD_OFF_BY_PROXIMITY) {
_I("custom lcd off by proximity, delete normal lock");
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
} else {
_I("skip custom lcd off");
return -ECANCELED;
}
_I("custom lcd off by flag(%d)", flag);
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_off_procedure(flag);
if (set_custom_lcdon_timeout(0) == true)
display_state_transition_update_display_state_timeout_by_priority();
- display_state_set_current(DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT);
+ display_state_set_current(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT);
return 0;
}
return -EINVAL;
}
- if (display_panel_get_dpms_cached_state() != DPMS_ON)
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_on_direct(flag);
_I("platform lcd on by %s (%d ms)", reason, timeout);
if (set_custom_lcdon_timeout(timeout) == true)
display_state_transition_update_display_state_timeout_by_priority();
- display_state_set_current(DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT);
+ display_state_set_current(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, DEVICED_EVENT_INPUT);
return 0;
}
str_len = strlen(reason);
if (!strncmp(reason, GESTURE_STR, str_len)) {
- if (display_lock_is_state_locked(DEVICED_DISPLAY_STATE_ON) || display_lock_is_state_locked(DEVICED_DISPLAY_STATE_DIM)) {
+ if (display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_ON) || display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)) {
_I("skip platform lcd off by gesture");
return -ECANCELED;
}
flag = LCD_OFF_BY_GESTURE;
} else if (!strncmp(reason, PALM_STR, str_len)) {
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
flag = LCD_OFF_BY_PALM;
} else {
}
_I("platform lcd off by %s", reason);
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_off_procedure(flag);
- display_state_set_current(DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT);
+ display_state_set_current(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, DEVICED_EVENT_INPUT);
return 0;
}
* Please consider this condition statement when the ambient feature comes into the display core.
*/
//if (val == DISPLAY_ON && ambient_get_state())
- // return DPMS_OFF;
+ // return SYSCOMMON_DEVICED_DPMS_OFF;
switch (val) {
case DISPLAY_ON:
- return DPMS_ON;
+ return SYSCOMMON_DEVICED_DPMS_ON;
case DISPLAY_STANDBY:
- return DPMS_STANDBY;
+ return SYSCOMMON_DEVICED_DPMS_STANDBY;
case DISPLAY_SUSPEND:
- return DPMS_SUSPEND;
+ return SYSCOMMON_DEVICED_DPMS_SUSPEND;
case DISPLAY_OFF:
- return DPMS_OFF;
+ return SYSCOMMON_DEVICED_DPMS_OFF;
case DISPLAY_DETACH:
- return DPMS_DETACH;
+ return SYSCOMMON_DEVICED_DPMS_DETACH;
default:
return -EINVAL;
}
}
/* FIXME: Below functions are temorary to separtate display state transition functions */
-int display_plugin_state_do_default_trans(enum deviced_display_state state, int evt)
+int display_plugin_state_do_default_trans(enum syscommon_deviced_display_state state, int evt)
{
if (g_display_plugin.display_states[state] && g_display_plugin.display_states[state]->trans)
return g_display_plugin.display_states[state]->trans(evt);
return -EOPNOTSUPP;
}
-bool display_plugin_state_is_there_default_trans(enum deviced_display_state state)
+bool display_plugin_state_is_there_default_trans(enum syscommon_deviced_display_state state)
{
if (g_display_plugin.display_states[state] && g_display_plugin.display_states[state]->trans)
return true;
return false;
}
-int display_plugin_state_get_name(enum deviced_display_state state, const char **state_name)
+int display_plugin_state_get_name(enum syscommon_deviced_display_state state, const char **state_name)
{
if (!state_name)
return -EINVAL;
return -EOPNOTSUPP;
}
-int display_plugin_state_set_timeout(enum deviced_display_state state, int state_timeout)
+int display_plugin_state_set_timeout(enum syscommon_deviced_display_state state, int state_timeout)
{
if (g_display_plugin.display_states[state]) {
g_display_plugin.display_states[state]->timeout = state_timeout;
return -EOPNOTSUPP;
}
-int display_plugin_state_get_timeout(enum deviced_display_state state, int* state_timeout)
+int display_plugin_state_get_timeout(enum syscommon_deviced_display_state state, int* state_timeout)
{
if (!state_timeout)
return -EINVAL;
return -EOPNOTSUPP;
}
-int display_plugin_state_get_state_by_state_index(int state_index, enum deviced_display_state *state)
+int display_plugin_state_get_state_by_state_index(int state_index, enum syscommon_deviced_display_state *state)
{
if (!state)
return -EINVAL;
void (*reset_autobrightness_min) (GDBusConnection *conn, const gchar *sender,
const gchar *unique_name, gpointer data);
- struct deviced_display_config *config;
+ struct syscommon_deviced_display_config *config;
struct display_backlight_ops *backlight;
- struct state* display_states[DEVICED_DISPLAY_STATE_END];
+ struct state* display_states[SYSCOMMON_DEVICED_DISPLAY_STATE_END];
};
extern struct display_plugin g_display_plugin;
int display_plugin_backlight_transit_brightness(int start, int end, int step);
/* FIXME: function names will be redefined */
-int display_plugin_state_do_default_trans(enum deviced_display_state state, int evt);
-bool display_plugin_state_is_there_default_trans(enum deviced_display_state state);
-int display_plugin_state_get_name(enum deviced_display_state state, const char **state_name);
-int display_plugin_state_set_timeout(enum deviced_display_state state, int state_timeout);
-int display_plugin_state_get_timeout(enum deviced_display_state state, int *state_timeout);
-int display_plugin_state_get_state_by_state_index(int state_index, enum deviced_display_state *state);
+int display_plugin_state_do_default_trans(enum syscommon_deviced_display_state state, int evt);
+bool display_plugin_state_is_there_default_trans(enum syscommon_deviced_display_state state);
+int display_plugin_state_get_name(enum syscommon_deviced_display_state state, const char **state_name);
+int display_plugin_state_set_timeout(enum syscommon_deviced_display_state state, int state_timeout);
+int display_plugin_state_get_timeout(enum syscommon_deviced_display_state state, int *state_timeout);
+int display_plugin_state_get_state_by_state_index(int state_index, enum syscommon_deviced_display_state *state);
/* FIXME: This function used in the display lock related functions */
bool display_plugin_state_is_there_proc_change_state(void);
int display_plugin_state_proc_change_state(unsigned int cond, pid_t pid);
#define ALWAYS_ON_TIMEOUT 360000000
/* display state */
-static enum deviced_display_state current = DEVICED_DISPLAY_STATE_START;
-static enum deviced_display_state previous = DEVICED_DISPLAY_STATE_START;
+static enum syscommon_deviced_display_state current = SYSCOMMON_DEVICED_DISPLAY_STATE_START;
+static enum syscommon_deviced_display_state previous = SYSCOMMON_DEVICED_DISPLAY_STATE_START;
static guint state_transition_timer_id;
static guint state_timer;
static unsigned int custom_dim_timeout = 0;
static int lock_screen_timeout = LOCK_SCREEN_INPUT_TIMEOUT;
-static int trans_table[DEVICED_DISPLAY_STATE_END][EVENT_END] = {
+static int trans_table[SYSCOMMON_DEVICED_DISPLAY_STATE_END][EVENT_END] = {
/* Timeout, Input */
- { DEVICED_DISPLAY_STATE_START, DEVICED_DISPLAY_STATE_START }, /* S_START */
- { DEVICED_DISPLAY_STATE_DIM, DEVICED_DISPLAY_STATE_ON }, /* DEVICED_DISPLAY_STATE_ON */
- { DEVICED_DISPLAY_STATE_OFF, DEVICED_DISPLAY_STATE_ON }, /* DEVICED_DISPLAY_STATE_DIM */
- { DEVICED_DISPLAY_STATE_SLEEP, DEVICED_DISPLAY_STATE_ON }, /* DEVICED_DISPLAY_STATE_OFF */
- { DEVICED_DISPLAY_STATE_OFF, DEVICED_DISPLAY_STATE_ON }, /* DEVICED_DISPLAY_STATE_SLEEP */
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_START, SYSCOMMON_DEVICED_DISPLAY_STATE_START }, /* S_START */
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, SYSCOMMON_DEVICED_DISPLAY_STATE_ON }, /* SYSCOMMON_DEVICED_DISPLAY_STATE_ON */
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, SYSCOMMON_DEVICED_DISPLAY_STATE_ON }, /* SYSCOMMON_DEVICED_DISPLAY_STATE_DIM */
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP, SYSCOMMON_DEVICED_DISPLAY_STATE_ON }, /* SYSCOMMON_DEVICED_DISPLAY_STATE_OFF */
+ { SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, SYSCOMMON_DEVICED_DISPLAY_STATE_ON }, /* SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP */
};
static int display_state_transition_do_state_action(int timeout);
-static bool is_display_state_valid(enum deviced_display_state display_state)
+static bool is_display_state_valid(enum syscommon_deviced_display_state display_state)
{
- return (display_state >= DEVICED_DISPLAY_STATE_START && display_state < DEVICED_DISPLAY_STATE_END);
+ return (display_state >= SYSCOMMON_DEVICED_DISPLAY_STATE_START && display_state < SYSCOMMON_DEVICED_DISPLAY_STATE_END);
}
/**
/**
* Default policy for display state timeout.
*/
-static int get_default_timeout(enum deviced_display_state state, int *timeout)
+static int get_default_timeout(enum syscommon_deviced_display_state state, int *timeout)
{
double display_on_ratio = 1.0;
double display_dim_ratio = 0.0;
assert(timeout);
- /* Fixed timeout for state DEVICED_DISPLAY_STATE_OFF, 300ms */
- if (state == DEVICED_DISPLAY_STATE_OFF) {
+ /* Fixed timeout for state SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, 300ms */
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF) {
*timeout = 300;
return 0;
}
screen_timeout = LOCK_SCREEN_INPUT_TIMEOUT;
/* If dimming enabled, devide screen timeout into
- * DEVICED_DISPLAY_STATE_ON and DEVICED_DISPLAY_STATE_DIM by 7:3. */
+ * SYSCOMMON_DEVICED_DISPLAY_STATE_ON and SYSCOMMON_DEVICED_DISPLAY_STATE_DIM by 7:3. */
ret = display_plugin_config_get_dimming(&dimming);
if (ret == 0 && dimming) {
display_on_ratio = 0.7;
display_dim_ratio = 0.3;
}
- if (state == DEVICED_DISPLAY_STATE_ON)
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
screen_timeout *= display_on_ratio;
- else if (state == DEVICED_DISPLAY_STATE_DIM)
+ else if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)
screen_timeout *= display_dim_ratio;
else
return -EINVAL;
static gboolean timeout_default_cb(void *data)
{
- enum deviced_display_state state = GPOINTER_TO_INT(data);
- enum deviced_display_state next;
+ enum syscommon_deviced_display_state state = GPOINTER_TO_INT(data);
+ enum syscommon_deviced_display_state next;
assert(state == current);
switch (state) {
- case DEVICED_DISPLAY_STATE_ON:
- next = DEVICED_DISPLAY_STATE_DIM;
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
+ next = SYSCOMMON_DEVICED_DISPLAY_STATE_DIM;
break;
- case DEVICED_DISPLAY_STATE_DIM:
- next = DEVICED_DISPLAY_STATE_OFF;
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
+ next = SYSCOMMON_DEVICED_DISPLAY_STATE_OFF;
break;
- case DEVICED_DISPLAY_STATE_OFF:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
/**
* TODO: Add power suspend at this point.
*
* next: set the current to the next
* event: reason for the transition
*/
-static int set_current(enum deviced_display_state next, enum deviced_event event)
+static int set_current(enum syscommon_deviced_display_state next, enum deviced_event event)
{
if (!is_display_state_valid(next))
return -EINVAL;
return 0;
}
-int display_state_set_current(enum deviced_display_state state, enum deviced_event event)
+int display_state_set_current(enum syscommon_deviced_display_state state, enum deviced_event event)
{
int ret;
return set_current_timeout(-1, NULL);
}
-int display_state_set_current_full(enum deviced_display_state state,
+int display_state_set_current_full(enum syscommon_deviced_display_state state,
enum deviced_event event, int timeout, GSourceFunc timeout_cb)
{
int ret;
return set_current_timeout(timeout, timeout_cb);
}
-int display_state_get_current(enum deviced_display_state *state)
+int display_state_get_current(enum syscommon_deviced_display_state *state)
{
if (!state)
return -EINVAL;
return 0;
}
-int display_state_get_previous(enum deviced_display_state *state)
+int display_state_get_previous(enum syscommon_deviced_display_state *state)
{
if (!state)
return -EINVAL;
return (event_type >= EVENT_TIMEOUT && event_type < EVENT_END);
}
-int display_state_transition_get_next_transition_display_state(enum deviced_display_state from_state, enum deviced_display_state *to_state, int evt_type)
+int display_state_transition_get_next_transition_display_state(enum syscommon_deviced_display_state from_state, enum syscommon_deviced_display_state *to_state, int evt_type)
{
if (!to_state || !is_display_state_valid(from_state) || !is_device_event_type_valid(evt_type))
return -EINVAL;
return 0;
}
-int display_state_transition_set_transition_table_display_state(enum deviced_display_state display_state, enum deviced_display_state set_state, int evt_type)
+int display_state_transition_set_transition_table_display_state(enum syscommon_deviced_display_state display_state, enum syscommon_deviced_display_state set_state, int evt_type)
{
if (!is_display_state_valid(display_state) || !is_device_event_type_valid(evt_type) || !is_display_state_valid(set_state))
return -EINVAL;
if (!display_plugin_config_get_timeout_enable(&timeout_enable) && (!timeout_enable))
return -EPERM;
- if ((current == DEVICED_DISPLAY_STATE_OFF)
+ if ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
&& (syscommon_is_emulator() == true || timeout_sleep_support == false))
return -EPERM;
return 0;
}
-int display_state_transition_set_custom_timeout(enum deviced_display_state state, unsigned int timeout)
+int display_state_transition_set_custom_timeout(enum syscommon_deviced_display_state state, unsigned int timeout)
{
const char *state_name = NULL;
switch (state) {
- case DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
custom_normal_timeout = timeout;
break;
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
custom_dim_timeout = timeout;
break;
default:
return 0;
}
-int display_state_transition_get_custom_timeout(enum deviced_display_state state, unsigned int *timeout)
+int display_state_transition_get_custom_timeout(enum syscommon_deviced_display_state state, unsigned int *timeout)
{
if (!timeout)
return -EINVAL;
const char *state_name = NULL;
switch (state) {
- case DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
*timeout = custom_normal_timeout;
break;
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
*timeout = custom_dim_timeout;
break;
default:
/* first priority : custom timeout */
if (custom_normal_timeout > 0) {
- display_plugin_state_set_timeout(DEVICED_DISPLAY_STATE_ON, custom_normal_timeout);
- display_plugin_state_set_timeout(DEVICED_DISPLAY_STATE_DIM, custom_dim_timeout);
+ display_plugin_state_set_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, custom_normal_timeout);
+ display_plugin_state_set_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, custom_dim_timeout);
_I("CUSTOM : timeout is set by normal(%u ms), dim(%u ms)",
custom_normal_timeout, custom_dim_timeout);
return;
if ((__get_lock_screen_state() == VCONFKEY_IDLE_LOCK) &&
!get_lock_screen_bg_state()) {
/* timeout is different according to key or event. */
- display_plugin_state_set_timeout(DEVICED_DISPLAY_STATE_ON, lock_screen_timeout);
+ display_plugin_state_set_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, lock_screen_timeout);
_I("LOCK: Timeout(%d ms) is set by normal.",
lock_screen_timeout);
return;
_I("LCD always on.");
}
- display_plugin_state_set_timeout(DEVICED_DISPLAY_STATE_ON, run_timeout);
+ display_plugin_state_set_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, run_timeout);
get_dim_timeout(&val);
- display_plugin_state_set_timeout(DEVICED_DISPLAY_STATE_DIM, val);
+ display_plugin_state_set_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, val);
- display_plugin_state_get_timeout(DEVICED_DISPLAY_STATE_ON, &normal_state_timeout);
- display_plugin_state_get_timeout(DEVICED_DISPLAY_STATE_DIM, &dim_state_timeout);
+ display_plugin_state_get_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, &normal_state_timeout);
+ display_plugin_state_get_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM, &dim_state_timeout);
_I("Normal: NORMAL timeout is set by %d ms", normal_state_timeout);
_I("Normal: DIM timeout is set by %d ms", dim_state_timeout);
}
-bool display_state_transition_is_display_state_support_transition(enum deviced_display_state state)
+bool display_state_transition_is_display_state_support_transition(enum syscommon_deviced_display_state state)
{
switch(state) {
- case DEVICED_DISPLAY_STATE_ON:
- case DEVICED_DISPLAY_STATE_DIM:
- case DEVICED_DISPLAY_STATE_OFF:
- case DEVICED_DISPLAY_STATE_SLEEP:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP:
return true;
default:
return false;
return false;
}
-int display_state_transition_check_state_transition_condition(enum deviced_display_state cur_state, enum deviced_display_state next_state)
+int display_state_transition_check_state_transition_condition(enum syscommon_deviced_display_state cur_state, enum syscommon_deviced_display_state next_state)
{
if (!display_state_transition_is_display_state_support_transition(cur_state))
return -EPERM;
- if (next_state == DEVICED_DISPLAY_STATE_ON) /* DEVICED_DISPLAY_STATE_ON is exceptional */
+ if (next_state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) /* SYSCOMMON_DEVICED_DISPLAY_STATE_ON is exceptional */
return 0;
if (display_lock_is_state_locked(cur_state)) {
int hdmi_state;
int dimming;
- if (previous != DEVICED_DISPLAY_STATE_ON)
+ if (previous != SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
return false;
- if (current != DEVICED_DISPLAY_STATE_DIM)
+ if (current != SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)
return false;
display_plugin_config_get_dimming(&dimming);
* 2. transition
* 3. call enter action function
*/
-int display_state_transition_do_state_transition(enum deviced_display_state state, int evt_type)
+int display_state_transition_do_state_transition(enum syscommon_deviced_display_state state, int evt_type)
{
const char* current_state_name = NULL;
const char* next_state_name = NULL;
- enum deviced_display_state next_state;
+ enum syscommon_deviced_display_state next_state;
int ret = 0;
int timeout = 0;
/* enter action */
if (display_state_transition_is_display_state_support_transition(current)) {
- if (current == DEVICED_DISPLAY_STATE_OFF)
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
display_state_transition_update_lcdoff_reason(VCONFKEY_PM_LCDOFF_BY_TIMEOUT);
- if ((current == DEVICED_DISPLAY_STATE_ON) || (current == DEVICED_DISPLAY_STATE_OFF))
+ if ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) || (current == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF))
if (set_custom_lcdon_timeout(0) == true)
display_state_transition_update_display_state_timeout_by_priority();
/* enter next state directly */
display_state_transition_do_state_transition(current, EVENT_TIMEOUT);
} else {
- if ((current == DEVICED_DISPLAY_STATE_SLEEP) &&
+ if ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP) &&
(syscommon_is_emulator() == true || timeout_sleep_support == false))
return 0;
return -ECANCELED;
}
- if ((current == DEVICED_DISPLAY_STATE_OFF) || (current == DEVICED_DISPLAY_STATE_SLEEP))
+ if ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF) || (current == SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP))
_I("Input event signal at Display Off");
time(&now);
- if ((last_time != now) || (current == DEVICED_DISPLAY_STATE_OFF) || (current == DEVICED_DISPLAY_STATE_SLEEP)) {
+ if ((last_time != now) || (current == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF) || (current == SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP)) {
display_state_transition_do_state_transition(current, EVENT_INPUT);
last_time = now;
}
return -EINVAL;
}
- if (current != DEVICED_DISPLAY_STATE_SLEEP) {
- if ((current == DEVICED_DISPLAY_STATE_ON)) {
+ if (current != SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP) {
+ if ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)) {
if (display_panel_calculate_diff_time_between_lcd_on_direct_and_state_action(&diff_time) == 0) {
timeout -= diff_time;
}
/* set timer with current state timeout */
display_state_transition_reset_state_transition_timeout(timeout);
- if (current == DEVICED_DISPLAY_STATE_ON) {
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) {
time(&last_update_time);
last_timeout = timeout;
} else {
}
}
- if ((current != previous) && (current != DEVICED_DISPLAY_STATE_SLEEP)) {
+ if ((current != previous) && (current != SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP)) {
int wakeup_reason = 0;
syscommon_resman_get_resource_attr_int(SYSCOMMON_RESOURCE_ID(DEVICED_RESOURCE_TYPE_POWER),
syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LCD, (void *)&pm_cur_state);
}
- if ((previous == DEVICED_DISPLAY_STATE_ON) && (current != DEVICED_DISPLAY_STATE_ON)) {
+ if ((previous == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) && (current != SYSCOMMON_DEVICED_DISPLAY_STATE_ON)) {
time(&now);
diff = difftime(now, last_update_time);
display_plugin_state_get_name(current, &state_name);
- _I("DEVICED_DISPLAY_STATE_ON is changed to %s (timeout=%d ms diff=%.0f s).",
+ _I("SYSCOMMON_DEVICED_DISPLAY_STATE_ON is changed to %s (timeout=%d ms diff=%.0f s).",
state_name, last_timeout, diff);
}
switch (current) {
- case DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
/*
* normal state : backlight on and restore
* the previous brightness
*/
- if (previous == DEVICED_DISPLAY_STATE_DIM)
+ if (previous == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)
display_backlight_update_by_default_brightness();
- if (display_panel_get_dpms_cached_state() != DPMS_ON)
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_on_procedure(LCD_NORMAL, NORMAL_MODE);
break;
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
display_backlight_get_custom_status(&custom_status);
- if ((previous == DEVICED_DISPLAY_STATE_ON) && custom_status) {
+ if ((previous == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) && custom_status) {
display_backlight_get_brightness(&brightness);
display_backlight_set_custom_brightness(brightness);
}
/* lcd dim state : dim the brightness */
display_backlight_set_brightness_by_dim_brightness();
- if ((previous == DEVICED_DISPLAY_STATE_OFF) || (previous == DEVICED_DISPLAY_STATE_SLEEP))
+ if ((previous == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF) || (previous == SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP))
display_panel_lcd_on_procedure(LCD_DIM, NORMAL_MODE);
break;
- case DEVICED_DISPLAY_STATE_OFF:
- if ((previous != DEVICED_DISPLAY_STATE_SLEEP) && (previous != DEVICED_DISPLAY_STATE_OFF)) {
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
+ if ((previous != SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP) && (previous != SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)) {
/* lcd off state : turn off the backlight */
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
}
display_panel_get_lcd_paneloff_mode(&lcd_paneloff_mode);
- if (display_panel_get_dpms_cached_state() == DPMS_ON
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON
|| lcd_paneloff_mode)
display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
break;
- case DEVICED_DISPLAY_STATE_SLEEP:
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP:
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_off_procedure(LCD_OFF_BY_TIMEOUT);
if (!pm_get_power_lock_support()) {
}
}
goto go_suspend;
- default: /* DEVICED_DISPLAY_STATE_START */
+ default: /* SYSCOMMON_DEVICED_DISPLAY_STATE_START */
return 0;
}
}
/* FIXME: this function is temporary, it will be refactored */
-void display_state_transition_do_proc_change_state_action(enum deviced_display_state next, int timeout)
+void display_state_transition_do_proc_change_state_action(enum syscommon_deviced_display_state next, int timeout)
{
int state_timeout = 0;
*/
int display_state_transition_do_proc_change_state(unsigned int cond, pid_t pid)
{
- enum deviced_display_state next;
+ enum syscommon_deviced_display_state next;
const char *state_name = NULL;
if (display_plugin_state_is_there_proc_change_state())
_I("Change process(%d) state to %s.", pid, state_name);
switch (next) {
- case DEVICED_DISPLAY_STATE_ON:
- if (display_panel_get_dpms_cached_state() != DPMS_ON)
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_on_direct(LCD_ON_BY_EVENT);
display_state_transition_update_lock_screen_timeout(LOCK_SCREEN_CONTROL_TIMEOUT);
display_state_transition_do_proc_change_state_action(next, TIMEOUT_NONE);
break;
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
display_state_transition_do_proc_change_state_action(next, TIMEOUT_NONE);
break;
- case DEVICED_DISPLAY_STATE_OFF:
- if (display_panel_get_dpms_cached_state() == DPMS_ON)
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
+ if (display_panel_get_dpms_cached_state() == SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
if (set_custom_lcdon_timeout(0))
display_state_transition_update_display_state_timeout_by_priority();
display_state_transition_do_proc_change_state_action(next, TIMEOUT_NONE);
break;
- case DEVICED_DISPLAY_STATE_SLEEP:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP:
_I("Dangerous requests.");
/* at first LCD_OFF and then goto sleep */
/* state transition */
- display_state_transition_do_proc_change_state_action(DEVICED_DISPLAY_STATE_OFF, TIMEOUT_NONE);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_ON);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_DIM);
- display_lock_release_lock_all(DEVICED_DISPLAY_STATE_OFF);
+ display_state_transition_do_proc_change_state_action(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF, TIMEOUT_NONE);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_DIM);
+ display_lock_release_lock_all(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
if (display_panel_is_lcd_on_state_broadcasted()) {
_I("broadcast lcd off signal at non-lcd device");
broadcast_lcd_off(SIGNAL_PRE, 0);
broadcast_lcd_off(SIGNAL_POST, 0);
}
- display_state_transition_do_proc_change_state_action(DEVICED_DISPLAY_STATE_SLEEP, TIMEOUT_NONE);
+ display_state_transition_do_proc_change_state_action(SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP, TIMEOUT_NONE);
break;
default:
#define LOCK_SCREEN_INPUT_TIMEOUT 10000
-int display_state_set_current(enum deviced_display_state state, enum deviced_event event);
-int display_state_get_current(enum deviced_display_state *state);
-int display_state_get_previous(enum deviced_display_state *state);
+int display_state_set_current(enum syscommon_deviced_display_state state, enum deviced_event event);
+int display_state_get_current(enum syscommon_deviced_display_state *state);
+int display_state_get_previous(enum syscommon_deviced_display_state *state);
-int display_state_transition_get_next_transition_display_state(enum deviced_display_state from_state, enum deviced_display_state *to_state, int evt_type);
-int display_state_transition_set_transition_table_display_state(enum deviced_display_state display_state, enum deviced_display_state set_state, int evt_type);
+int display_state_transition_get_next_transition_display_state(enum syscommon_deviced_display_state from_state, enum syscommon_deviced_display_state *to_state, int evt_type);
+int display_state_transition_set_transition_table_display_state(enum syscommon_deviced_display_state display_state, enum syscommon_deviced_display_state set_state, int evt_type);
bool display_state_transition_is_there_state_transition_timer(void);
int display_state_transition_reset_state_transition_timeout(int timeout);
-int display_state_transition_set_custom_timeout(enum deviced_display_state state, unsigned int timeout);
-int display_state_transition_get_custom_timeout(enum deviced_display_state state, unsigned int *timeout);
+int display_state_transition_set_custom_timeout(enum syscommon_deviced_display_state state, unsigned int timeout);
+int display_state_transition_get_custom_timeout(enum syscommon_deviced_display_state state, unsigned int *timeout);
int display_state_transition_set_lock_screen_timeout(int timeout);
int display_state_transition_get_lock_screen_timeout(int *timeout);
void display_state_transition_update_lock_screen_timeout(int timeout);
void display_state_transition_update_display_state_timeout_by_priority(void);
-int display_state_transition_check_state_transition_condition(enum deviced_display_state cur_state, enum deviced_display_state next_state);
+int display_state_transition_check_state_transition_condition(enum syscommon_deviced_display_state cur_state, enum syscommon_deviced_display_state next_state);
int display_state_transition_update_lcdoff_reason(int source);
bool display_state_transition_is_possible_to_go_lcdoff(void);
-int display_state_transition_do_state_transition(enum deviced_display_state state, int evt_type);
-bool display_state_transition_is_display_state_support_transition(enum deviced_display_state state);
+int display_state_transition_do_state_transition(enum syscommon_deviced_display_state state, int evt_type);
+bool display_state_transition_is_display_state_support_transition(enum syscommon_deviced_display_state state);
int display_state_transition_do_state_transition_by_input_poll_event(void);
int display_state_transition_do_state_transition_by_pm_control_event(PMMsg *data);
-void display_state_transition_do_proc_change_state_action(enum deviced_display_state next, int timeout);
+void display_state_transition_do_proc_change_state_action(enum syscommon_deviced_display_state next, int timeout);
int display_state_transition_do_proc_change_state(unsigned int cond, pid_t pid);
int display_state_transition_request_state_transition_with_option(pid_t pid, int s_bits);
{
switch (s_bits) {
case LCD_NORMAL:
- return DEVICED_DISPLAY_STATE_ON;
+ return SYSCOMMON_DEVICED_DISPLAY_STATE_ON;
case LCD_DIM:
- return DEVICED_DISPLAY_STATE_DIM;
+ return SYSCOMMON_DEVICED_DISPLAY_STATE_DIM;
case LCD_OFF:
case STANDBY:
- return DEVICED_DISPLAY_STATE_OFF;
+ return SYSCOMMON_DEVICED_DISPLAY_STATE_OFF;
case SUSPEND:
- return DEVICED_DISPLAY_STATE_SLEEP;
+ return SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP;
default:
return -EINVAL;
}
static const struct device_ops *display_plugin_device_ops;
static unsigned int pm_status_flag;
-static enum deviced_display_orientation g_display_init_direction;
+static enum syscommon_deviced_display_orientation g_display_init_direction;
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;
pm_status_flag &= ~status_flag;
}
-inline enum deviced_display_orientation get_display_init_direction(void)
+inline enum syscommon_deviced_display_orientation get_display_init_direction(void)
{
return g_display_init_direction;
}
-inline void set_display_init_direction(enum deviced_display_orientation display_init_direction)
+inline void set_display_init_direction(enum syscommon_deviced_display_orientation display_init_direction)
{
g_display_init_direction = display_init_direction;
}
-void lcd_direct_control(enum dpms_state dpms_state, int flags)
+void lcd_direct_control(enum syscommon_deviced_dpms_state dpms_state, int flags)
{
const struct device_ops *ops = NULL;
GList *l = NULL;
switch (dpms_state) {
- case DPMS_ON:
+ case SYSCOMMON_DEVICED_DPMS_ON:
SYS_G_LIST_FOREACH(display_dependent_device_ops, l, ops)
ops->start(flags);
break;
- case DPMS_OFF:
+ case SYSCOMMON_DEVICED_DPMS_OFF:
SYS_G_LIST_FOREACH(display_dependent_device_ops, l, ops)
ops->stop(flags);
break;
int i;
int val = 0;
const char* state_name = NULL;
- enum deviced_display_state state = DEVICED_DISPLAY_STATE_START;
+ enum syscommon_deviced_display_state state = SYSCOMMON_DEVICED_DISPLAY_STATE_START;
- for (i = 0; i < DEVICED_DISPLAY_STATE_END; i++) {
+ for (i = 0; i < SYSCOMMON_DEVICED_DISPLAY_STATE_END; i++) {
display_plugin_state_get_state_by_state_index(i, &state);
switch (state) {
- case DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
get_run_timeout(&val);
break;
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
get_dim_timeout(&val);
break;
- case DEVICED_DISPLAY_STATE_OFF:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
display_plugin_config_get_lcdoff_timeout(&val);
break;
default:
void display_set_power_save_mode_flag(int onoff)
{
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
if (display_plugin_set_power_save_mode_flag(onoff) == 0)
return;
if (ret < 0)
return;
- if (current == DEVICED_DISPLAY_STATE_ON)
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
display_backlight_update_by_default_brightness();
}
static int power_resume_from_echomem_callback(void *data)
{
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
ret = display_state_get_current(¤t);
if (ret < 0)
bool timeout_enable = false;
int lcdoff_timeout = 0;
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
if (!display_panel_init_dpms())
return G_SOURCE_CONTINUE;
return G_SOURCE_REMOVE;
switch (current) {
- case DEVICED_DISPLAY_STATE_ON:
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
display_plugin_config_get_timeout_enable(&timeout_enable);
if (timeout_enable) {
- display_plugin_state_get_timeout(DEVICED_DISPLAY_STATE_ON, &timeout);
+ display_plugin_state_get_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, &timeout);
/* check minimun lcd on time */
if (timeout < SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT))
timeout = SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT);
display_state_transition_reset_state_transition_timeout(timeout);
}
break;
- case DEVICED_DISPLAY_STATE_OFF:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
display_panel_lcd_off_procedure(LCD_OFF_BY_EVENT);
display_plugin_config_get_lcdoff_timeout(&lcdoff_timeout);
display_state_transition_reset_state_transition_timeout(lcdoff_timeout);
set_lock_screen_state(lock_state);
display_state_transition_get_lock_screen_timeout(&lock_screen_timeout);
if (lock_state == VCONFKEY_IDLE_LOCK) {
- display_plugin_state_set_timeout(DEVICED_DISPLAY_STATE_ON, lock_screen_timeout);
+ display_plugin_state_set_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, lock_screen_timeout);
_I("LCD NORMAL timeout(%d ms) is set for lock screen.", lock_screen_timeout);
}
}
int timeout = 0;
int ret = 0;
unsigned int flags = (WITHOUT_STARTNOTI | FLAG_X_DPMS);
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
if (!display_plugin_device_ops || !display_plugin_device_ops->init)
return;
/* In smd test, TSP should be turned off if display panel is not existed. */
if (display_panel_get_dpms_cached_state() == -ENOENT) {
_I("Display panel is not existed.");
- lcd_direct_control(DPMS_OFF, NORMAL_MODE);
+ lcd_direct_control(SYSCOMMON_DEVICED_DPMS_OFF, NORMAL_MODE);
display_unregister_dependent_device();
}
display_plugin_config_get_lcd_always_on(&lcd_always_on);
if (lcd_always_on) {
_I("LCD always on.");
- display_state_transition_set_transition_table_display_state(DEVICED_DISPLAY_STATE_ON, DEVICED_DISPLAY_STATE_ON, EVENT_TIMEOUT);
+ display_state_transition_set_transition_table_display_state(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, SYSCOMMON_DEVICED_DISPLAY_STATE_ON, EVENT_TIMEOUT);
}
if (flags & WITHOUT_STARTNOTI) { /* start without noti */
/* Initial display state right after the booting done */
if (display_is_lcdon_blocked())
- set_pm_cur_state(DEVICED_DISPLAY_STATE_OFF);
+ set_pm_cur_state(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
else
- set_pm_cur_state(DEVICED_DISPLAY_STATE_ON);
+ set_pm_cur_state(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
ret = display_state_get_current(¤t);
if (ret == 0) {
display_set_display_ops_status(DEVICE_OPS_STATUS_START);
if (timeout_enable) {
- display_plugin_state_get_timeout(DEVICED_DISPLAY_STATE_ON, &timeout);
+ display_plugin_state_get_timeout(SYSCOMMON_DEVICED_DISPLAY_STATE_ON, &timeout);
/* check minimun lcd on time */
if (timeout < SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT)) {
timeout = SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT);
display_set_display_ops_status(DEVICE_OPS_STATUS_STOP);
- /* Set current state to DEVICED_DISPLAY_STATE_ON */
- set_pm_cur_state(DEVICED_DISPLAY_STATE_ON);
- set_setting_pmstate(DEVICED_DISPLAY_STATE_ON);
+ /* Set current state to SYSCOMMON_DEVICED_DISPLAY_STATE_ON */
+ set_pm_cur_state(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
+ set_setting_pmstate(SYSCOMMON_DEVICED_DISPLAY_STATE_ON);
/* timeout is not needed */
display_state_transition_reset_state_transition_timeout(TIMEOUT_NONE);
#define __DISPLAY_H__
#include <stdbool.h>
+#include <system/syscommon-plugin-deviced-display-interface.h>
#include "display-panel.h"
#include "shared/devices.h"
#define BATTERY_FLAG 0x00020000
#define COOLDOWN_FLAG 0x00040000
-void lcd_direct_control(enum dpms_state dpms_state, int flags);
+void lcd_direct_control(enum syscommon_deviced_dpms_state dpms_state, int flags);
int get_pm_cur_state(void);
int get_pm_old_state(void);
void set_pm_cur_state(int cur_state);
unsigned int get_pm_status_flag(void);
void set_pm_status_flag(unsigned int status_flag);
void clear_pm_status_flag(unsigned int status_flag);
-enum deviced_display_orientation get_display_init_direction(void);
-void set_display_init_direction(enum deviced_display_orientation display_init_direction);
+enum syscommon_deviced_display_orientation get_display_init_direction(void);
+void set_display_init_direction(enum syscommon_deviced_display_orientation display_init_direction);
bool display_is_hal_backend_available(void);
void display_start_dependent_device(unsigned long flags);
void display_stop_dependent_device(unsigned long flags);
if (!pname)
return -EINVAL;
- if (state < DEVICED_DISPLAY_STATE_ON || state > DEVICED_DISPLAY_STATE_SLEEP)
+ if (state < SYSCOMMON_DEVICED_DISPLAY_STATE_ON || state > SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP)
return -EINVAL;
save_pmlock(state, true, pid);
unsigned long val;
char ht[15];
- if (state < DEVICED_DISPLAY_STATE_ON || state > DEVICED_DISPLAY_STATE_SLEEP)
+ if (state < SYSCOMMON_DEVICED_DISPLAY_STATE_ON || state > SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP)
return -EINVAL;
save_pmlock(state, false, pid);
switch (attr->id) {
case DEVICED_DISPLAY_ATTR_INT_DPMS_STATE:
{
- enum deviced_dpms_state state = *(enum deviced_dpms_state *) data;
+ enum syscommon_deviced_dpms_state state = *(enum syscommon_deviced_dpms_state *) data;
switch (state) {
- case DEVICED_DPMS_ON:
+ case SYSCOMMON_DEVICED_DPMS_ON:
return display_panel_set_panel_state_by_on_state(0);
- case DEVICED_DPMS_STANDBY:
+ case SYSCOMMON_DEVICED_DPMS_STANDBY:
return display_panel_set_panel_state_by_standby_state(1);
- case DEVICED_DPMS_OFF:
+ case SYSCOMMON_DEVICED_DPMS_OFF:
return display_panel_set_panel_state_by_off_state(0);
- case DEVICED_DPMS_FORCE_OFF:
+ case SYSCOMMON_DEVICED_DPMS_FORCE_OFF:
return display_panel_set_panel_state_by_off_state(FORCE_OFF_MODE);
default:
return 0;
switch (attr->id) {
case DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE:
{
- enum deviced_display_state state = *(enum deviced_display_state *) data1;
+ enum syscommon_deviced_display_state state = *(enum syscommon_deviced_display_state *) data1;
enum deviced_event event = *(enum deviced_event *) data2;
/**
}
case DEVICED_DISPLAY_ATTR_TUPLE2_SET_DISPLAY_DIRECT:
{
- enum deviced_dpms_state state = *(enum deviced_dpms_state *) data1;
+ enum syscommon_deviced_dpms_state state = *(enum syscommon_deviced_dpms_state *) data1;
enum deviced_event reason = *(enum deviced_event *) data2;
int flag;
break;
}
- if (state == DEVICED_DPMS_OFF)
+ if (state == SYSCOMMON_DEVICED_DPMS_OFF)
display_panel_lcd_off_procedure(flag);
- else if (state == DEVICED_DPMS_ON)
+ else if (state == SYSCOMMON_DEVICED_DPMS_ON)
display_panel_lcd_on_direct(flag);
return 0;
}
ret = display_backlight_get_max_brightness(&attr_data.i32);
break;
case DEVICED_DISPLAY_ATTR_INT_GET_CURRENT_STATE:
- ret = display_state_get_current((enum deviced_display_state *) &attr_data.i32);
+ ret = display_state_get_current((enum syscommon_deviced_display_state *) &attr_data.i32);
break;
case DEVICED_DISPLAY_ATTR_INT_DPMS_STATE:
attr_data.i32 = display_panel_get_dpms_cached_state();
const char *str;
int state = (intptr_t)data;
- if (state == DEVICED_DISPLAY_STATE_ON)
+ if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
str = EVT_VAL_DISPLAY_NORMAL;
- else if (state == DEVICED_DISPLAY_STATE_DIM)
+ else if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_DIM)
str = EVT_VAL_DISPLAY_DIM;
- else if (state == DEVICED_DISPLAY_STATE_OFF)
+ else if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
str = EVT_VAL_DISPLAY_OFF;
else
return G_SOURCE_REMOVE;
int set_setting_pmstate(int val)
{
- static int prev = DEVICED_DISPLAY_STATE_ON;
+ static int prev = SYSCOMMON_DEVICED_DISPLAY_STATE_ON;
if (prev == val)
return 0;
int display_setting_update_pm_setting(int key_idx, int val)
{
int ret;
- enum deviced_display_state current;
+ enum syscommon_deviced_display_state current;
if (display_plugin_is_there_update_pm_setting())
return display_plugin_update_pm_setting(key_idx, val);
touchled_control_backlight(TOUCHLED_DIRECT_OFF);
/* LCD on if lock screen show before waiting time */
- if ((current == DEVICED_DISPLAY_STATE_ON) &&
+ if ((current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) &&
val == VCONFKEY_IDLE_LOCK &&
- display_panel_get_dpms_cached_state() != DPMS_ON &&
+ display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON &&
display_is_lcdon_blocked() == LCDON_BLOCK_NONE)
display_panel_lcd_on_procedure(LCD_NORMAL, LCD_ON_BY_EVENT);
display_state_transition_update_display_state_timeout_by_priority();
- if (current == DEVICED_DISPLAY_STATE_ON)
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
display_state_transition_do_state_transition(current, EVENT_INPUT);
break;
case SETTING_LOCK_SCREEN_BG:
set_lock_screen_bg_state(val);
display_state_transition_update_display_state_timeout_by_priority();
- if (current == DEVICED_DISPLAY_STATE_ON)
+ if (current == SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
display_state_transition_do_state_transition(current, EVENT_INPUT);
break;
case SETTING_POWER_CUSTOM_BRIGHTNESS:
static bool userlock_saving_support;
-int save_pmlock(enum deviced_display_state state, bool on, pid_t pid)
+int save_pmlock(enum syscommon_deviced_display_state state, bool on, pid_t pid)
{
int ret = 0;
char *node, *state_str;
return -ENOSYS;
switch (state) {
- case DEVICED_DISPLAY_STATE_ON:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_ON:
state_str = DISP_LOCK_STR;
break;
- case DEVICED_DISPLAY_STATE_DIM:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_DIM:
state_str = DIM_LOCK_STR;
break;
- case DEVICED_DISPLAY_STATE_OFF:
+ case SYSCOMMON_DEVICED_DISPLAY_STATE_OFF:
state_str = MAIN_LOCK_STR;
break;
default:
static int display_changed(void *data)
{
- enum deviced_display_state state;
+ enum syscommon_deviced_display_state state;
int cradle;
if (!data)
return 0;
state = *(int *)data;
- if (state != DEVICED_DISPLAY_STATE_ON)
+ if (state != SYSCOMMON_DEVICED_DISPLAY_STATE_ON)
return 0;
cradle = cradle_extcon_ops.status;
return 0;
lcd_state = *(int*)data;
- if (lcd_state == DEVICED_DISPLAY_STATE_ON
+ if (lcd_state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON
&& hardkey_duration == KEYBACKLIGHT_TIME_ALWAYS_ON) {
touchled_set_state(true);
return 0;
_D("Doze mode disabled.");
} else if (doze_mode == DOZE_ENABLED) {
_D("Doze mode enabled.");
- if (display_state == DEVICED_DISPLAY_STATE_OFF || display_state == DEVICED_DISPLAY_STATE_SLEEP)
+ if (display_state == SYSCOMMON_DEVICED_DISPLAY_STATE_OFF || display_state == SYSCOMMON_DEVICED_DISPLAY_STATE_SLEEP)
_enter_doze();
}
lcd_state = *(int *)data;
- if (lcd_state < DEVICED_DISPLAY_STATE_OFF)
+ if (lcd_state < SYSCOMMON_DEVICED_DISPLAY_STATE_OFF)
goto restart;
- lcd_state = display_lock_is_state_locked(DEVICED_DISPLAY_STATE_OFF);
+ lcd_state = display_lock_is_state_locked(SYSCOMMON_DEVICED_DISPLAY_STATE_OFF);
if (lcd_state || !tfdh || tfd == -1)
goto out;
g_display_plugin.config->touch_wakeup = vconf_keynode_get_bool(key);
- if (display_panel_get_dpms_cached_state() != DPMS_ON) {
+ if (display_panel_get_dpms_cached_state() != SYSCOMMON_DEVICED_DPMS_ON) {
if (g_display_plugin.config->touch_wakeup)
touchscreen_start(NORMAL_MODE);
else
state = display_panel_get_dpms_cached_state();
- if (state == DPMS_OFF)
+ if (state == SYSCOMMON_DEVICED_DPMS_OFF)
touchscreen_powersaving(POWERSAVING_ON);
else
touchscreen_powersaving(POWERSAVING_OFF);