--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __TIZEN_SYSTEM_POWER_INTERNAL_H__
+#define __TIZEN_SYSTEM_POWER_INTERNAL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @platform
+ * @brief Power off the device.
+ * @details It operates synchronously.
+ * @since_tizen 6.5
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/reboot
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #DEVICE_ERROR_NONE Successful
+ * @retval #DEVICE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #DEVICE_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #DEVICE_ERROR_OPERATION_FAILED Operation failed
+ */
+int device_power_poweroff(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
#include <libsyscommon/dbus-system.h>
#include "power.h"
+#include "power-internal.h"
#include "display.h"
#include "common.h"
#define METHOD_POWEROFF "PowerOff"
#define METHOD_POWEROFF_WITH_OPTION "PowerOffWithOption"
+#define TYPE_POWEROFF "poweroff"
#define TYPE_REBOOT "reboot"
#define REBOOT_REASON_NONE ""
method, param);
return errno_to_device_error(ret);
}
+
+int device_power_poweroff(void)
+{
+ int ret;
+
+ ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME,
+ DEVICED_PATH_POWEROFF, DEVICED_INTERFACE_POWEROFF,
+ METHOD_POWEROFF, g_variant_new("(s)", TYPE_POWEROFF));
+
+ return errno_to_device_error(ret);
+}
//LCOV_EXCL_STOP
static int power_load_config(struct parse_result *result, void *data)