@@ -695,7 +695,7 @@ status_t parseAndAddEntry(Bundle* bundle,
695695 if (isInProductList (product, String16 (bundleProduct))) {
696696 ;
697697 } else if (strcmp16 (String16 (" default" ).string (), product.string ()) == 0 &&
698- !outTable->hasBagOrEntry (myPackage, curType, ident)) {
698+ !outTable->hasBagOrEntry (myPackage, curType, ident, config )) {
699699 ;
700700 } else {
701701 return NO_ERROR;
@@ -1823,6 +1823,37 @@ bool ResourceTable::hasBagOrEntry(const String16& package,
18231823 return false ;
18241824}
18251825
1826+ bool ResourceTable::hasBagOrEntry (const String16& package,
1827+ const String16& type,
1828+ const String16& name,
1829+ const ResTable_config& config) const
1830+ {
1831+ // First look for this in the included resources...
1832+ uint32_t rid = mAssets ->getIncludedResources ()
1833+ .identifierForName (name.string (), name.size (),
1834+ type.string (), type.size (),
1835+ package.string (), package.size ());
1836+ if (rid != 0 ) {
1837+ return true ;
1838+ }
1839+
1840+ sp<Package> p = mPackages .valueFor (package);
1841+ if (p != NULL ) {
1842+ sp<Type> t = p->getTypes ().valueFor (type);
1843+ if (t != NULL ) {
1844+ sp<ConfigList> c = t->getConfigs ().valueFor (name);
1845+ if (c != NULL ) {
1846+ sp<Entry> e = c->getEntries ().valueFor (config);
1847+ if (e != NULL ) {
1848+ return true ;
1849+ }
1850+ }
1851+ }
1852+ }
1853+
1854+ return false ;
1855+ }
1856+
18261857bool ResourceTable::hasBagOrEntry (const String16& ref,
18271858 const String16* defType,
18281859 const String16* defPackage)
0 commit comments