]> git.saurik.com Git - android/aapt.git/commitdiff
am a8d7ea06: am 220cd77d: Merge "Enforce public resource restriction on bag parents...
authorDianne Hackborn <hackbod@google.com>
Thu, 9 Jun 2011 23:06:07 +0000 (16:06 -0700)
committerAndroid Git Automerger <android-git-automerger@android.com>
Thu, 9 Jun 2011 23:06:07 +0000 (16:06 -0700)
* commit 'a8d7ea067cf22baeee2ff0a33e5a8c5a35936942':
  Enforce public resource restriction on bag parents.

1  2 
ResourceTable.cpp

diff --combined ResourceTable.cpp
index 5c5b4fdc3269ede648345886ff7cf18c9f40b66f,d98b285dd1e3c8be7b16d92886f0704559fc51ca..81b924af8d7e58192105549e397fc6a11b69d63d
@@@ -1963,10 -1963,11 +1963,11 @@@ uint32_t ResourceTable::getResId(const 
                                   bool onlyPublic) const
  {
      String16 package, type, name;
+     bool refOnlyPublic = true;
      if (!ResTable::expandResourceRef(
          ref.string(), ref.size(), &package, &type, &name,
          defType, defPackage ? defPackage:&mAssetsPackage,
-         outErrorMsg)) {
+         outErrorMsg, &refOnlyPublic)) {
          NOISY(printf("Expanding resource: ref=%s\n",
                       String8(ref).string()));
          NOISY(printf("Expanding resource: defType=%s\n",
                       String8(name).string()));
          return 0;
      }
-     uint32_t res = getResId(package, type, name, onlyPublic);
+     uint32_t res = getResId(package, type, name, onlyPublic && refOnlyPublic);
      NOISY(printf("Expanded resource: p=%s, t=%s, n=%s, res=%d\n",
                   String8(package).string(), String8(type).string(),
                   String8(name).string(), res));
@@@ -3705,9 -3706,7 +3706,9 @@@ sp<ResourceTable::Package> ResourceTabl
  {
      sp<Package> p = mPackages.valueFor(package);
      if (p == NULL) {
 -        if (mIsAppPackage) {
 +        if (mBundle->getIsOverlayPackage()) {
 +            p = new Package(package, 0x00);
 +        } else if (mIsAppPackage) {
              if (mHaveAppPackage) {
                  fprintf(stderr, "Adding multiple application package resources; only one is allowed.\n"
                                  "Use -x to create extended resources.\n");