_I("power_lock_e = %d", type);
if (!is_feature_display_supported() || !is_feature_display_state_supported()) {
- if ((type == POWER_LOCK_DISPLAY) || (type == POWER_LOCK_DISPLAY_DIM))
+ if ((type == POWER_LOCK_DISPLAY) || (type == POWER_LOCK_DISPLAY_DIM)) {
return DEVICE_ERROR_NOT_SUPPORTED;
- /*
- * In case of POWER_LOCK_CPU for headless profile, temporary return DEVICE_ERROR_NONE.
- * It will be implemented later.
- */
- else if (type == POWER_LOCK_CPU)
- return DEVICE_ERROR_NONE;
+ } else if (type == POWER_LOCK_CPU) {
+ /* in case of headless, request for cpu lock is handled
+ * in power module of deviced, not in display module */
+ ret = gdbus_call_sync_with_reply_int(DEVICED_BUS_NAME,
+ DEVICED_PATH_POWER, DEVICED_INTERFACE_POWER,
+ "LockCpu", g_variant_new("(i)", timeout_ms), NULL);
+ return errno_to_device_error(ret);
+ }
}
if (check_async_call_rate(&num_calls) < 0) {
_I("power_lock_e = %d", type);
if (!is_feature_display_supported() || !is_feature_display_state_supported()) {
- if ((type == POWER_LOCK_DISPLAY) || (type == POWER_LOCK_DISPLAY_DIM))
+ if ((type == POWER_LOCK_DISPLAY) || (type == POWER_LOCK_DISPLAY_DIM)) {
return DEVICE_ERROR_NOT_SUPPORTED;
- /*
- * In case of POWER_LOCK_CPU for headless profile, temporary return DEVICE_ERROR_NONE.
- * It will be implemented later.
- */
- else if (type == POWER_LOCK_CPU)
- return DEVICE_ERROR_NONE;
+ } else if (type == POWER_LOCK_CPU) {
+ /* in case of headless, request for cpu unlock is handled
+ * in power module of deviced, not in display module */
+ ret_val = gdbus_call_sync_with_reply_int(DEVICED_BUS_NAME,
+ DEVICED_PATH_POWER, DEVICED_INTERFACE_POWER,
+ "UnlockCpu", NULL, NULL);
+ return errno_to_device_error(ret_val);
+ }
}
if (type == POWER_LOCK_CPU && power_locked_CPU) {