From 2037c2585c4e00a11d85731a6a6a2152589dde63 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Tue, 8 Nov 2011 17:35:09 -0800 Subject: [PATCH] For events, require that the parameters be marked in. (because they won't work otherwise) Change-Id: I77f370ca1bc381ea07fc2854d2a90d8138ca1796 --- tools/aidl/aidl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/aidl/aidl.cpp b/tools/aidl/aidl.cpp index cd23b65cf791a..3d314dba3e7c7 100644 --- a/tools/aidl/aidl.cpp +++ b/tools/aidl/aidl.cpp @@ -476,6 +476,15 @@ check_method(const char* filename, int kind, method_type* m) err = 1; } + if (returnType == EVENT_FAKE_TYPE + && convert_direction(arg->direction.data) != IN_PARAMETER) { + fprintf(stderr, "%s:%d parameter %d: '%s %s' All paremeters on events must be 'in'.\n", + filename, m->type.type.lineno, index, + arg->type.type.data, arg->name.data); + err = 1; + goto next; + } + if (arg->direction.data == NULL && (arg->type.dimension != 0 || t->CanBeOutParameter())) { fprintf(stderr, "%s:%d parameter %d: '%s %s' can be an out"