]> git.saurik.com Git - android/aapt.git/commitdiff
am 6f9e2c64: Merge "Find layout classes in all "layout-*" dirs." into eclair
authorYing Wang <wangying@google.com>
Thu, 21 Jan 2010 19:12:29 +0000 (11:12 -0800)
committerAndroid Git Automerger <android-git-automerger@android.com>
Thu, 21 Jan 2010 19:12:29 +0000 (11:12 -0800)
Merge commit '6f9e2c648c0588a2eedef2746c9750ed9c6945be' into eclair-plus-aosp

* commit '6f9e2c648c0588a2eedef2746c9750ed9c6945be':
  Find layout classes in all "layout-*" dirs.

Resource.cpp

index e2aeddfebfa5e6c6948c2d2861344a1da43b1590..20b0bf4c3ad47c2b97521913c967e74cb4f3cdcb 100644 (file)
@@ -1831,10 +1831,16 @@ status_t
 writeProguardForLayouts(ProguardKeepSet* keep, const sp<AaptAssets>& assets)
 {
     status_t err;
-    sp<AaptDir> layout = assets->resDir(String8("layout"));
+    const Vector<sp<AaptDir> >& dirs = assets->resDirs();
+    const size_t K = dirs.size();
+    for (size_t k=0; k<K; k++) {
+        const sp<AaptDir>& 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<String8,sp<AaptGroup> > groups = layout->getFiles();
+        const KeyedVector<String8,sp<AaptGroup> > groups = d->getFiles();
         const size_t N = groups.size();
         for (size_t i=0; i<N; i++) {
             const sp<AaptGroup>& group = groups.valueAt(i);