From ba94e60cc54d23cc40cede96d43153dcdd67c2f8 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Wed, 20 Jan 2010 22:12:46 -0800 Subject: [PATCH 1/1] Find layout classes in all "layout-*" dirs. Before this CL, the generated keep flags for layout classes are incomplete, such as layout classes in res/layout-port/ and res/layout-land and so on. --- Resource.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Resource.cpp b/Resource.cpp index e2aeddf..20b0bf4 100644 --- a/Resource.cpp +++ b/Resource.cpp @@ -1831,10 +1831,16 @@ status_t writeProguardForLayouts(ProguardKeepSet* keep, const sp& assets) { status_t err; - sp layout = assets->resDir(String8("layout")); + const Vector >& dirs = assets->resDirs(); + const size_t K = dirs.size(); + for (size_t k=0; k& d = dirs.itemAt(k); + const String8& dirName = d->getLeaf(); + if ((dirName != String8("layout")) && (strncmp(dirName.string(), "layout-", 7) != 0)) { + continue; + } - if (layout != NULL) { - const KeyedVector > groups = layout->getFiles(); + const KeyedVector > groups = d->getFiles(); const size_t N = groups.size(); for (size_t i=0; i& group = groups.valueAt(i); -- 2.45.2