| 333 | } |
| 334 | |
| 335 | status_t writeResFileFD(int fd, const sp<AaptAssets>& assets) { |
| 336 | FILE* fp = fdopen(fd, "w+"); |
| 337 | sp<AaptFile> resFile(getResourceFile(assets)); |
| 338 | if (resFile == NULL || resFile->getData() == NULL || resFile->getSize() == 0) { |
| 339 | fprintf(stderr, "Res table or its data is null or empty. Nothing to write\n"); |
| 340 | fclose(fp); |
| 341 | return UNKNOWN_ERROR; |
| 342 | } |
| 343 | |
| 344 | int count = 0; |
| 345 | count = fwrite(resFile->getData(), 1, resFile->getSize(), fp); |
| 346 | |
| 347 | if (count == 0) { |
| 348 | fprintf(stderr, "Nothing written to %d\n", fd); |
| 349 | } |
| 350 | fclose(fp); |
| 351 | |
| 352 | return NO_ERROR; |
| 353 | } |
| 354 | |
| 355 | ssize_t processAssets(Bundle* bundle, ZipFile* zip, |
| 356 | const sp<AaptAssets>& assets, bool isOverlay) |
no test coverage detected