summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLaurent Tu <laurentt@google.com>2013-02-14 16:12:54 -0800
committerLaurent Tu <laurentt@google.com>2013-02-14 16:12:54 -0800
commit4f115e08cb68aaf77693f3f4598f0eb5f7634777 (patch)
tree60f04cf05eda60bc58fb6e9e1926065416d7958e /tools
parent00dcbf8f58c36e3e8803336aa947a333411f43d0 (diff)
downloadframeworks_base-4f115e08cb68aaf77693f3f4598f0eb5f7634777.zip
frameworks_base-4f115e08cb68aaf77693f3f4598f0eb5f7634777.tar.gz
frameworks_base-4f115e08cb68aaf77693f3f4598f0eb5f7634777.tar.bz2
Tentative fix for aidl import issue
Fix issue when aidl generation doesn't use the right type when it is a suffix of a pre-declared type. eg. android.location.Location and foo.android.location.Location. The aidl generation will never use foo.android.location.Location. The tentative fix reverses the order in which Namespace.Search iterates through the known types. A better fix would be to annotate the types that are declared in the aidl import statements to be prioritary in Namespace.Search. Lmk if I you agree with this approach and think that this is worth the work. Thanks! Change-Id: I97dd1a1d417075accf1d61f9aba5aba3dea175c6
Diffstat (limited to 'tools')
-rw-r--r--tools/aidl/Type.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/aidl/Type.cpp b/tools/aidl/Type.cpp
index d572af6..c637aee 100644
--- a/tools/aidl/Type.cpp
+++ b/tools/aidl/Type.cpp
@@ -1348,7 +1348,7 @@ Namespace::Search(const string& name)
// would be the place to do it, but I don't think the complexity in
// scoping rules is worth it.
int N = m_types.size();
- for (int i=0; i<N; i++) {
+ for (int i=N-1; i>=0; i--) {
if (m_types[i]->Name() == name) {
return m_types[i];
}