haptic: fix device API 00/285600/3 accepted/tizen_8.0_unified tizen_8.0 accepted/tizen/8.0/unified/20231005.093755 accepted/tizen/unified/20221220.180321 tizen_8.0_m2_release
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 15 Dec 2022 06:57:33 +0000 (15:57 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 15 Dec 2022 09:10:11 +0000 (18:10 +0900)
The device internal API enum and function have been updated.

Change-Id: I9391e4d74c096eabe79e3e0172a7dbaf51538960
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/core/haptic.c

index 4fea07d..ea86a05 100644 (file)
@@ -1134,12 +1134,13 @@ exit:
        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)
@@ -1172,7 +1173,7 @@ static void haptic_poweroff_cb(const struct device_change_state_info *info, void
        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;
 }
@@ -1306,7 +1307,7 @@ void haptic_init(void)
        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);
@@ -1342,7 +1343,7 @@ void haptic_exit(void)
                        _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);