deviced: Set vconf as NOTSUP error in no battery model 63/35763/1 accepted/tizen/common/20150226.084940 accepted/tizen/mobile/20150226.100235 accepted/tizen/tv/20150226.094323 accepted/tizen/wearable/20150226.095552 submit/tizen/20150226.021716
authorJiyoung Yun <jy910.yun@samsung.com>
Tue, 24 Feb 2015 10:08:05 +0000 (19:08 +0900)
committerJiyoung Yun <jy910.yun@samsung.com>
Tue, 24 Feb 2015 10:08:05 +0000 (19:08 +0900)
Runtime-info and Capi-system-device api uses battery vconf
to get battery status.
So if there is no battery in target, deviced set vconf as -ENOTSUP value.

Change-Id: I9fe23fb6671493394a02ff5b4c7d8a91437e48fe
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
src/battery/lowbat-handler.c

index 8e19789..52baa79 100644 (file)
@@ -520,6 +520,14 @@ static int lowbat_probe(void *data)
         * deviced does not activate a battery module.
         */
        if (access(POWER_PATH, R_OK) != 0) {
+               /**
+                * Set battery vconf as -ENOTSUP
+                * These vconf key used by runtime-info and capi-system-device.
+                */
+               vconf_set_int(VCONFKEY_SYSMAN_CHARGER_STATUS, -ENOTSUP);
+               vconf_set_int(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW, -ENOTSUP);
+               vconf_set_int(VCONFKEY_SYSMAN_BATTERY_LEVEL_STATUS, -ENOTSUP);
+
                _E("there is no power-supply class");
                return -ENODEV;
        }