From: Dianne Hackborn Date: Thu, 9 Jun 2011 23:06:07 +0000 (-0700) Subject: am a8d7ea06: am 220cd77d: Merge "Enforce public resource restriction on bag parents... X-Git-Url: https://git.saurik.com/android/aapt.git/commitdiff_plain/d52548b546341a99d02e71fcbc21f6fd0e2007fc?hp=-c am a8d7ea06: am 220cd77d: Merge "Enforce public resource restriction on bag parents." into honeycomb-mr2 * commit 'a8d7ea067cf22baeee2ff0a33e5a8c5a35936942': Enforce public resource restriction on bag parents. --- d52548b546341a99d02e71fcbc21f6fd0e2007fc diff --combined ResourceTable.cpp index 5c5b4fd,d98b285..81b924a --- a/ResourceTable.cpp +++ b/ResourceTable.cpp @@@ -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", @@@ -1979,7 -1980,7 +1980,7 @@@ 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 ResourceTabl { sp 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");