| 331 | }; |
| 332 | |
| 333 | static status_t preProcessImages(const Bundle* bundle, const sp<AaptAssets>& assets, |
| 334 | const sp<ResourceTypeSet>& set, const char* type) |
| 335 | { |
| 336 | volatile bool hasErrors = false; |
| 337 | ssize_t res = NO_ERROR; |
| 338 | if (bundle->getUseCrunchCache() == false) { |
| 339 | WorkQueue wq(MAX_THREADS, false); |
| 340 | ResourceDirIterator it(set, String8(type)); |
| 341 | while ((res=it.next()) == NO_ERROR) { |
| 342 | PreProcessImageWorkUnit* w = new PreProcessImageWorkUnit( |
| 343 | bundle, assets, it.getFile(), &hasErrors); |
| 344 | status_t status = wq.schedule(w); |
| 345 | if (status) { |
| 346 | fprintf(stderr, "preProcessImages failed: schedule() returned %d\n", status); |
| 347 | hasErrors = true; |
| 348 | delete w; |
| 349 | break; |
| 350 | } |
| 351 | } |
| 352 | status_t status = wq.finish(); |
| 353 | if (status) { |
| 354 | fprintf(stderr, "preProcessImages failed: finish() returned %d\n", status); |
| 355 | hasErrors = true; |
| 356 | } |
| 357 | } |
| 358 | return (hasErrors || (res < NO_ERROR)) ? UNKNOWN_ERROR : NO_ERROR; |
| 359 | } |
| 360 | |
| 361 | status_t postProcessImages(const sp<AaptAssets>& assets, |
| 362 | ResourceTable* table, |
no test coverage detected