From 8b72e20fd650aa452e582a68e02bfbc02583b42f Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Wed, 18 Sep 2019 09:07:28 +0900 Subject: [PATCH] Delete not supported error for emulator and initialize battery info to 0 TCT ITc_device_battery_get_property_p requires for device_battery_get_property() to return true even if DEVICE_BATTERY_PROPERTY_VOLTAGE_NOW, DEVICE_BATTERY_PROPERTY_VOLTAGE_AVERAGE, DEVICE_BATTERY_PROPERTY_TEMPERATURE are given in case of emulator. Change-Id: I40be244c2c3acba6ee1c09e688354d15ca24d653 Signed-off-by: Youngjae Cho --- src/battery.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/battery.c b/src/battery.c index 22326c6..a5c6954 100644 --- a/src/battery.c +++ b/src/battery.c @@ -279,7 +279,7 @@ int device_battery_get_power_source(device_battery_power_source_e *source) int device_battery_get_property(device_battery_property_e property, int *val) { - struct battery_info info; + struct battery_info info = {0, }; int ret; if (!val) @@ -289,12 +289,6 @@ int device_battery_get_property(device_battery_property_e property, int *val) if (!ret) return DEVICE_ERROR_NOT_SUPPORTED; - if (is_emulator()) - if (property == DEVICE_BATTERY_PROPERTY_VOLTAGE_NOW || - property == DEVICE_BATTERY_PROPERTY_VOLTAGE_AVERAGE || - property == DEVICE_BATTERY_PROPERTY_TEMPERATURE) - return DEVICE_ERROR_NOT_SUPPORTED; - ret = device_battery_get_info(&info); if (ret != DEVICE_ERROR_NONE) { _E("Failed to get battery info (%d)", ret); //LCOV_EXCL_LINE Logs -- 2.7.4