Merge \\\"Fix the generated getevent labels.\\\" am: 80beb506cf am: 2f589bf974

am: dc4493cbbb

Change-Id: I10ff41b46fc46726298ba84e4f88e8c1e7cd58da
This commit is contained in:
Elliott Hughes 2016-06-29 23:52:56 +00:00 committed by android-build-merger
commit 74fa5b8dba
2 changed files with 35 additions and 34 deletions

View File

@ -70,7 +70,7 @@ $(TOOLS_H):
$(LOCAL_PATH)/getevent.c: $(intermediates)/input.h-labels.h
UAPI_INPUT_EVENT_CODES_H := bionic/libc/kernel/uapi/linux/input-event-codes.h
UAPI_INPUT_EVENT_CODES_H := bionic/libc/kernel/uapi/linux/input.h bionic/libc/kernel/uapi/linux/input-event-codes.h
INPUT_H_LABELS_H := $(intermediates)/input.h-labels.h
$(INPUT_H_LABELS_H): PRIVATE_LOCAL_PATH := $(LOCAL_PATH)
# The PRIVATE_CUSTOM_TOOL line uses = to evaluate the output path late.

View File

@ -38,39 +38,40 @@ ff_list = []
r = re.compile(r'#define\s+(\S+)\s+((?:0x)?\d+)')
with open(sys.argv[1], 'r') as f:
for line in f:
m = r.match(line)
if m:
name = m.group(1)
if name.startswith("INPUT_PROP_"):
input_prop_list.append(name)
elif name.startswith("EV_"):
ev_list.append(name)
elif name.startswith("SYN_"):
syn_list.append(name)
elif name.startswith("KEY_") or name.startswith("BTN_"):
key_list.append(name)
elif name.startswith("REL_"):
rel_list.append(name)
elif name.startswith("ABS_"):
abs_list.append(name)
elif name.startswith("SW_"):
sw_list.append(name)
elif name.startswith("MSC_"):
msc_list.append(name)
elif name.startswith("LED_"):
led_list.append(name)
elif name.startswith("REP_"):
rep_list.append(name)
elif name.startswith("SND_"):
snd_list.append(name)
elif name.startswith("MT_TOOL_"):
mt_tool_list.append(name)
elif name.startswith("FF_STATUS_"):
ff_status_list.append(name)
elif name.startswith("FF_"):
ff_list.append(name)
for arg in sys.argv[1:]:
with open(arg, 'r') as f:
for line in f:
m = r.match(line)
if m:
name = m.group(1)
if name.startswith("INPUT_PROP_"):
input_prop_list.append(name)
elif name.startswith("EV_"):
ev_list.append(name)
elif name.startswith("SYN_"):
syn_list.append(name)
elif name.startswith("KEY_") or name.startswith("BTN_"):
key_list.append(name)
elif name.startswith("REL_"):
rel_list.append(name)
elif name.startswith("ABS_"):
abs_list.append(name)
elif name.startswith("SW_"):
sw_list.append(name)
elif name.startswith("MSC_"):
msc_list.append(name)
elif name.startswith("LED_"):
led_list.append(name)
elif name.startswith("REP_"):
rep_list.append(name)
elif name.startswith("SND_"):
snd_list.append(name)
elif name.startswith("MT_TOOL_"):
mt_tool_list.append(name)
elif name.startswith("FF_STATUS_"):
ff_status_list.append(name)
elif name.startswith("FF_"):
ff_list.append(name)
def Dump(struct_name, values):
print('static struct label %s[] = {' % (struct_name))