-
- sp<Entry> e = getEntry(package, type, name, sourcePos, params);
+ if (overlay && !hasBagOrEntry(package, type, name)) {
+ sourcePos.error("Can't add new bags in an overlay. See '%s'\n",
+ String8(name).string());
+ return UNKNOWN_ERROR;
+ }
+ sp<Entry> e = getEntry(package, type, name, sourcePos, overlay, params);