summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot2016-06-29 18:43:15 -0500
committerGerrit Code Review2016-06-29 18:43:15 -0500
commit80beb506cf84410608a006cef70198919e0808b7 (patch)
tree92528bb8a85c19432680353df1c8fa96266354b4 /toolbox
parentb0d062a497bee38ff2a7c6c965e29af4199c3fe0 (diff)
parentb22b9987a88f524986c5e40323bfbbb3bb943290 (diff)
downloadplatform-system-core-80beb506cf84410608a006cef70198919e0808b7.tar.gz
platform-system-core-80beb506cf84410608a006cef70198919e0808b7.tar.xz
platform-system-core-80beb506cf84410608a006cef70198919e0808b7.zip
Merge "Fix the generated getevent labels."
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/Android.mk2
-rwxr-xr-xtoolbox/generate-input.h-labels.py67
2 files changed, 35 insertions, 34 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk
index c7b6d4c0b..c9e2ddd90 100644
--- a/toolbox/Android.mk
+++ b/toolbox/Android.mk
@@ -70,7 +70,7 @@ $(TOOLS_H):
70 70
71$(LOCAL_PATH)/getevent.c: $(intermediates)/input.h-labels.h 71$(LOCAL_PATH)/getevent.c: $(intermediates)/input.h-labels.h
72 72
73UAPI_INPUT_EVENT_CODES_H := bionic/libc/kernel/uapi/linux/input-event-codes.h 73UAPI_INPUT_EVENT_CODES_H := bionic/libc/kernel/uapi/linux/input.h bionic/libc/kernel/uapi/linux/input-event-codes.h
74INPUT_H_LABELS_H := $(intermediates)/input.h-labels.h 74INPUT_H_LABELS_H := $(intermediates)/input.h-labels.h
75$(INPUT_H_LABELS_H): PRIVATE_LOCAL_PATH := $(LOCAL_PATH) 75$(INPUT_H_LABELS_H): PRIVATE_LOCAL_PATH := $(LOCAL_PATH)
76# The PRIVATE_CUSTOM_TOOL line uses = to evaluate the output path late. 76# The PRIVATE_CUSTOM_TOOL line uses = to evaluate the output path late.
diff --git a/toolbox/generate-input.h-labels.py b/toolbox/generate-input.h-labels.py
index a2b911165..c0e9fce6e 100755
--- a/toolbox/generate-input.h-labels.py
+++ b/toolbox/generate-input.h-labels.py
@@ -38,39 +38,40 @@ ff_list = []
38 38
39r = re.compile(r'#define\s+(\S+)\s+((?:0x)?\d+)') 39r = re.compile(r'#define\s+(\S+)\s+((?:0x)?\d+)')
40 40
41with open(sys.argv[1], 'r') as f: 41for arg in sys.argv[1:]:
42 for line in f: 42 with open(arg, 'r') as f:
43 m = r.match(line) 43 for line in f:
44 if m: 44 m = r.match(line)
45 name = m.group(1) 45 if m:
46 if name.startswith("INPUT_PROP_"): 46 name = m.group(1)
47 input_prop_list.append(name) 47 if name.startswith("INPUT_PROP_"):
48 elif name.startswith("EV_"): 48 input_prop_list.append(name)
49 ev_list.append(name) 49 elif name.startswith("EV_"):
50 elif name.startswith("SYN_"): 50 ev_list.append(name)
51 syn_list.append(name) 51 elif name.startswith("SYN_"):
52 elif name.startswith("KEY_") or name.startswith("BTN_"): 52 syn_list.append(name)
53 key_list.append(name) 53 elif name.startswith("KEY_") or name.startswith("BTN_"):
54 elif name.startswith("REL_"): 54 key_list.append(name)
55 rel_list.append(name) 55 elif name.startswith("REL_"):
56 elif name.startswith("ABS_"): 56 rel_list.append(name)
57 abs_list.append(name) 57 elif name.startswith("ABS_"):
58 elif name.startswith("SW_"): 58 abs_list.append(name)
59 sw_list.append(name) 59 elif name.startswith("SW_"):
60 elif name.startswith("MSC_"): 60 sw_list.append(name)
61 msc_list.append(name) 61 elif name.startswith("MSC_"):
62 elif name.startswith("LED_"): 62 msc_list.append(name)
63 led_list.append(name) 63 elif name.startswith("LED_"):
64 elif name.startswith("REP_"): 64 led_list.append(name)
65 rep_list.append(name) 65 elif name.startswith("REP_"):
66 elif name.startswith("SND_"): 66 rep_list.append(name)
67 snd_list.append(name) 67 elif name.startswith("SND_"):
68 elif name.startswith("MT_TOOL_"): 68 snd_list.append(name)
69 mt_tool_list.append(name) 69 elif name.startswith("MT_TOOL_"):
70 elif name.startswith("FF_STATUS_"): 70 mt_tool_list.append(name)
71 ff_status_list.append(name) 71 elif name.startswith("FF_STATUS_"):
72 elif name.startswith("FF_"): 72 ff_status_list.append(name)
73 ff_list.append(name) 73 elif name.startswith("FF_"):
74 ff_list.append(name)
74 75
75def Dump(struct_name, values): 76def Dump(struct_name, values):
76 print('static struct label %s[] = {' % (struct_name)) 77 print('static struct label %s[] = {' % (struct_name))