display plugin used get_charging_status() from initialization steps.
To use that function, display plugin loaded battery plugin.
However, that function is not exist in the battery plugin.
Thus, that function loading and accessing is useless work.
Also, loading battery plugin from the display plugin structure should be removed.
This function is added to display-misc.
- void display_misc_set_battery_charging_status_flag(void);
-> It checks battery charging status and sets CHRGR_FLAG.
-> This function should be relocated during battery plugin refactoring.
Change-Id: I943768785b654a660982a3017cafd0e41b7b94ed
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
static struct display_plugin *disp_plgn;
static struct display_backlight_ops *backlight_ops;
-static struct battery_plugin *battery_plgn;
-static int (*fp_get_charging_status) (int *val);
static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
static int default_proc_change_state(unsigned int cond, pid_t pid);
int lock_state;
int lock_screen_timeout = 0;
- /* Charging check */
- if (fp_get_charging_status && (fp_get_charging_status(&tmp) == 0) && (tmp > 0))
- set_pm_status_flag(CHRGR_FLAG);
-
ret = get_setting_brightness(&tmp);
if (ret != 0 || (tmp < PM_MIN_BRIGHTNESS || tmp > PM_MAX_BRIGHTNESS)) {
_I("Failed to read vconf value for brightness.");
init_pm_internal(data);
disp_plgn->device_flags_to_string = __device_flags_to_string;
- if (battery_plgn->handle) {
- fp_get_charging_status = dlsym(battery_plgn->handle, "get_charging_status");
- if (!fp_get_charging_status)
- _E("Failed to obtain address of get_charging_status");
- } else
- _I("There is no battery module.");
-
return 0;
}
backlight_ops = get_var_backlight_ops();
if (!backlight_ops)
_E("Failed to get backlight operator variable.");
-
- battery_plgn = get_var_battery_plugin();
- if (!battery_plgn)
- _E("Failed to get battery plugin variable.");
}
/**
* @}
static struct display_plugin *disp_plgn;
static struct display_backlight_ops *backlight_ops;
-static struct battery_plugin *battery_plgn;
-static int (*fp_get_charging_status) (int *val);
static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
int lock_state;
int lock_screen_timeout = 0;
- /* Charging check */
- if (fp_get_charging_status && (fp_get_charging_status(&tmp) == 0) && (tmp > 0))
- set_pm_status_flag(CHRGR_FLAG);
+ display_misc_set_battery_charging_status_flag();
ret = get_setting_brightness(&tmp);
if (ret != 0 || (tmp < PM_MIN_BRIGHTNESS || tmp > PM_MAX_BRIGHTNESS)) {
init_pm_internal(data);
disp_plgn->device_flags_to_string = __device_flags_to_string;
- if (battery_plgn->handle) {
- fp_get_charging_status = dlsym(battery_plgn->handle, "get_charging_status");
- if (!fp_get_charging_status)
- _E("Failed to obtain address of get_charging_status");
- } else
- _I("There is no battery module.");
-
return 0;
}
backlight_ops = get_var_backlight_ops();
if (!backlight_ops)
_E("Failed to get backlight operator variable.");
-
- battery_plgn = get_var_battery_plugin();
- if (!battery_plgn)
- _E("Failed to get battery plugin variable.");
}
/**
* @}
static struct display_plugin *disp_plgn;
static struct display_backlight_ops *backlight_ops;
-static struct battery_plugin *battery_plgn;
-static int (*fp_get_charging_status) (int *val);
static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
int lock_state;
int lock_screen_timeout = 0;
- /* Charging check */
- if (fp_get_charging_status && (fp_get_charging_status(&tmp) == 0) && (tmp > 0))
- set_pm_status_flag(CHRGR_FLAG);
-
ret = get_setting_brightness(&tmp);
if (ret != 0 || (tmp < PM_MIN_BRIGHTNESS || tmp > PM_MAX_BRIGHTNESS)) {
_I("Failed to read vconf value for brightness.");
init_pm_internal(data);
disp_plgn->device_flags_to_string = __device_flags_to_string;
- if (battery_plgn->handle) {
- fp_get_charging_status = dlsym(battery_plgn->handle, "get_charging_status");
- if (!fp_get_charging_status)
- _E("Failed to obtain address of get_charging_status");
- } else
- _I("There is no battery module.");
-
return 0;
}
backlight_ops = get_var_backlight_ops();
if (!backlight_ops)
_E("Failed to get backlight operator variable.");
-
- battery_plgn = get_var_battery_plugin();
- if (!battery_plgn)
- _E("Failed to get battery plugin variable.");
}
/**
* @}
static struct display_plugin *disp_plgn;
static struct display_backlight_ops *backlight_ops;
-static struct battery_plugin *battery_plgn;
-static int (*fp_get_charging_status) (int *val);
static enum device_ops_status status = DEVICE_OPS_STATUS_UNINIT;
int lock_state;
int lock_screen_timeout = 0;
- /* Charging check */
- if (fp_get_charging_status && (fp_get_charging_status(&tmp) == 0) && (tmp > 0))
- set_pm_status_flag(CHRGR_FLAG);
+ display_misc_set_battery_charging_status_flag();
ret = get_setting_brightness(&tmp);
if (ret != 0 || (tmp < PM_MIN_BRIGHTNESS || tmp > PM_MAX_BRIGHTNESS)) {
init_pm_internal(data);
disp_plgn->device_flags_to_string = __device_flags_to_string;
- if (battery_plgn->handle) {
- fp_get_charging_status = dlsym(battery_plgn->handle, "get_charging_status");
- if (!fp_get_charging_status)
- _E("Failed to obtain address of get_charging_status");
- } else
- _I("There is no battery module.");
-
return 0;
}
backlight_ops = get_var_backlight_ops();
if (!backlight_ops)
_E("Failed to get backlight operator variable.");
-
- battery_plgn = get_var_battery_plugin();
- if (!battery_plgn)
- _E("Failed to get battery plugin variable.");
}
/**
int power_supply_broadcast(char *sig, int status);
int battery_pm_change_internal(int pid, int s_bits);
void relaunch_health_popup(void);
+int get_charging_status(int *val);
#define CHARGER_STATUS_SIGNAL "ChargerStatus"
#define CHARGE_NOW_SIGNAL "ChargeNow"
close(fd);
}
}
+
+/* FIXME: This function should be moved to battery module */
+void display_misc_set_battery_charging_status_flag(void)
+{
+ int charging_status = 0;
+
+ if ((get_charging_status(&charging_status) == 0) && (charging_status > 0))
+ set_pm_status_flag(CHRGR_FLAG);
+}
\ No newline at end of file
void display_misc_save_display_log(const char *path);
int display_misc_set_touch_event_blocked(bool blocked);
bool display_misc_is_touch_event_blocked(void);
+void display_misc_set_battery_charging_status_flag(void);
#endif /* __DISPLAY_MISC_H__ */
\ No newline at end of file