return g_variant_new("(i)", ret);
}
-static void haptic_poweroff_cb(const struct device_change_state_info *info, void *udata)
+static void haptic_poweroff_cb(device_power_state_e prev_state,
+ device_power_state_e next_state, uint64_t wait_callback_id, device_power_transition_reason_e reason, void *udata)
{
int ret, level;
struct timespec time = {0,};
- _D("Poweroff: %"PRIx64, info->next_state);
+ _D("Poweroff: %"PRIx64, (uint64_t) next_state);
if (hal_device_haptic_check_backend() < 0) {
if (haptic_module_load() < 0)
time.tv_nsec = POWER_OFF_VIB_DURATION * NANO_SECOND_MULTIPLIER;
nanosleep(&time, NULL);
- device_power_change_state_wait_done(info->id);
+ device_power_confirm_wait_callback(wait_callback_id);
return;
}
if (r < 0)
_E("Failed to init hdbus interface and method: %d", r);
- r = device_power_add_change_state_wait_callback(POWER_STATE_POWEROFF | POWER_STATE_REBOOT,
+ r = device_power_add_state_wait_callback(DEVICE_POWER_STATE_POWEROFF | DEVICE_POWER_STATE_REBOOT,
haptic_poweroff_cb, NULL);
if (r < 0) {
_E("Failed to register poweroff handler: %d", r);
_W("Remove watch for VCONFKEY_RECORDER_STATE failed.");
}
- device_power_remove_change_state_wait_callback(POWER_STATE_POWEROFF | POWER_STATE_REBOOT);
+ device_power_remove_state_wait_callback(DEVICE_POWER_STATE_POWEROFF | DEVICE_POWER_STATE_REBOOT);
/* release haptic data memory */
safe_free(haptic_conf.level_arr);