diff options
Diffstat (limited to 'tools/aidl/aidl.cpp')
-rw-r--r-- | tools/aidl/aidl.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/tools/aidl/aidl.cpp b/tools/aidl/aidl.cpp index c39e603a70a5..ab9a2454dab4 100644 --- a/tools/aidl/aidl.cpp +++ b/tools/aidl/aidl.cpp @@ -419,11 +419,19 @@ check_method(const char* filename, int kind, method_type* m) return err; } - if (!(kind == INTERFACE_TYPE_BINDER ? returnType->CanWriteToParcel() - : returnType->CanWriteToRpcData())) { - fprintf(stderr, "%s:%d return type %s can't be marshalled.\n", filename, - m->type.type.lineno, m->type.type.data); - err = 1; + if (returnType == EVENT_FAKE_TYPE) { + if (kind != INTERFACE_TYPE_RPC) { + fprintf(stderr, "%s:%d event methods only supported for rpc interfaces\n", + filename, m->type.type.lineno); + err = 1; + } + } else { + if (!(kind == INTERFACE_TYPE_BINDER ? returnType->CanWriteToParcel() + : returnType->CanWriteToRpcData())) { + fprintf(stderr, "%s:%d return type %s can't be marshalled.\n", filename, + m->type.type.lineno, m->type.type.data); + err = 1; + } } if (m->type.dimension > 0 && !returnType->CanBeArray()) { @@ -455,6 +463,14 @@ check_method(const char* filename, int kind, method_type* m) err = 1; goto next; } + + if (t == EVENT_FAKE_TYPE) { + fprintf(stderr, "%s:%d parameter %s (%d) event can not be used as a parameter %s\n", + filename, m->type.type.lineno, arg->name.data, index, + arg->type.type.data); + err = 1; + goto next; + } if (!(kind == INTERFACE_TYPE_BINDER ? t->CanWriteToParcel() : t->CanWriteToRpcData())) { fprintf(stderr, "%s:%d parameter %d: '%s %s' can't be marshalled.\n", @@ -505,7 +521,7 @@ check_method(const char* filename, int kind, method_type* m) // check that the name doesn't match a keyword if (matches_keyword(arg->name.data)) { fprintf(stderr, "%s:%d parameter %d %s is named the same as a" - " Java keyword\n", + " Java or aidl keyword\n", filename, m->name.lineno, index, arg->name.data); err = 1; } |