MCPcopy Create free account
hub / github.com/CyanogenMod/android_frameworks_base / preProcessImages

Function preProcessImages

tools/aapt/Resource.cpp:333–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331};
332
333static 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
361status_t postProcessImages(const sp<AaptAssets>& assets,
362 ResourceTable* table,

Callers 1

buildResourcesFunction · 0.85

Calls 4

getUseCrunchCacheMethod · 0.80
scheduleMethod · 0.80
nextMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected