diff options
author | 2011-09-23 15:17:52 -0700 | |
---|---|---|
committer | 2012-02-10 10:51:22 -0800 | |
commit | e24dbeafe64278408b3342fcb77756bc7d091791 (patch) | |
tree | 6c494ea8719fc18be35469a32b0d2ee9d3fc23c3 /tools/aidl/aidl.cpp | |
parent | 7dbc4b457d2c2c6dd39fa445e7edd8109796f0a2 (diff) |
add presenters to aidl.
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; } |