Retain imported AidlDocuments even after parsing.

For each import statements, load_and_validate_aidl parses the imported
file. However, the resultant AidlDocument objects have not been returned
to the caller, and thus they are destroyed after the function returns.
This made it impossible to refer to the imported types from
AidlTypenamespace after the parsing, i.e., code generation.

Fix the problem by retaining the AidlDocument objects in the
corresponding AidlImport objects.

Test: m -j
Test: runtests.sh
Change-Id: Ibe51289803e8bae61dd20b7b98ee1606e46b5743
2 files changed