ss_lowbat_monitor(NULL);
+ if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_NOW, &charge_now) != 0 ||
+ device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CAPACITY, &capacity) != 0)
+ _E("fail to get battery node value");
+ if (charge_now == 0 && capacity == 0) {
+ _E("target will be shut down");
+ battery_power_off_act(NULL);
+ return;
+ }
+
ret = device_get_property(DEVICE_TYPE_POWER, PROP_POWER_PRESENT, &val);
if (ret != 0)
_E("fail to get battery present value");
if (val == 0 && present_status == 1) {
present_status = 0;
_E("battery cf is opened");
- ss_action_entry_call_internal(PREDEF_BATTERY_CF_OPENED, 0);
+ if (charge_now)
+ ss_action_entry_call_internal(PREDEF_BATTERY_CF_OPENED, 0);
}
if (val == 1 && present_status == 0) {
_E("battery cf is closed again");
}
- if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CHARGE_NOW, &charge_now) != 0 ||
- device_get_property(DEVICE_TYPE_POWER, PROP_POWER_CAPACITY, &capacity) != 0)
- _E("fail to get battery node value");
- if (charge_now == 0 && capacity == 0) {
- _E("target will be shut down");
- battery_power_off_act(NULL);
- return;
- }
-
if (device_get_property(DEVICE_TYPE_POWER, PROP_POWER_HEALTH, &val) == 0) {
if (val==BATTERY_OVERHEAT || val==BATTERY_COLD) {
_E("Battery health status is not good (%d)", val);