diff options
author | Elliott Hughes | 2016-06-29 16:12:29 -0500 |
---|---|---|
committer | Elliott Hughes | 2016-06-29 16:12:29 -0500 |
commit | b22b9987a88f524986c5e40323bfbbb3bb943290 (patch) | |
tree | d0f97ed51d03aef11118e4a939aa14c28f0c3d6c /toolbox | |
parent | 54c121962bdf68c7c66724159260c926ce58e351 (diff) | |
download | platform-system-core-b22b9987a88f524986c5e40323bfbbb3bb943290.tar.gz platform-system-core-b22b9987a88f524986c5e40323bfbbb3bb943290.tar.xz platform-system-core-b22b9987a88f524986c5e40323bfbbb3bb943290.zip |
Fix the generated getevent labels.
Some of the less-used stuff stayed behind in input.h, so we need to
parse both files.
Change-Id: Iff2b6e3fc4f5a6584169d12f16427b4f235da21a
Test: manual inspection of the generated file.
Diffstat (limited to 'toolbox')
-rw-r--r-- | toolbox/Android.mk | 2 | ||||
-rwxr-xr-x | toolbox/generate-input.h-labels.py | 67 |
2 files changed, 35 insertions, 34 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk index 23af1f9bc..ad8ac03f4 100644 --- a/toolbox/Android.mk +++ b/toolbox/Android.mk | |||
@@ -73,7 +73,7 @@ $(TOOLS_H): | |||
73 | 73 | ||
74 | $(LOCAL_PATH)/getevent.c: $(intermediates)/input.h-labels.h | 74 | $(LOCAL_PATH)/getevent.c: $(intermediates)/input.h-labels.h |
75 | 75 | ||
76 | UAPI_INPUT_EVENT_CODES_H := bionic/libc/kernel/uapi/linux/input-event-codes.h | 76 | UAPI_INPUT_EVENT_CODES_H := bionic/libc/kernel/uapi/linux/input.h bionic/libc/kernel/uapi/linux/input-event-codes.h |
77 | INPUT_H_LABELS_H := $(intermediates)/input.h-labels.h | 77 | INPUT_H_LABELS_H := $(intermediates)/input.h-labels.h |
78 | $(INPUT_H_LABELS_H): PRIVATE_LOCAL_PATH := $(LOCAL_PATH) | 78 | $(INPUT_H_LABELS_H): PRIVATE_LOCAL_PATH := $(LOCAL_PATH) |
79 | # The PRIVATE_CUSTOM_TOOL line uses = to evaluate the output path late. | 79 | # 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 | ||
39 | r = re.compile(r'#define\s+(\S+)\s+((?:0x)?\d+)') | 39 | r = re.compile(r'#define\s+(\S+)\s+((?:0x)?\d+)') |
40 | 40 | ||
41 | with open(sys.argv[1], 'r') as f: | 41 | for 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 | ||
75 | def Dump(struct_name, values): | 76 | def Dump(struct_name, values): |
76 | print('static struct label %s[] = {' % (struct_name)) | 77 | print('static struct label %s[] = {' % (struct_name)) |