#define BATTERY_FEATURE "http://tizen.org/feature/battery"
-static bool hal_battery_loaded = false;
-
static int is_battery_supported(void)
{
int ret;
if (!ret)
return DEVICE_ERROR_NOT_SUPPORTED;
- if (!hal_battery_loaded) {
- ret = hal_device_battery_get_backend();
- if (ret < 0)
- return DEVICE_ERROR_OPERATION_FAILED;
-
- hal_battery_loaded = true;
- }
-
ret = hal_device_battery_get_current_state(battery_get_info, info);
if (ret < 0) {
//LCOV_EXCL_START System Error
void __attribute__ ((destructor)) battery_finalize(void)
{
hal_device_battery_put_backend();
- hal_battery_loaded = false;
}