--- /dev/null
+/*
+ * deviced
+ *
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ */
+
+/**
+ * @file input-dbus.c
+ * @brief dbus interface related to control input devices
+ * in this dbus methods will be added to
+ * "org.tizen.system.deviced.input" dbus interface.
+ */
+
+#include <error.h>
+#include <unistd.h>
+
+#include <libsyscommon/libgdbus.h>
+#include <hal/device/hal-device-input.h>
+
+#include "core/log.h"
+#include "shared/common.h"
+#include "input-dbus.h"
+
+/* FIXME: input.keyboard feature check should be added and return DEVICE_ERROR_NOT_SUPPORTED */
+static GVariant *dbus_inputseteventstate(GDBusConnection *conn,
+ const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
+ GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ int input_device_id, event_state;
+ int ret = 0;
+ pid_t pid;
+
+ g_variant_get(param, "(ii)", &input_device_id, &event_state);
+
+ ret = hal_device_input_set_event_state(input_device_id, event_state);
+ if (ret < 0)
+ _E("Failed to set input event state");
+
+ pid = gdbus_connection_get_sender_pid(conn, sender);
+ _D("Input set event state pid=%d input device id=%d event state=%d",
+ pid, input_device_id, event_state);
+
+ return g_variant_new("(i)", ret);
+}
+
+/* FIXME: input.keyboard feature check should be added and return DEVICE_ERROR_NOT_SUPPORTED */
+static GVariant *dbus_inputgeteventstate(GDBusConnection *conn,
+ const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
+ GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
+{
+ int input_device_id, event_state = 0;
+ int ret = 0;
+ pid_t pid;
+
+ g_variant_get(param, "(i)", &input_device_id);
+
+ ret = hal_device_input_get_event_state(input_device_id, &event_state);
+ if (ret < 0)
+ _E("Failed to get input event state");
+ else
+ ret = event_state;
+
+ pid = gdbus_connection_get_sender_pid(conn, sender);
+ _D("Input get event state pid=%d input device id=%d event_state=%d",
+ pid, input_device_id, event_state);
+
+ return g_variant_new("(i)", ret);
+}
+
+static const dbus_method_s dbus_methods[] = {
+ {"InputSetEventState", "ii", "i", dbus_inputseteventstate},
+ {"InputGetEventState", "i", "i", dbus_inputgeteventstate},
+ /* Add methods here */
+};
+
+static const dbus_interface_u dbus_interface = {
+ .oh = NULL,
+ .name = DEVICED_INTERFACE_INPUT,
+ .methods = dbus_methods,
+ .nr_methods = ARRAY_SIZE(dbus_methods),
+};
+
+int input_dbus_init(void)
+{
+ int ret = 0;
+
+ ret = gdbus_add_object(NULL, DEVICED_PATH_INPUT, &dbus_interface);
+ if (ret < 0) {
+ _E("Failed to init input device dbus interface(%d)", ret);
+ return ret;
+ }
+ return 0;
+}
\ No newline at end of file
--- /dev/null
+/*
+ * deviced
+ *
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ *
+ * 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 __INPUT_DBUS_H__
+#define __INPUT_DBUS_H__
+
+int input_dbus_init(void);
+
+#endif //__INPUT_DBUS_H__