Merge "Do not stack allocate RefBase object in AaptAssets::filter"
This commit is contained in:
@@ -1306,8 +1306,8 @@ bail:
|
|||||||
|
|
||||||
status_t AaptAssets::filter(Bundle* bundle)
|
status_t AaptAssets::filter(Bundle* bundle)
|
||||||
{
|
{
|
||||||
WeakResourceFilter reqFilter;
|
sp<WeakResourceFilter> reqFilter(new WeakResourceFilter());
|
||||||
status_t err = reqFilter.parse(bundle->getConfigurations());
|
status_t err = reqFilter->parse(bundle->getConfigurations());
|
||||||
if (err != NO_ERROR) {
|
if (err != NO_ERROR) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -1323,12 +1323,12 @@ status_t AaptAssets::filter(Bundle* bundle)
|
|||||||
preferredDensity = preferredConfig.density;
|
preferredDensity = preferredConfig.density;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reqFilter.isEmpty() && preferredDensity == 0) {
|
if (reqFilter->isEmpty() && preferredDensity == 0) {
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bundle->getVerbose()) {
|
if (bundle->getVerbose()) {
|
||||||
if (!reqFilter.isEmpty()) {
|
if (!reqFilter->isEmpty()) {
|
||||||
printf("Applying required filter: %s\n",
|
printf("Applying required filter: %s\n",
|
||||||
bundle->getConfigurations().string());
|
bundle->getConfigurations().string());
|
||||||
}
|
}
|
||||||
@@ -1380,7 +1380,7 @@ status_t AaptAssets::filter(Bundle* bundle)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const ResTable_config& config(file->getGroupEntry().toParams());
|
const ResTable_config& config(file->getGroupEntry().toParams());
|
||||||
if (!reqFilter.match(config)) {
|
if (!reqFilter->match(config)) {
|
||||||
if (bundle->getVerbose()) {
|
if (bundle->getVerbose()) {
|
||||||
printf("Pruning unneeded resource: %s\n",
|
printf("Pruning unneeded resource: %s\n",
|
||||||
file->getPrintableSource().string());
|
file->getPrintableSource().string());
|
||||||
|
|||||||
Reference in New Issue
Block a user