return ret;
}
-//LCOV_EXCL_START unused function
-
static int load_battery_plugin()
{
if (plugin_battery_get_info)
if (!handle) {
handle = dlopen(BATTERY_PLUGIN, RTLD_NOW);
if (!handle) {
+//LCOV_EXCL_START System Error
_E("Failed to open '%s' : %s", BATTERY_PLUGIN, dlerror());
return -1;
+//LCOV_EXCL_STOP
}
}
plugin_battery_get_info = (int (*)(void *))dlsym(handle, GET_INFO_FUNC);
if (!plugin_battery_get_info) {
+//LCOV_EXCL_START System Error
_E("Failed to get symbol '%s' : %s", GET_INFO_FUNC, dlerror());
return -1;
+//LCOV_EXCL_STOP
}
return 0;
ret = plugin_battery_get_info(info);
if (ret < 0) {
+//LCOV_EXCL_START System Error
_E("Failed to get battery info: %d", ret);
return DEVICE_ERROR_OPERATION_FAILED;
+//LCOV_EXCL_STOP
}
return DEVICE_ERROR_NONE;
}
-//LCOV_EXCL_STOP
int device_battery_get_health(device_battery_health_e *health)
{
ret = device_battery_get_info(&info);
if (ret != DEVICE_ERROR_NONE) {
- _E("Failed to get battery info (%d)", ret); //LCOV_EXCL_LINE Logs
+//LCOV_EXCL_START System Error
+ _E("Failed to get battery info (%d)", ret);
return ret;
+//LCOV_EXCL_STOP
}
len = strlen(info.health);
ret = device_battery_get_info(&info);
if (ret != DEVICE_ERROR_NONE) {
- _E("Failed to get battery info (%d)", ret); //LCOV_EXCL_LINE Logs
+//LCOV_EXCL_START System Error
+ _E("Failed to get battery info (%d)", ret);
return ret;
+//LCOV_EXCL_STOP
}
len = strlen(info.power_source);
ret = device_battery_get_info(&info);
if (ret != DEVICE_ERROR_NONE) {
- _E("Failed to get battery info (%d)", ret); //LCOV_EXCL_LINE Logs
+//LCOV_EXCL_START System Error
+ _E("Failed to get battery info (%d)", ret);
return ret;
+//LCOV_EXCL_STOP
}
switch (property) {
ret = device_battery_get_info(&info);
if (ret != DEVICE_ERROR_NONE) {
- _E("Failed to get battery info (%d)", ret); //LCOV_EXCL_LINE Logs
+//LCOV_EXCL_START System Error
+ _E("Failed to get battery info (%d)", ret);
return ret;
+//LCOV_EXCL_STOP
}
len = strlen(info.status);
#define BOOT_SO_PATH "/usr/lib/deviced/bootmode.so"
-//LCOV_EXCL_START Not used function
int device_get_reboot_mode(void)
{
int (*get_reboot_mode) (void);
handle = dlopen(BOOT_SO_PATH, RTLD_NOW|RTLD_GLOBAL);
if (!handle) {
+//LCOV_EXCL_START System Error
_E("Failed to open module: %s", dlerror());
return NORMAL_BOOT;
+//LCOV_EXCL_STOP
}
get_reboot_mode = dlsym(handle, "get_reboot_mode");
if (!get_reboot_mode) {
+//LCOV_EXCL_START System Error
_E("Failed to get address of get_reboot_mode().");
dlclose(handle);
return NORMAL_BOOT;
+//LCOV_EXCL_STOP
}
ret = get_reboot_mode();
return ret;
}
-//LCOV_EXCL_STOP
if (n == 0) {
ret = release_request(type);
if (ret < 0)
- return DEVICE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+ return DEVICE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE System Error
}
return DEVICE_ERROR_NONE;
//LCOV_EXCL_START System Error
if (errno == ENOENT) {
_I("There is no power config file");
-//LCOV_EXCL_STOP
return 0;
+//LCOV_EXCL_STOP
}
//LCOV_EXCL_START System Error
fclose(f);
return 0;
-error:
//LCOV_EXCL_START System Error
+error:
if (f)
fclose(f);
_E("Failed to read %s:%d!", file_name, lineno);
return result;
}
+//LCOV_EXCL_START Not used function
int dbus_method_sync(const char *dest, const char *path,
const char *interface, const char *method,
const char *sig, const char *param[])
method,
append_g_variant(sig, param));
}
+//LCOV_EXCL_STOP
int dbus_method_sync_with_reply_var(const char *dest,
const char *path, const char *interface,
return DEVICE_ERROR_NONE;
}
+//LCOV_EXCL_START Not used function
int dbus_method_sync_with_reply(const char *dest,
const char *path, const char *interface,
const char *method, const char *sig,
append_g_variant(sig, param),
info);
}
+//LCOV_EXCL_STOP
static void cb_pending(GDBusProxy *proxy,
GAsyncResult *res,
res, /* GAsyncResult */
&err);
if (!output)
- _E("g_dbus_proxy_call_finish error : %d-%s", //LCOV_EXCL_LINE
+ _E("g_dbus_proxy_call_finish error : %d-%s", //LCOV_EXCL_LINE Logs
err?err->code:0, err?err->message:"NULL");
if (data && data->func)
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
METHOD_GET_DISPLAY_COUNT, NULL);
if (ret < 0)
- return errno_to_device_error(ret); //LCOV_EXCL_LINE
+ return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
display_cnt = ret;
alloc_display();
}
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
METHOD_GET_MAX_BRIGHTNESS, g_variant_new("(i)", (int)DISPLAY_STATE_NORMAL));
if (ret < 0)
- return errno_to_device_error(ret); //LCOV_EXCL_LINE
+ return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
display_arr[display_index].normal_max = ret;
}
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
METHOD_GET_BRIGHTNESS, g_variant_new("(i)", (int)DISPLAY_STATE_NORMAL));
if (ret < 0)
- return errno_to_device_error(ret); //LCOV_EXCL_LINE
+ return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
*brightness = ret;
return DEVICE_ERROR_NONE;
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
METHOD_SET_BRIGHTNESS, g_variant_new("(ii)", (int)DISPLAY_STATE_NORMAL, brightness));
if (ret < 0)
- return errno_to_device_error(ret); //LCOV_EXCL_LINE
+ return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
return DEVICE_ERROR_NONE;
}
METHOD_CHANGE_STATE, g_variant_new("(s)", str), change_cb, -1, NULL);
}
-//LCOV_EXCL_START Not used function
int device_display_get_max_brightness_state(int display_index, display_state_e state, int *brightness)
{
int ret;
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
METHOD_GET_MAX_BRIGHTNESS, g_variant_new("(i)", (int)state));
if (ret < 0)
- return errno_to_device_error(ret);
+ return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
if (state == DISPLAY_STATE_NORMAL) {
display_arr[display_index].normal_max = ret;
}
//LCOV_EXCL_STOP
-//LCOV_EXCL_START Not used function
int device_display_get_brightness_state(int display_index, display_state_e state, int *brightness)
{
int ret;
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
METHOD_GET_BRIGHTNESS, g_variant_new("(i)", (int)state));
if (ret < 0)
- return errno_to_device_error(ret);
+ return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
*brightness = ret;
return DEVICE_ERROR_NONE;
}
-//LCOV_EXCL_STOP
-//LCOV_EXCL_START Not used function
int device_display_set_brightness_state(int display_index, display_state_e state, int brightness)
{
int ret, max;
DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY,
METHOD_SET_BRIGHTNESS, g_variant_new("(ii)", (int)state, brightness));
if (ret < 0)
- return errno_to_device_error(ret);
+ return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
return DEVICE_ERROR_NONE;
}
return errno_to_device_error(ret);
}
-
-//LCOV_EXCL_STOP
ret = system_info_get_platform_bool(VIBRATION_FEATURE, &haptic_avail);
if (ret < 0) {
+//LCOV_EXCL_START System Error
_E("Failed to get value of haptic feature");
return false;
+//LCOV_EXCL_STOP
} else if (ret == 0 && !haptic_avail) {
+//LCOV_EXCL_START System Error
_D("Haptic is not supported");
return false;
+//LCOV_EXCL_STOP
} else
return true;
}
if (!found) {
handle = (struct haptic_handle *)malloc(sizeof(struct haptic_handle));
if (!handle) {
- _E("Failed to malloc"); //LCOV_EXCL_LINE System Error
+//LCOV_EXCL_START System Error
+ _E("Failed to malloc");
return DEVICE_ERROR_OPERATION_FAILED;
+//LCOV_EXCL_STOP
}
handle->handle = ret;
if (DD_LIST_LENGTH(handle_list) == 1) {
ret = register_signal_handler();
if (ret < 0)
- _E("Faild to register signal handler"); //LCOV_EXCL_LINE
+ _E("Faild to register signal handler"); //LCOV_EXCL_LINE Logs
}
return DEVICE_ERROR_NONE;
if (DD_LIST_LENGTH(handle_list) == 0) {
ret = unregister_signal_handler();
if (ret < 0)
- _E("Failed to unregister signal handler"); //LCOV_EXCL_LINE
+ _E("Failed to unregister signal handler"); //LCOV_EXCL_LINE Logs
}
return DEVICE_ERROR_NONE;
if (ret < 0)
return errno_to_device_error(ret);
//LCOV_EXCL_STOP
+
return DEVICE_ERROR_NONE;
}
return DEVICE_ERROR_NONE;
}
-//LCOV_EXCL_START Not used function
int device_multi_led_get_number(int *num_of_leds)
{
int ret;
return dbus_method_sync_var(DEVICED_BUS_NAME, DEVICED_PATH_LED,
DEVICED_INTERFACE_LED, METHOD_MULTI_LED_CONTROL, var);
}
-//LCOV_EXCL_STOP
#define METHOD_APP_LAUNCH_HOME "AppLaunchHome"
#define METHOD_HOMESCREEN "HomeScreen"
-//LCOV_EXCL_START Not used function
int device_pmqos_app_launch_home(int timeout)
{
int ret;
METHOD_APP_LAUNCH_HOME,
g_variant_new("(i)", timeout));;
if (ret < 0)
- return errno_to_device_error(ret);
+ return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
return DEVICE_ERROR_NONE;
}
METHOD_HOMESCREEN,
g_variant_new("(i)", timeout));;
if (ret < 0)
- return errno_to_device_error(ret);
+ return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
return DEVICE_ERROR_NONE;
}
-//LCOV_EXCL_STOP
ret = config_parse(POWER_CONF, power_load_config, NULL);
if (ret < 0)
- _E("Failed to load config file (%d)", ret); //LCOV_EXCL_LINE
+ _E("Failed to load config file (%d)", ret); //LCOV_EXCL_LINE Logs
}
DEVICED_INTERFACE_TEMPERATURE,
METHOD_GET_TEMPERATURE, g_variant_new("(i)", type));
if (ret < 0)
- return errno_to_device_error(ret); //LCOV_EXCL_LINE
+ return errno_to_device_error(ret); //LCOV_EXCL_LINE System Error
*temp = ret;
return DEVICE_ERROR_NONE;
#define METHOD_TOUCHSCREEN_ENABLE "Enable"
#define METHOD_TOUCHSCREEN_DISABLE "Disable"
-//LCOV_EXCL_START Not used function
int device_touchscreen_enable(device_dbus_pending_cb cb)
{
int ret;
+
ret = dbus_method_async_with_reply(DEVICED_BUS_NAME,
DEVICED_PATH_TOUCH, DEVICED_INTERFACE_TOUCH,
METHOD_TOUCHSCREEN_ENABLE, NULL, NULL, cb, -1, NULL);
int device_touchscreen_disable(device_dbus_pending_cb cb)
{
int ret;
+
ret = dbus_method_async_with_reply(DEVICED_BUS_NAME,
DEVICED_PATH_TOUCH, DEVICED_INTERFACE_TOUCH,
METHOD_TOUCHSCREEN_DISABLE, NULL, NULL, cb, -1, NULL);
return errno_to_device_error(ret);
}
-//LCOV_EXCL_STOP