continue;
if (!scenario->func)
continue;
- scenario->func(data);
- found = 1;
+ if (scenario->func(data) == 0)
+ found = 1;
+ else
+ found = 0;
break;
}
return found;
*actvie_noti = NULL;
*event_noti = NULL;
}
- _I("actvie_noti=%s event_noti=%s", actvie_noti, event_noti);
+ _D("actvie_noti=%s event_noti=%s", *actvie_noti, *event_noti);
return ret;
}
} else
return launch_system_app(APP_DEFAULT,
2, APP_KEY_TYPE, value);
- } else
+ } else {
_D("boot-animation running yet");
+ return -1;
+ }
return 0;
}
static int battery_check_act(void *data)
{
power_off_timer_stop();
- lowbat_popup(CHARGE_CHECK_ACT);
- return 0;
+ return lowbat_popup(CHARGE_CHECK_ACT);
}
static int battery_warning_low_act(void *data)
{
power_off_timer_stop();
- lowbat_popup(WARNING_LOW_BAT_ACT);
- return 0;
+ return lowbat_popup(WARNING_LOW_BAT_ACT);
}
static int battery_critical_low_act(void *data)
{
power_off_timer_stop();
- lowbat_popup(CRITICAL_LOW_BAT_ACT);
- return 0;
+ return lowbat_popup(CRITICAL_LOW_BAT_ACT);
}
int battery_power_off_act(void *data)
{
- lowbat_popup(CRITICAL_LOW_BAT_ACT);
+ int ret;
+ ret = lowbat_popup(CRITICAL_LOW_BAT_ACT);
power_off_timer_start();
- return 0;
+ return ret;
}
int battery_charge_err_act(void *data)
{
power_off_timer_stop();
- lowbat_popup(CHARGE_ERROR_ACT);
- return 0;
+ return lowbat_popup(CHARGE_ERROR_ACT);
}
int battery_charge_err_low_act(void *data)
{
power_off_timer_stop();
- lowbat_popup(CHARGE_ERROR_LOW_ACT);
- return 0;
+ return lowbat_popup(CHARGE_ERROR_LOW_ACT);
}
int battery_charge_err_high_act(void *data)
{
power_off_timer_stop();
- lowbat_popup(CHARGE_ERROR_HIGH_ACT);
- return 0;
+ return lowbat_popup(CHARGE_ERROR_HIGH_ACT);
}
int battery_charge_err_ovp_act(void *data)
{
power_off_timer_stop();
- lowbat_popup(CHARGE_ERROR_OVP_ACT);
- return 0;
+ return lowbat_popup(CHARGE_ERROR_OVP_ACT);
}
static void lowbat_scenario_init(void)
cur_bat_state = battery_info.normal;
if (battery.charge_now) {
clear_noti_if_needed("clear", "all");
+ result = 1;
} else {
result = lowbat_scenario(cur_bat_state, new_bat_state, NULL);
if (result)
_I("cur %d, new %d(capacity %d)",
cur_bat_state, new_bat_state, bat_percent);
}
- cur_bat_state = new_bat_state;
+ if (result == 1)
+ cur_bat_state = new_bat_state;
exit:
if (lock == 0)
pm_unlock_internal(INTERNAL_LOCK_BATTERY, LCD_OFF, PM_SLEEP_MARGIN);