From: Youngjae Cho Date: Fri, 18 Aug 2023 10:05:32 +0000 (+0900) Subject: Add prefix 'syscommon' to enum and struct X-Git-Tag: accepted/tizen/unified/20230821.162310~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F46%2F297446%2F1;p=platform%2Fcore%2Fsystem%2Fdeviced.git Add prefix 'syscommon' to enum and struct Change-Id: I36f314cc36944cd7973f54f79a9ddbf52cbf23ca Signed-off-by: Youngjae Cho --- diff --git a/plugins/iot-headed/display/core.c b/plugins/iot-headed/display/core.c index 9d53210..38fc6de 100644 --- a/plugins/iot-headed/display/core.c +++ b/plugins/iot-headed/display/core.c @@ -56,12 +56,12 @@ 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 */ @@ -73,7 +73,7 @@ static struct state states[DEVICED_DISPLAY_STATE_END] = { #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, @@ -89,20 +89,20 @@ static struct deviced_display_config display_conf = { .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]; } @@ -110,7 +110,7 @@ inline struct state* state_st(enum deviced_display_state 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]; } /** @@ -159,11 +159,11 @@ static int display_start(enum device_flags flags) 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; } @@ -189,11 +189,11 @@ static int display_stop(enum device_flags flags) /* 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; } diff --git a/plugins/iot-headed/display/device-interface.c b/plugins/iot-headed/display/device-interface.c index a3e5a73..5648968 100644 --- a/plugins/iot-headed/display/device-interface.c +++ b/plugins/iot-headed/display/device-interface.c @@ -36,7 +36,7 @@ #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) { diff --git a/plugins/iot-headed/display/key-filter.c b/plugins/iot-headed/display/key-filter.c index 5f2aa30..de9c5f0 100644 --- a/plugins/iot-headed/display/key-filter.c +++ b/plugins/iot-headed/display/key-filter.c @@ -91,21 +91,21 @@ static int booting_check = true; 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); @@ -113,7 +113,7 @@ static inline void restore_custom_brightness(void) 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(); } @@ -139,7 +139,7 @@ static void longkey_pressed(void) /* 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)) { @@ -213,7 +213,7 @@ static inline bool switch_on_lcd(enum device_flags flags) 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) { @@ -227,7 +227,7 @@ static inline bool switch_on_lcd(enum device_flags flags) } 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; } @@ -242,13 +242,13 @@ static inline void switch_off_lcd(void) 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) @@ -378,7 +378,7 @@ static int decide_lcdoff(void) 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; /* @@ -414,12 +414,12 @@ static int lcdoff_powerkey(void) 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; @@ -447,7 +447,7 @@ static int process_power_key(struct input_event *pinput) 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; @@ -524,14 +524,14 @@ static int process_screenlock_key(struct input_event *pinput) 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; } @@ -666,7 +666,7 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned int ignore = true; static int code, value; int ret; - enum deviced_display_state current; + enum syscommon_deviced_display_state current; assert(pinput); @@ -706,10 +706,10 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned 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: @@ -744,7 +744,7 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned /* 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) diff --git a/plugins/mobile/battery/battery-notification.c b/plugins/mobile/battery/battery-notification.c index 7698375..358357b 100644 --- a/plugins/mobile/battery/battery-notification.c +++ b/plugins/mobile/battery/battery-notification.c @@ -167,7 +167,7 @@ static int launch_lowbat_noti(int capacity, int option) 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) @@ -209,7 +209,7 @@ static int launch_lowbat_noti(int capacity, int option) 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) diff --git a/plugins/mobile/display/core.c b/plugins/mobile/display/core.c index 6638b9d..b284434 100644 --- a/plugins/mobile/display/core.c +++ b/plugins/mobile/display/core.c @@ -85,12 +85,12 @@ static struct display_backlight_ops *backlight_ops; 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 */ @@ -102,7 +102,7 @@ static struct state states[DEVICED_DISPLAY_STATE_END] = { #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, @@ -118,43 +118,43 @@ static struct deviced_display_config display_conf = { .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 @@ -164,20 +164,20 @@ static int default_proc_change_state(unsigned int cond, pid_t pid) 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: @@ -190,7 +190,7 @@ static int default_proc_change_state(unsigned int cond, pid_t pid) 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]; } /** diff --git a/plugins/mobile/display/device-interface.c b/plugins/mobile/display/device-interface.c index feec858..50f2aac 100644 --- a/plugins/mobile/display/device-interface.c +++ b/plugins/mobile/display/device-interface.c @@ -47,7 +47,7 @@ #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) { diff --git a/plugins/mobile/display/key-filter.c b/plugins/mobile/display/key-filter.c index 61257a8..7adcbbe 100644 --- a/plugins/mobile/display/key-filter.c +++ b/plugins/mobile/display/key-filter.c @@ -108,21 +108,21 @@ static int booting_check = true; 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); @@ -130,7 +130,7 @@ static inline void restore_custom_brightness(void) 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(); } @@ -147,7 +147,7 @@ static void longkey_pressed(void) /* 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)) { @@ -213,7 +213,7 @@ static inline bool switch_on_lcd(enum device_flags flags) 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; } @@ -233,7 +233,7 @@ static inline void switch_off_lcd(void) 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(); @@ -360,7 +360,7 @@ static int decide_lcdoff(void) { /* 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; /* @@ -396,12 +396,12 @@ static int lcdoff_powerkey(void) 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; @@ -416,7 +416,7 @@ static bool key_check_display_on(void) 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; } @@ -430,7 +430,7 @@ static gboolean display_on_cb(void *data) 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); @@ -458,7 +458,7 @@ static int process_power_key(struct input_event *pinput) 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; @@ -502,7 +502,7 @@ static int process_power_key(struct input_event *pinput) 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, @@ -548,14 +548,14 @@ static int process_screenlock_key(struct input_event *pinput) 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; } @@ -694,7 +694,7 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned int ignore = true; static int code, value; int ret; - enum deviced_display_state current; + enum syscommon_deviced_display_state current; assert(pinput); @@ -728,10 +728,10 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned 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: diff --git a/plugins/tv/display/core.c b/plugins/tv/display/core.c index 8dafefa..80f1cbd 100644 --- a/plugins/tv/display/core.c +++ b/plugins/tv/display/core.c @@ -83,12 +83,12 @@ static struct display_backlight_ops *backlight_ops; 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 */ @@ -100,7 +100,7 @@ static struct state states[DEVICED_DISPLAY_STATE_END] = { #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, @@ -116,20 +116,20 @@ static struct deviced_display_config display_conf = { .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]; } @@ -137,7 +137,7 @@ inline struct state* state_st(enum deviced_display_state 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]; } /** diff --git a/plugins/tv/display/device-interface.c b/plugins/tv/display/device-interface.c index 01aeadd..682f9c7 100644 --- a/plugins/tv/display/device-interface.c +++ b/plugins/tv/display/device-interface.c @@ -46,7 +46,7 @@ #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) { diff --git a/plugins/tv/display/key-filter.c b/plugins/tv/display/key-filter.c index ca75646..5543c81 100644 --- a/plugins/tv/display/key-filter.c +++ b/plugins/tv/display/key-filter.c @@ -107,21 +107,21 @@ static int booting_check = true; 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); @@ -129,7 +129,7 @@ static inline void restore_custom_brightness(void) 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(); } @@ -155,7 +155,7 @@ static void longkey_pressed(void) /* 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)) { @@ -223,7 +223,7 @@ static inline bool switch_on_lcd(enum device_flags flags) 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; } @@ -243,7 +243,7 @@ static inline void switch_off_lcd(void) 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(); @@ -370,7 +370,7 @@ static int decide_lcdoff(void) { /* 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; /* @@ -406,12 +406,12 @@ static int lcdoff_powerkey(void) 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; @@ -439,7 +439,7 @@ static int process_power_key(struct input_event *pinput) 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; @@ -516,14 +516,14 @@ static int process_screenlock_key(struct input_event *pinput) 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; } @@ -662,7 +662,7 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned int ignore = true; static int code, value; int ret; - enum deviced_display_state current; + enum syscommon_deviced_display_state current; assert(pinput); @@ -696,10 +696,10 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned 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: diff --git a/plugins/wearable/battery/battery-notification.c b/plugins/wearable/battery/battery-notification.c index 336a305..4eb6cb6 100644 --- a/plugins/wearable/battery/battery-notification.c +++ b/plugins/wearable/battery/battery-notification.c @@ -32,7 +32,7 @@ static struct battery_status *battery; 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; @@ -40,8 +40,8 @@ static void launch_health_popup_by_display_state(int 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; } diff --git a/plugins/wearable/display/auto-brightness-sensorhub.c b/plugins/wearable/display/auto-brightness-sensorhub.c index de05a05..e04837c 100644 --- a/plugins/wearable/display/auto-brightness-sensorhub.c +++ b/plugins/wearable/display/auto-brightness-sensorhub.c @@ -48,7 +48,7 @@ static bool lbm, hbm, hold_brt, lowdim; 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 ; @@ -62,7 +62,7 @@ void set_brightness_level(int level) 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) @@ -235,7 +235,7 @@ int auto_brightness_control(enum brightness_request_e request, int set_brightnes 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); } @@ -245,7 +245,7 @@ int auto_brightness_control(enum brightness_request_e request, int set_brightnes 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) { @@ -271,7 +271,7 @@ int auto_brightness_control(enum brightness_request_e request, int set_brightnes 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) @@ -292,7 +292,7 @@ int auto_brightness_control(enum brightness_request_e request, int set_brightnes } } 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); } diff --git a/plugins/wearable/display/auto-brightness.c b/plugins/wearable/display/auto-brightness.c index b94529e..b0e145a 100644 --- a/plugins/wearable/display/auto-brightness.c +++ b/plugins/wearable/display/auto-brightness.c @@ -230,7 +230,7 @@ out: 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; @@ -380,7 +380,7 @@ static int disconnect_sensor(void) } 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) { @@ -417,8 +417,8 @@ static int set_autobrightness_state(int status) /* 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); @@ -493,7 +493,7 @@ static gboolean update_handler(void *data) 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); @@ -623,7 +623,7 @@ static int lcd_changed_cb(void *data) 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; } diff --git a/plugins/wearable/display/core.c b/plugins/wearable/display/core.c index bc96b51..a48383c 100644 --- a/plugins/wearable/display/core.c +++ b/plugins/wearable/display/core.c @@ -106,12 +106,12 @@ static bool lcdon_broadcast = true; 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 */ @@ -125,7 +125,7 @@ static struct state states[DEVICED_DISPLAY_STATE_END] = { #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, @@ -141,20 +141,20 @@ static struct deviced_display_config display_conf = { .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]; } @@ -205,7 +205,7 @@ static gboolean late_transit_on(void *data) 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; } @@ -240,7 +240,7 @@ static void lcd_on_procedure(int state, enum device_flags flag) _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); } @@ -258,9 +258,9 @@ static void lcd_on_procedure(int state, enum device_flags flag) } 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); @@ -313,7 +313,7 @@ static void lcd_off_procedure(enum device_flags flag) 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); @@ -321,7 +321,7 @@ static void lcd_off_procedure(enum device_flags flag) } 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); @@ -344,7 +344,7 @@ static void set_dim_state(bool on) 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; @@ -371,7 +371,7 @@ static gboolean timer_refresh_cb(gpointer data) /* 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) @@ -408,7 +408,7 @@ int custom_lcdon(int timeout) /* 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 */ @@ -425,7 +425,7 @@ int custom_lcdoff(enum device_flags flag) { 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. @@ -433,7 +433,7 @@ int custom_lcdoff(enum device_flags flag) */ 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; @@ -441,7 +441,7 @@ int custom_lcdoff(enum device_flags flag) } _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) @@ -449,7 +449,7 @@ int custom_lcdoff(enum device_flags 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 */ @@ -490,7 +490,7 @@ int display_on_by_reason(const char *reason, int timeout) /* 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 */ @@ -509,19 +509,19 @@ int display_off_by_reason(const char *reason) 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 { @@ -530,12 +530,12 @@ int display_off_by_reason(const char *reason) } _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 */ @@ -547,42 +547,42 @@ int display_off_by_reason(const char *reason) 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: @@ -602,7 +602,7 @@ static int default_trans(int evt) { 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); @@ -617,7 +617,7 @@ static int default_trans(int 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; } @@ -630,10 +630,10 @@ static int default_trans(int evt) /* 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(); @@ -641,7 +641,7 @@ static int default_trans(int evt) /* 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; @@ -674,14 +674,14 @@ static int default_action(int timeout) 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; } @@ -689,7 +689,7 @@ static int default_action(int timeout) /* 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 { @@ -698,7 +698,7 @@ static int default_action(int timeout) } } - 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()); @@ -706,10 +706,10 @@ static int default_action(int timeout) 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); } @@ -717,46 +717,46 @@ static int default_action(int timeout) 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()) { @@ -866,19 +866,19 @@ static int update_setting(int key_idx, int val) 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: @@ -906,7 +906,7 @@ static void init_lcd_operation(void) 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]; } /** diff --git a/plugins/wearable/display/device-interface.c b/plugins/wearable/display/device-interface.c index 07cac36..c7b872c 100644 --- a/plugins/wearable/display/device-interface.c +++ b/plugins/wearable/display/device-interface.c @@ -59,7 +59,7 @@ static int aod_max_level = -1; 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); @@ -120,7 +120,7 @@ static int backlight_transit_state(int state) display_backlight_get_brightness(&brt); - if (state == DPMS_OFF) { + if (state == SYSCOMMON_DEVICED_DPMS_OFF) { start = brt; /* @@ -212,7 +212,7 @@ int is_lcdon_blocked(void) { 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; diff --git a/plugins/wearable/display/display-handler.c b/plugins/wearable/display/display-handler.c index c929cd6..3469696 100644 --- a/plugins/wearable/display/display-handler.c +++ b/plugins/wearable/display/display-handler.c @@ -60,10 +60,10 @@ static gboolean lcdon_from_aod_cb(gpointer data) 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 */ @@ -104,7 +104,7 @@ static GVariant *dbus_autobrightnesschanged(GDBusConnection *conn, 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); } @@ -142,7 +142,7 @@ static void aod_change_signal(GDBusConnection *conn, 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; @@ -173,12 +173,12 @@ static const dbus_interface_u dbus_interface = { 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); diff --git a/plugins/wearable/display/enhance.c b/plugins/wearable/display/enhance.c index bcbc55b..300db80 100644 --- a/plugins/wearable/display/enhance.c +++ b/plugins/wearable/display/enhance.c @@ -100,7 +100,7 @@ static int enhance_lcd_state_changed(void *data) state = DATA_VALUE_INT(data); - if (state == DEVICED_DISPLAY_STATE_ON) + if (state == SYSCOMMON_DEVICED_DISPLAY_STATE_ON) enhance_update_state(); return 0; diff --git a/plugins/wearable/display/hbm.c b/plugins/wearable/display/hbm.c index c10ce1f..a96076a 100644 --- a/plugins/wearable/display/hbm.c +++ b/plugins/wearable/display/hbm.c @@ -75,7 +75,7 @@ static gboolean hbm_off_cb(void *data) { 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; } @@ -217,19 +217,19 @@ static int display_state_changed(void *data) 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."); @@ -408,7 +408,7 @@ static void hbm_init(void *data) 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) diff --git a/plugins/wearable/display/key-filter.c b/plugins/wearable/display/key-filter.c index b655f29..0ddd5bd 100644 --- a/plugins/wearable/display/key-filter.c +++ b/plugins/wearable/display/key-filter.c @@ -106,7 +106,7 @@ static int booting_check = true; 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) @@ -114,7 +114,7 @@ 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(); } @@ -204,7 +204,7 @@ static inline bool switch_on_lcd(enum device_flags flags) 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; } @@ -224,7 +224,7 @@ static inline void switch_off_lcd(void) 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(); @@ -351,7 +351,7 @@ static int decide_lcdoff(void) { /* 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; /* @@ -388,8 +388,8 @@ static int lcdoff_powerkey(void) 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 { @@ -419,7 +419,7 @@ static int process_power_key(struct input_event *pinput) 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; @@ -496,8 +496,8 @@ static int process_screenlock_key(struct input_event *pinput) 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 */ @@ -630,10 +630,10 @@ static void check_key_filter(struct timeval time, unsigned short type, unsigned 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: diff --git a/plugins/wearable/display/powersaver.c b/plugins/wearable/display/powersaver.c index 07450ab..f21cbe7 100644 --- a/plugins/wearable/display/powersaver.c +++ b/plugins/wearable/display/powersaver.c @@ -58,7 +58,7 @@ static int set_powersaver_mode(int mode) 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; diff --git a/plugins/wearable/display/swim.c b/plugins/wearable/display/swim.c index 06897e2..9bedd31 100644 --- a/plugins/wearable/display/swim.c +++ b/plugins/wearable/display/swim.c @@ -95,15 +95,15 @@ static void swimmode_signal_handler(GDBusConnection *conn, _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); } } diff --git a/src/battery-monitor/battery-monitor.c b/src/battery-monitor/battery-monitor.c index 9e3aca6..f935eb5 100644 --- a/src/battery-monitor/battery-monitor.c +++ b/src/battery-monitor/battery-monitor.c @@ -45,7 +45,7 @@ typedef enum { 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 @@ -212,7 +212,7 @@ static void update_appid(void) 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; @@ -229,9 +229,9 @@ int update_bds_record(enum deviced_display_state cur_lcd_state) } /* 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(); @@ -256,7 +256,7 @@ int update_bds_record(enum deviced_display_state cur_lcd_state) 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; @@ -407,13 +407,13 @@ static GVariant *dbus_get_bm_data(GDBusConnection *conn, 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(); } diff --git a/src/battery-monitor/battery-monitor.h b/src/battery-monitor/battery-monitor.h index de3ec38..88b72b7 100644 --- a/src/battery-monitor/battery-monitor.h +++ b/src/battery-monitor/battery-monitor.h @@ -23,11 +23,11 @@ #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 diff --git a/src/battery/power-supply.c b/src/battery/power-supply.c index e3303b2..8c87bf5 100644 --- a/src/battery/power-supply.c +++ b/src/battery/power-supply.c @@ -101,7 +101,7 @@ static bool launching_health_popup; 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; @@ -1367,7 +1367,7 @@ bool battery_do_not_disturb(void) 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()); diff --git a/src/display/ambient-mode.c b/src/display/ambient-mode.c index 6722048..898152a 100644 --- a/src/display/ambient-mode.c +++ b/src/display/ambient-mode.c @@ -91,7 +91,7 @@ static void ambient_set_condition(keynode_t *key_nodes, void *data) 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); } @@ -141,7 +141,7 @@ void ambient_check_invalid_state(pid_t pid) 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; } @@ -157,7 +157,7 @@ void ambient_check_invalid_state(pid_t pid) */ 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); } @@ -165,14 +165,14 @@ void ambient_check_invalid_state(pid_t pid) 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; @@ -183,14 +183,14 @@ static void ambient_start_clock(void) 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; @@ -263,7 +263,7 @@ static void ambient_lcdoff_signal_handler(GDBusConnection *conn, _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); diff --git a/src/display/core.h b/src/display/core.h index f00ef9a..7122cf6 100644 --- a/src/display/core.h +++ b/src/display/core.h @@ -55,7 +55,7 @@ * @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 */ @@ -64,13 +64,13 @@ struct state { 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; @@ -79,7 +79,7 @@ typedef struct { 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); @@ -88,7 +88,7 @@ void set_lock_screen_state(int state); 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); @@ -99,7 +99,7 @@ void set_brightness_changed_state(void); 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); /** * @} diff --git a/src/display/display-backlight.c b/src/display/display-backlight.c index 7e29b59..d35f2a2 100644 --- a/src/display/display-backlight.c +++ b/src/display/display-backlight.c @@ -240,7 +240,7 @@ void display_backlight_change_brightness(int start, int end, int step) /* 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; @@ -257,7 +257,7 @@ int display_backlight_change_brightness_by_dpms_state(enum dpms_state state) 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; @@ -313,7 +313,7 @@ int display_backlight_set_brightness_by_dim_brightness(void) 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; diff --git a/src/display/display-backlight.h b/src/display/display-backlight.h index 94320fd..8f2153a 100644 --- a/src/display/display-backlight.h +++ b/src/display/display-backlight.h @@ -19,6 +19,7 @@ #ifndef __DISPLAY_BACKLIGHT_H__ #define __DISPLAY_BACKLIGHT_H__ +#include #include "display-panel.h" struct display_backlight_ops { @@ -34,7 +35,7 @@ int display_backlight_get_normalized_brightness(int raw_brightness, 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); diff --git a/src/display/display-config.c b/src/display/display-config.c index 874cd4d..6c96d05 100644 --- a/src/display/display-config.c +++ b/src/display/display-config.c @@ -28,7 +28,7 @@ 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); @@ -93,16 +93,16 @@ static int display_config_parse(struct parse_result *result, void *user_data) 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); } diff --git a/src/display/display-config.h b/src/display/display-config.h index 27d65b3..5696623 100644 --- a/src/display/display-config.h +++ b/src/display/display-config.h @@ -23,6 +23,6 @@ #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__ diff --git a/src/display/display-dbus.c b/src/display/display-dbus.c index 06ec586..ac2779b 100644 --- a/src/display/display-dbus.c +++ b/src/display/display-dbus.c @@ -422,7 +422,7 @@ static GVariant *dbus_getbrightness(GDBusConnection *conn, 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) { @@ -430,13 +430,13 @@ static GVariant *dbus_getbrightness(GDBusConnection *conn, 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()); @@ -505,12 +505,12 @@ static GVariant *dbus_setbrightness(GDBusConnection *conn, _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; @@ -745,19 +745,19 @@ static int set_lcd_timeout(int on, int dim, const char *name) 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); @@ -766,7 +766,7 @@ static int set_lcd_timeout(int on, int dim, const char *name) /* 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) { @@ -774,16 +774,16 @@ static int set_lcd_timeout(int on, int dim, const char *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; } @@ -795,7 +795,7 @@ static void reset_lcd_timeout(GDBusConnection *conn, const gchar *unique_name, gpointer data) { - enum deviced_display_state current; + enum syscommon_deviced_display_state current; int ret; if (!sender) @@ -811,15 +811,15 @@ static void reset_lcd_timeout(GDBusConnection *conn, 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); } @@ -935,7 +935,7 @@ static GVariant *dbus_customlcdon(GDBusConnection *conn, 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); @@ -960,7 +960,7 @@ static GVariant *dbus_customlcdoff(GDBusConnection *conn, 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); @@ -994,13 +994,13 @@ static GVariant *dbus_changestatebyreason(GDBusConnection *conn, 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"; @@ -1258,7 +1258,7 @@ static GVariant *dbus_dimstay_control(GDBusConnection *conn, 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); @@ -1282,7 +1282,7 @@ static GVariant *dbus_dimstay_control(GDBusConnection *conn, 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: @@ -1355,7 +1355,7 @@ static GVariant *dbus_getrotationangle(GDBusConnection *conn, 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); @@ -1388,7 +1388,7 @@ static GVariant *dbus_pmlockgetlockstate(GDBusConnection *conn, { 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); diff --git a/src/display/display-dpms.c b/src/display/display-dpms.c index d041030..cb73b35 100644 --- a/src/display/display-dpms.c +++ b/src/display/display-dpms.c @@ -452,10 +452,10 @@ static void check_dpms_checklist(int mode) 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(); } @@ -467,14 +467,14 @@ void register_dpms_checklist(int mode, void (*checker)(void), const char *caller 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); } @@ -658,14 +658,14 @@ bool dpms_init(void) } 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; diff --git a/src/display/display-dpms.h b/src/display/display-dpms.h index 9914048..1162920 100644 --- a/src/display/display-dpms.h +++ b/src/display/display-dpms.h @@ -19,18 +19,6 @@ #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); diff --git a/src/display/display-lock.c b/src/display/display-lock.c index bb12c2d..4d2f1ca 100644 --- a/src/display/display-lock.c +++ b/src/display/display-lock.c @@ -48,7 +48,7 @@ #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; @@ -58,10 +58,10 @@ struct display_lock { 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) { @@ -74,7 +74,7 @@ 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; @@ -92,7 +92,7 @@ static struct display_lock* find_lock(enum deviced_display_state state, pid_t pi /* 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; @@ -116,7 +116,7 @@ static void add_lock(struct display_lock *dl) */ static void remove_lock(struct display_lock *dl) { - enum deviced_display_state state; + enum syscommon_deviced_display_state state; if (!dl) return; @@ -129,8 +129,8 @@ static void remove_lock(struct display_lock *dl) 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) @@ -201,33 +201,33 @@ static void set_lock_background(struct display_lock *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; @@ -245,7 +245,7 @@ static void broadcast_lock_changed(enum deviced_display_state state) 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; @@ -273,7 +273,7 @@ static void app_status_callback(GVariant *var, void *user_data, GError *err) 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) @@ -307,7 +307,7 @@ static gboolean lock_watchdog_callback(void *data) 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; } @@ -328,13 +328,13 @@ static gboolean lock_watchdog_callback(void *data) } 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: @@ -368,7 +368,7 @@ static gboolean lock_expired_callback(gpointer data) 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); @@ -384,11 +384,11 @@ static gboolean lock_expired_callback(gpointer data) * 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); @@ -405,7 +405,7 @@ int display_lock_request_lock(enum deviced_display_state state, pid_t pid, unsig 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); @@ -415,11 +415,11 @@ int display_lock_request_lock(enum deviced_display_state state, pid_t pid, unsig 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); @@ -437,7 +437,7 @@ int display_lock_update_lock(enum deviced_display_state state, pid_t pid, unsign 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); @@ -452,14 +452,14 @@ static void free_lock_all(gpointer data, gpointer udata) { 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; @@ -495,7 +495,7 @@ static void print_display_lock(gpointer data, gpointer udata) } -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); @@ -506,11 +506,11 @@ int display_app_background(void *data) 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); @@ -522,11 +522,11 @@ int display_app_foreground(void *data) 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); @@ -537,9 +537,9 @@ int display_app_terminated(void *data) { 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; } @@ -571,14 +571,14 @@ static void print_lock_info(gpointer data, gpointer udata) 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); } @@ -590,8 +590,8 @@ static void proc_condition_lock(PMMsg *data) { 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; @@ -603,13 +603,13 @@ static void proc_condition_lock(PMMsg *data) 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); @@ -622,7 +622,7 @@ static void proc_condition_lock(PMMsg *data) 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); @@ -630,11 +630,11 @@ static void proc_condition_lock(PMMsg *data) 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) { @@ -658,7 +658,7 @@ static void proc_condition_lock(PMMsg *data) 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; @@ -675,7 +675,7 @@ static void proc_condition_unlock(PMMsg *data) 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); @@ -683,11 +683,11 @@ static void proc_condition_unlock(PMMsg *data) 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) { @@ -715,7 +715,7 @@ int display_lock_proc_condition(PMMsg *data) 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); @@ -734,8 +734,8 @@ int display_lock_proc_condition(PMMsg *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 { diff --git a/src/display/display-lock.h b/src/display/display-lock.h index 7986e96..b277100 100644 --- a/src/display/display-lock.h +++ b/src/display/display-lock.h @@ -27,18 +27,18 @@ #include #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); diff --git a/src/display/display-misc.c b/src/display/display-misc.c index e96165e..ed10b3f 100644 --- a/src/display/display-misc.c +++ b/src/display/display-misc.c @@ -125,7 +125,7 @@ static int changed_battery_health(void *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; @@ -152,11 +152,11 @@ static void print_info(int fd) 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; @@ -173,13 +173,13 @@ static void print_info(int fd) 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); diff --git a/src/display/display-panel.c b/src/display/display-panel.c index 3492c45..f8bcbf9 100644 --- a/src/display/display-panel.c +++ b/src/display/display-panel.c @@ -60,14 +60,14 @@ int display_panel_set_dpms_state(int dpms_on, enum device_flags flags) 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); @@ -153,10 +153,10 @@ int display_panel_set_panel_state_by_on_state(enum device_flags flags) _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; @@ -188,12 +188,12 @@ int display_panel_set_panel_state_by_off_state(enum device_flags flags) 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; @@ -207,9 +207,9 @@ int display_panel_set_panel_state_by_standby_state(bool standby_on) { 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; @@ -270,9 +270,9 @@ void display_panel_lcd_on_procedure(int state, enum device_flags flag) 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); @@ -320,7 +320,7 @@ void display_panel_lcd_off_procedure(enum device_flags flag) 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); @@ -347,7 +347,7 @@ void display_panel_lcd_on_direct(enum device_flags flags) 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(); @@ -359,7 +359,7 @@ void display_panel_lcd_on_direct(enum device_flags flags) /* 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; } @@ -371,14 +371,14 @@ int display_panel_custom_lcd_on(int timeout) 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); @@ -391,7 +391,7 @@ int display_panel_custom_lcd_off(enum device_flags flag) 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. @@ -399,7 +399,7 @@ int display_panel_custom_lcd_off(enum device_flags flag) */ 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; @@ -407,13 +407,13 @@ int display_panel_custom_lcd_off(enum device_flags flag) } _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; } @@ -448,14 +448,14 @@ int display_panel_display_turn_on_by_reason(const char *reason, int timeout) 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; } @@ -474,14 +474,14 @@ int display_panel_display_turn_off_by_reason(const char *reason) 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 { @@ -490,10 +490,10 @@ int display_panel_display_turn_off_by_reason(const char *reason) } _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; } @@ -542,19 +542,19 @@ int display_panel_get_dpms_state(void) * 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; } diff --git a/src/display/display-plugin.c b/src/display/display-plugin.c index 74a82ba..63516ad 100644 --- a/src/display/display-plugin.c +++ b/src/display/display-plugin.c @@ -180,7 +180,7 @@ int display_plugin_backlight_transit_brightness(int start, int end, int step) } /* 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); @@ -188,7 +188,7 @@ int display_plugin_state_do_default_trans(enum deviced_display_state state, int 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; @@ -196,7 +196,7 @@ bool display_plugin_state_is_there_default_trans(enum deviced_display_state stat 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; @@ -210,7 +210,7 @@ int display_plugin_state_get_name(enum deviced_display_state state, const char * 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; @@ -220,7 +220,7 @@ int display_plugin_state_set_timeout(enum deviced_display_state state, int state 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; @@ -233,7 +233,7 @@ int display_plugin_state_get_timeout(enum deviced_display_state state, int* stat 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; diff --git a/src/display/display-plugin.h b/src/display/display-plugin.h index 5040bb1..d690e1d 100644 --- a/src/display/display-plugin.h +++ b/src/display/display-plugin.h @@ -75,9 +75,9 @@ struct display_plugin { 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; @@ -104,12 +104,12 @@ int display_plugin_backlight_transit_state(int state); 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); diff --git a/src/display/display-state-transition.c b/src/display/display-state-transition.c index f70ed46..85c38fd 100644 --- a/src/display/display-state-transition.c +++ b/src/display/display-state-transition.c @@ -42,8 +42,8 @@ #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; @@ -51,20 +51,20 @@ static unsigned int custom_normal_timeout = 0; 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); } /** @@ -112,7 +112,7 @@ inline void set_pm_old_state(int state) /** * 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; @@ -123,8 +123,8 @@ static int get_default_timeout(enum deviced_display_state state, int *timeout) 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; } @@ -140,16 +140,16 @@ static int get_default_timeout(enum deviced_display_state state, int *timeout) 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; @@ -161,19 +161,19 @@ static int get_default_timeout(enum deviced_display_state state, int *timeout) 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. * @@ -198,7 +198,7 @@ static gboolean timeout_default_cb(void *data) * 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; @@ -258,7 +258,7 @@ static int set_current_timeout(int timeout, GSourceFunc timeout_cb) 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; @@ -269,7 +269,7 @@ int display_state_set_current(enum deviced_display_state state, enum deviced_eve 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; @@ -281,7 +281,7 @@ int display_state_set_current_full(enum deviced_display_state state, 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; @@ -291,7 +291,7 @@ int display_state_get_current(enum deviced_display_state *state) 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; @@ -306,7 +306,7 @@ static bool is_device_event_type_valid(int event_type) 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; @@ -315,7 +315,7 @@ int display_state_transition_get_next_transition_display_state(enum deviced_disp 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; @@ -355,7 +355,7 @@ int display_state_transition_reset_state_transition_timeout(int timeout) 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; @@ -374,15 +374,15 @@ int display_state_transition_reset_state_transition_timeout(int timeout) 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: @@ -393,7 +393,7 @@ int display_state_transition_set_custom_timeout(enum deviced_display_state state 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; @@ -401,10 +401,10 @@ int display_state_transition_get_custom_timeout(enum deviced_display_state state 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: @@ -446,8 +446,8 @@ void display_state_transition_update_display_state_timeout_by_priority(void) /* 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; @@ -457,7 +457,7 @@ void display_state_transition_update_display_state_timeout_by_priority(void) 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; @@ -475,24 +475,24 @@ void display_state_transition_update_display_state_timeout_by_priority(void) _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; @@ -501,12 +501,12 @@ bool display_state_transition_is_display_state_support_transition(enum deviced_d 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)) { @@ -547,10 +547,10 @@ bool display_state_transition_is_possible_to_go_lcdoff(void) 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); @@ -583,11 +583,11 @@ bool display_state_transition_is_possible_to_go_lcdoff(void) * 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; @@ -615,10 +615,10 @@ int display_state_transition_do_state_transition(enum deviced_display_state stat /* 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(); @@ -626,7 +626,7 @@ int display_state_transition_do_state_transition(enum deviced_display_state stat /* 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; @@ -647,11 +647,11 @@ int display_state_transition_do_state_transition_by_input_poll_event(void) 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; } @@ -697,8 +697,8 @@ static int display_state_transition_do_state_action(int timeout) 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; } @@ -707,7 +707,7 @@ static int display_state_transition_do_state_action(int timeout) /* 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 { @@ -716,7 +716,7 @@ static int display_state_transition_do_state_action(int timeout) } } - 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), @@ -730,55 +730,55 @@ static int display_state_transition_do_state_action(int timeout) 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()) { @@ -797,7 +797,7 @@ static int display_state_transition_do_state_action(int timeout) } } goto go_suspend; - default: /* DEVICED_DISPLAY_STATE_START */ + default: /* SYSCOMMON_DEVICED_DISPLAY_STATE_START */ return 0; } @@ -823,7 +823,7 @@ go_lcd_off: } /* 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; @@ -846,7 +846,7 @@ void display_state_transition_do_proc_change_state_action(enum deviced_display_s */ 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()) @@ -857,36 +857,36 @@ int display_state_transition_do_proc_change_state(unsigned int cond, pid_t pid) _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: diff --git a/src/display/display-state-transition.h b/src/display/display-state-transition.h index df5cfd6..957c42a 100644 --- a/src/display/display-state-transition.h +++ b/src/display/display-state-transition.h @@ -31,28 +31,28 @@ #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); diff --git a/src/display/display-util.c b/src/display/display-util.c index 56da104..83a71aa 100644 --- a/src/display/display-util.c +++ b/src/display/display-util.c @@ -78,14 +78,14 @@ int display_util_get_display_state(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; } diff --git a/src/display/display.c b/src/display/display.c index ec42d05..9d26c1f 100644 --- a/src/display/display.c +++ b/src/display/display.c @@ -45,7 +45,7 @@ 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; @@ -67,27 +67,27 @@ inline void clear_pm_status_flag(unsigned int status_flag) 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; @@ -153,18 +153,18 @@ int display_initialize_display_state_timeout_from_setting(void) 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: @@ -208,7 +208,7 @@ int display_get_display_ops_status(enum device_ops_status *dev_ops_status) 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; @@ -222,14 +222,14 @@ void display_set_power_save_mode_flag(int onoff) 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) @@ -269,7 +269,7 @@ static gboolean delayed_dpms_init_done(gpointer data) 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; @@ -279,19 +279,19 @@ static gboolean delayed_dpms_init_done(gpointer data) 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); @@ -366,7 +366,7 @@ void display_set_initial_lockscreen_status(void) 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); } } @@ -523,7 +523,7 @@ static void display_init(void *data) 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; @@ -579,7 +579,7 @@ static void display_init(void *data) /* 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(); } @@ -600,7 +600,7 @@ static void display_init(void *data) 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 */ @@ -620,9 +620,9 @@ static void display_init(void *data) /* 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) { @@ -633,7 +633,7 @@ static void display_init(void *data) 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); @@ -657,9 +657,9 @@ static void display_exit(void *data) 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); diff --git a/src/display/display.h b/src/display/display.h index 011d690..1483ed5 100644 --- a/src/display/display.h +++ b/src/display/display.h @@ -20,6 +20,7 @@ #define __DISPLAY_H__ #include +#include #include "display-panel.h" #include "shared/devices.h" @@ -34,7 +35,7 @@ #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); @@ -42,8 +43,8 @@ void set_pm_old_state(int old_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); diff --git a/src/display/lock-detector.c b/src/display/lock-detector.c index 0194654..201097d 100644 --- a/src/display/lock-detector.c +++ b/src/display/lock-detector.c @@ -110,7 +110,7 @@ int set_lock_time(pid_t pid, const char *pname, int state) 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); @@ -199,7 +199,7 @@ int set_unlock_time(pid_t pid, int state) 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); diff --git a/src/display/resource-display.c b/src/display/resource-display.c index 86feba5..8ce2222 100644 --- a/src/display/resource-display.c +++ b/src/display/resource-display.c @@ -49,16 +49,16 @@ static int set_display_attr_data(int resource_id, 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; @@ -82,7 +82,7 @@ static int set_tuple2_display_attr_data(int resource_id, 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; /** @@ -95,7 +95,7 @@ static int set_tuple2_display_attr_data(int resource_id, } 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; @@ -111,9 +111,9 @@ static int set_tuple2_display_attr_data(int resource_id, 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; } @@ -139,7 +139,7 @@ static int get_display_attr_data(int resource_id, 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(); diff --git a/src/display/setting.c b/src/display/setting.c index ba5a35e..8bf4bde 100644 --- a/src/display/setting.c +++ b/src/display/setting.c @@ -61,11 +61,11 @@ static gboolean display_state_send_system_event(gpointer data) 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; @@ -127,7 +127,7 @@ int get_usb_status(int *val) 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; @@ -254,7 +254,7 @@ static int setting_cb(keynode_t *key_nodes, void *data) 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); @@ -322,19 +322,19 @@ int display_setting_update_pm_setting(int key_idx, int 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: diff --git a/src/display/slave-logging.c b/src/display/slave-logging.c index 53d6a84..c1e2966 100644 --- a/src/display/slave-logging.c +++ b/src/display/slave-logging.c @@ -35,7 +35,7 @@ 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; @@ -45,13 +45,13 @@ int save_pmlock(enum deviced_display_state state, bool on, pid_t pid) 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: diff --git a/src/extcon/cradle.c b/src/extcon/cradle.c index 76bce47..d7c3e4d 100644 --- a/src/extcon/cradle.c +++ b/src/extcon/cradle.c @@ -82,14 +82,14 @@ static int cradle_update(const char *index, int status) 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; diff --git a/src/led/touch-key.c b/src/led/touch-key.c index e8df615..c6195a9 100644 --- a/src/led/touch-key.c +++ b/src/led/touch-key.c @@ -201,7 +201,7 @@ static int hardkey_lcd_changed_cb(void *data) 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; diff --git a/src/power/power-doze.c b/src/power/power-doze.c index b7375ae..4c0f366 100644 --- a/src/power/power-doze.c +++ b/src/power/power-doze.c @@ -149,7 +149,7 @@ static void setting_doze_mode_cb(keynode_t *key, void *data) _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(); } diff --git a/src/time/time-handler.c b/src/time/time-handler.c index 1fc256d..5158f5a 100644 --- a/src/time/time-handler.c +++ b/src/time/time-handler.c @@ -361,10 +361,10 @@ static int time_lcd_changed_cb(void *data) 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; diff --git a/src/touchscreen/touchscreen.c b/src/touchscreen/touchscreen.c index 3ea40e4..a19c40a 100644 --- a/src/touchscreen/touchscreen.c +++ b/src/touchscreen/touchscreen.c @@ -64,7 +64,7 @@ static void touchscreen_wakeup_status(keynode_t *key, void *data) 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 @@ -185,7 +185,7 @@ static int touchscreen_start(enum device_flags flags) 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);