Loading tools/aapt/ResourceTable.cpp +32 −1 Original line number Diff line number Diff line Loading @@ -695,7 +695,7 @@ status_t parseAndAddEntry(Bundle* bundle, if (isInProductList(product, String16(bundleProduct))) { ; } else if (strcmp16(String16("default").string(), product.string()) == 0 && !outTable->hasBagOrEntry(myPackage, curType, ident)) { !outTable->hasBagOrEntry(myPackage, curType, ident, config)) { ; } else { return NO_ERROR; Loading Loading @@ -1823,6 +1823,37 @@ bool ResourceTable::hasBagOrEntry(const String16& package, return false; } bool ResourceTable::hasBagOrEntry(const String16& package, const String16& type, const String16& name, const ResTable_config& config) const { // First look for this in the included resources... uint32_t rid = mAssets->getIncludedResources() .identifierForName(name.string(), name.size(), type.string(), type.size(), package.string(), package.size()); if (rid != 0) { return true; } sp<Package> p = mPackages.valueFor(package); if (p != NULL) { sp<Type> t = p->getTypes().valueFor(type); if (t != NULL) { sp<ConfigList> c = t->getConfigs().valueFor(name); if (c != NULL) { sp<Entry> e = c->getEntries().valueFor(config); if (e != NULL) { return true; } } } } return false; } bool ResourceTable::hasBagOrEntry(const String16& ref, const String16* defType, const String16* defPackage) Loading tools/aapt/ResourceTable.h +5 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,11 @@ public: const String16& type, const String16& name) const; bool hasBagOrEntry(const String16& package, const String16& type, const String16& name, const ResTable_config& config) const; bool hasBagOrEntry(const String16& ref, const String16* defType = NULL, const String16* defPackage = NULL); Loading Loading
tools/aapt/ResourceTable.cpp +32 −1 Original line number Diff line number Diff line Loading @@ -695,7 +695,7 @@ status_t parseAndAddEntry(Bundle* bundle, if (isInProductList(product, String16(bundleProduct))) { ; } else if (strcmp16(String16("default").string(), product.string()) == 0 && !outTable->hasBagOrEntry(myPackage, curType, ident)) { !outTable->hasBagOrEntry(myPackage, curType, ident, config)) { ; } else { return NO_ERROR; Loading Loading @@ -1823,6 +1823,37 @@ bool ResourceTable::hasBagOrEntry(const String16& package, return false; } bool ResourceTable::hasBagOrEntry(const String16& package, const String16& type, const String16& name, const ResTable_config& config) const { // First look for this in the included resources... uint32_t rid = mAssets->getIncludedResources() .identifierForName(name.string(), name.size(), type.string(), type.size(), package.string(), package.size()); if (rid != 0) { return true; } sp<Package> p = mPackages.valueFor(package); if (p != NULL) { sp<Type> t = p->getTypes().valueFor(type); if (t != NULL) { sp<ConfigList> c = t->getConfigs().valueFor(name); if (c != NULL) { sp<Entry> e = c->getEntries().valueFor(config); if (e != NULL) { return true; } } } } return false; } bool ResourceTable::hasBagOrEntry(const String16& ref, const String16* defType, const String16* defPackage) Loading
tools/aapt/ResourceTable.h +5 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,11 @@ public: const String16& type, const String16& name) const; bool hasBagOrEntry(const String16& package, const String16& type, const String16& name, const ResTable_config& config) const; bool hasBagOrEntry(const String16& ref, const String16* defType = NULL, const String16* defPackage = NULL); Loading