From: Ying Wang Date: Thu, 21 Jan 2010 06:12:46 +0000 (-0800) Subject: Find layout classes in all "layout-*" dirs. X-Git-Url: https://git.saurik.com/android/aapt.git/commitdiff_plain/ba94e60cc54d23cc40cede96d43153dcdd67c2f8?hp=87e7a47ba1e96211bc7f5a440ccedc9d0ab516c2 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. --- 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);