ADD_SUBDIRECTORY(src/deviced-input)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/input.conf DESTINATION /etc/deviced)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/conf/input.conf DESTINATION /etc/deviced/conf.d)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/power.conf DESTINATION /etc/deviced)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/rndis.service DESTINATION /usr/lib/systemd/system)
INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/packaging/rndis.sh DESTINATION /usr/bin)
--- /dev/null
+# [EventAction] - define event and corresponding action
+# Name=string
+# - define mnemonic for the event, and it is only used for logging
+# Enum=integer
+# - define an integer that represents the event. deviced uses this
+# integer in broadcasting dbus signal.
+# Keycode=string
+# - define keycode to filter key event.
+# as support key/button definitions in linux/input.h, put the same string definitions.
+# For example, keycode=KEY_POWER
+# DetectionRangeMsec=integer,integer
+# - define time window in milisecond for filtering key event. -1 means no limit.
+# TriggerType=level/edge
+# - define event type
+# ActionBroadcast=yes
+# - Broadcast upon occuring an event, default no.
+# ActionChangeState=current,next
+# - define state transition action for the event.
+# WakeLockDurationSec=
+# - acquire wakelock for a specfied timeout
+
+# [EventAction]
+# Name=PWKEY_SHORT_EDGE
+# Enum=1000
+# Keycode=KEY_POWER
+# DetectionRangeMsec=0,2000
+# TriggerType=edge
+# ActionBroadcast=yes
+# WakeLockDurationSec=5
+
+# [EventAction]
+# Name=PWKEY_LONG_LEVEL
+# Enum=1001
+# Keycode=KEY_POWER
+# DetectionRangeMsec=2000,-1
+# TriggerType=level
+# ActionBroadcast=yes
+# WakeLockDurationSec=5
+
+# [EventAction]
+# Name=PWKEY_LONG_EDGE
+# Enum=1002
+# Keycode=KEY_POWER
+# DetectionRangeMsec=2000,7000
+# TriggerType=edge
+# ActionChangeState=normal,sleep
+# ActionChangeState=sleep,normal
+
+# [EventAction]
+# Name=PWKEY_LONGEST_LEVEL
+# Enum=1003
+# Keycode=KEY_POWER
+# DetectionRangeMsec=7000,-1
+# TriggerType=level
+# ActionBroadcast=yes
+# WakeLockDurationSec=5
+
+# [EventAction]
+# Name=PWKEY_LONGEST_EDGE_WO_CHARGER
+# Enum=1004
+# Keycode=KEY_POWER
+# DetectionRangeMsec=7000,-1
+# TriggerType=edge
+# ConditionVconf=memory/sysman/charger_status,int,0
+# ActionChangeState=normal,poweroff
+# ActionChangeState=sleep,normal
+
+# [EventAction]
+# Name=PWKEY_LONGEST_EDGE_W_CHARGER
+# Enum=1004
+# Keycode=KEY_POWER
+# DetectionRangeMsec=7000,-1
+# TriggerType=edge
+# ConditionVconf=memory/sysman/charger_status,int,1
+# ActionChangeState=normal,sleep
+# ActionChangeState=sleep,normal
+
+# [EventAction]
+# Name=BTKEY_SHORT_EDGE
+# Enum=1005
+# Keycode=KEY_BLUETOOTH
+# DetectionRangeMsec=0,2000
+# TriggerType=edge
+# ActionBroadcast=yes
+# WakeLockDurationSec=5
+
+# [EventAction]
+# Name=BTKEY_LONG_LEVEL
+# Enum=1006
+# Keycode=KEY_BLUETOOTH
+# DetectionRangeMsec=2000,-1
+# TriggerType=level
+# ActionBroadcast=yes
+# WakeLockDurationSec=5
+
+# [EventAction]
+# Name=BTKEY_LONG_EDGE
+# Enum=1007
+# Keycode=KEY_BLUETOOTH
+# DetectionRangeMsec=2000,7000
+# TriggerType=edge
+# ActionBroadcast=yes
+++ /dev/null
-# [EventAction] - define event and corresponding action
-# Name=string
-# - define mnemonic for the event, and it is only used for logging
-# Enum=integer
-# - define an integer that represents the event. deviced uses this
-# integer in broadcasting dbus signal.
-# Keycode=string
-# - define keycode to filter key event.
-# as support key/button definitions in linux/input.h, put the same string definitions.
-# For example, keycode=KEY_POWER
-# DetectionRangeMsec=integer,integer
-# - define time window in milisecond for filtering key event. -1 means no limit.
-# TriggerType=level/edge
-# - define event type
-# ActionBroadcast=yes
-# - Broadcast upon occuring an event, default no.
-# ActionChangeState=current,next
-# - define state transition action for the event.
-# WakeLockDurationSec=
-# - acquire wakelock for a specfied timeout
-
-#[EventAction]
-#Name=PWKEY_SHORT_EDGE
-#Enum=1000
-#Keycode=KEY_POWER
-#DetectionRangeMsec=0,2000
-#TriggerType=edge
-#ActionBroadcast=yes
-#WakeLockDurationSec=5
-
-#[EventAction]
-#Name=PWKEY_LONG_LEVEL
-#Enum=1001
-#Keycode=KEY_POWER
-#DetectionRangeMsec=2000,-1
-#TriggerType=level
-#ActionBroadcast=yes
-#WakeLockDurationSec=5
-
-#[EventAction]
-#Name=PWKEY_LONG_EDGE
-#Enum=1002
-#Keycode=KEY_POWER
-#DetectionRangeMsec=2000,7000
-#TriggerType=edge
-#ActionChangeState=normal,sleep
-#ActionChangeState=sleep,normal
-
-#[EventAction]
-#Name=PWKEY_LONGEST_LEVEL
-#Enum=1003
-#Keycode=KEY_POWER
-#DetectionRangeMsec=7000,-1
-#TriggerType=level
-#ActionBroadcast=yes
-#WakeLockDurationSec=5
-
-#[EventAction]
-#Name=PWKEY_LONGEST_EDGE_WO_CHARGER
-#Enum=1004
-#Keycode=KEY_POWER
-#DetectionRangeMsec=7000,-1
-#TriggerType=edge
-#ConditionVconf=memory/sysman/charger_status,int,0
-#ActionChangeState=normal,poweroff
-#ActionChangeState=sleep,normal
-
-#[EventAction]
-#Name=PWKEY_LONGEST_EDGE_W_CHARGER
-#Enum=1004
-#Keycode=KEY_POWER
-#DetectionRangeMsec=7000,-1
-#TriggerType=edge
-#ConditionVconf=memory/sysman/charger_status,int,1
-#ActionChangeState=normal,sleep
-#ActionChangeState=sleep,normal
-
-#[EventAction]
-#Name=BTKEY_SHORT_EDGE
-#Enum=1005
-#Keycode=KEY_BLUETOOTH
-#DetectionRangeMsec=0,2000
-#TriggerType=edge
-#ActionBroadcast=yes
-#WakeLockDurationSec=5
-
-#[EventAction]
-#Name=BTKEY_LONG_LEVEL
-#Enum=1006
-#Keycode=KEY_BLUETOOTH
-#DetectionRangeMsec=2000,-1
-#TriggerType=level
-#ActionBroadcast=yes
-#WakeLockDurationSec=5
-
-#[EventAction]
-#Name=BTKEY_LONG_EDGE
-#Enum=1007
-#Keycode=KEY_BLUETOOTH
-#DetectionRangeMsec=2000,7000
-#TriggerType=edge
-#ActionBroadcast=yes
%manifest %{name}.manifest
%license LICENSE.Apache-2.0
%{SYSTEM_PLUGIN_LIBDIR}/libplugin-backend-deviced-input.so
-%config %{_sysconfdir}/deviced/input.conf
+%config %{_sysconfdir}/deviced/conf.d/input.conf
%config %{_sysconfdir}/deviced/power.conf
%{_unitdir}/rndis.service
%{_bindir}/rndis.sh
#define EXPORT __attribute__ ((visibility("default")))
-#define INPUT_CONF_PATH "/etc/deviced/input.conf"
+#define INPUT_CONF_PATH "/etc/deviced/conf.d/input.conf"
struct key_info {
const char *key_name;
static int deviced_input_init(void **data)
{
+ int ret = 0;
GHashTable *hash_table_key_infos = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
*data = (void *)&g_input_funcs;
- /* Parse /etc/deviced/input.conf */
+ /* Parse /etc/deviced/conf.d/input.conf */
init_hash_table_with_key_infos(hash_table_key_infos);
- syscommon_config_parse_by_section(INPUT_CONF_PATH, parse_event_action, hash_table_key_infos);
+ ret = syscommon_config_parse_by_section(INPUT_CONF_PATH, parse_event_action, hash_table_key_infos);
+ if (ret < 0)
+ _W("Cannot parse input.conf file: ret(%d)", ret);
g_hash_table_destroy(g_steal_pointer(&hash_table_key_infos));
return 0;
}
#include "input-config.h"
-#define INPUT_CONF_PATH "/etc/deviced/input.conf"
+#define INPUT_CONF_PATH "/etc/deviced/conf.d/input.conf"
/* input config list */
static GList *input_config_list;