From 50a94b86307793ca9d4d8f8564e5f2ba78fdde14 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 16 Aug 2012 14:37:28 -0700 Subject: Allow multiple 'parcelable' declarations in aidl files This solves a problem with declaring multiple Parcelable static inner classes. Change-Id: I5e42b412d6d937df19a388988be5aa58a8dbc3e4 --- tools/aidl/aidl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tools/aidl') diff --git a/tools/aidl/aidl.cpp b/tools/aidl/aidl.cpp index 8dbbf50..0728246 100644 --- a/tools/aidl/aidl.cpp +++ b/tools/aidl/aidl.cpp @@ -590,7 +590,8 @@ exactly_one_interface(const char* filename, const document_item_type* items, con } const document_item_type* next = items->next; - if (items->next != NULL) { + // Allow parcelables to skip the "one-only" rule. + if (items->next != NULL && next->item_type != USER_DATA_TYPE) { int lineno = -1; if (next->item_type == INTERFACE_TYPE_BINDER) { lineno = ((interface_type*)next)->interface_token.lineno; @@ -598,9 +599,6 @@ exactly_one_interface(const char* filename, const document_item_type* items, con else if (next->item_type == INTERFACE_TYPE_RPC) { lineno = ((interface_type*)next)->interface_token.lineno; } - else if (next->item_type == USER_DATA_TYPE) { - lineno = ((user_data_type*)next)->keyword_token.lineno; - } fprintf(stderr, "%s:%d aidl can only handle one interface per file\n", filename, lineno); return 1; -- cgit v1.1