diff options
author | Maurice Chu <mochu@google.com> | 2012-10-18 14:47:13 -0700 |
---|---|---|
committer | Maurice Chu <mochu@google.com> | 2012-10-18 14:47:13 -0700 |
commit | 02822d059031d539f4b4b69ae0ee6c4ad52388f2 (patch) | |
tree | 142e0033575f86c8793903d17d2e32d0c455c292 /tools/aidl/generate_java_binder.cpp | |
parent | f78283324400487a9acdb5d32536295fa85bd8f3 (diff) |
Enhance AIDL to take an explicit id for methods
This adds an annotation to methods in AIDL of the form
"void myMethod() = 3;" to explicitly set the onTransact
id for the method. Either all methods must have explicitly
annotated id's or none of them should be explicitly annotated.
There is error checking in the AIDL compiler
for duplicate id's and id's outside of the valid range.
Bug: 7353910
Change-Id: I868045e3f112c9a279c573cea368a621116cbf77
Diffstat (limited to 'tools/aidl/generate_java_binder.cpp')
-rw-r--r-- | tools/aidl/generate_java_binder.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/aidl/generate_java_binder.cpp b/tools/aidl/generate_java_binder.cpp index f80a388eed55..f291ceb2b09f 100644 --- a/tools/aidl/generate_java_binder.cpp +++ b/tools/aidl/generate_java_binder.cpp @@ -260,7 +260,7 @@ generate_method(const method_type* method, Class* interface, string transactCodeName = "TRANSACTION_"; transactCodeName += method->name.data; - char transactCodeValue[50]; + char transactCodeValue[60]; sprintf(transactCodeValue, "(android.os.IBinder.FIRST_CALL_TRANSACTION + %d)", index); Field* transactCode = new Field(STATIC | FINAL, @@ -548,7 +548,8 @@ generate_binder_interface_class(const interface_type* iface) interface_item_type* item = iface->interface_items; while (item != NULL) { if (item->item_type == METHOD_TYPE) { - generate_method((method_type*)item, interface, stub, proxy, index); + method_type * method_item = (method_type*) item; + generate_method(method_item, interface, stub, proxy, method_item->assigned_id); } item = item->next; index++; |